[PD] GEM : GLSL Mixer - working 2 channel video mixer example

cyrille henry cyrille.henry at la-kitchen.fr
Wed Jan 2 18:18:37 CET 2008



Alexandre Quessy a écrit :
> Super nice !
> I didn't know about the "texunit 0" message you can send to
> pix_texture. Are there other things I should know regarding
> [pix_texture] before I start over again my texture storage
> abstractions ?
> 
> Regarding texture coordinates, we can not access gl_MultiTexCoord1 due
> to a bug in [glsl_program] ? That means that it is ok as long as we
> use simple coordinates like from (0,0) to (1,1) on a rectangle ?
no.
that mean it's ok if all your texture have the same size.
if not, you'll have to make correction.
i.e : 
coord_for_texture_1.x= K.x * tex_Coord_0.x
coord_for_texture_1.y= K.y * tex_Coord_0.y
 
you'll nead to find K.x and K.y


using coordinate mode 0 : texture coordinate goes from (0,0) to (size.x,size.y), so it's easier to get the size of the texture (with pix_info), send it to the shader to make the correction.

cyrille

> That's a starting point. At least we can do overlay blending and so
> on.
> 
> And happy new 2008.
> 
> a
> 
> 
> 
> 2007/12/24, vade <doktorp at mac.com>:
>> Hello
>>
>> Here is a 2 channel mixer using overlay blend mode with GLSL. This
>> works, is decently fast and gives me the expected result.
>>
>> If you want more blend modes, feel free to grab them from http://001.vade.info
>>   (or elsewhere, most are trivial to figure out)- the glsl shaders for
>> the mixers use the same subroutine layout in the glsl, so it is
>> trivial to swap. I did not include them out of sheer laziness.
>>
>> Caveats with PD 0.4.03 Extended nightly from Dec 24th (Mac OS X
>> 10.5.1, QT 7.3, Intel):
>>
>>   - had to edit the GLSL program to fix multitexture coordinate issue.
>> Only can use the texture dims from the zeroths texture unit.
>>   - could not get sampler2DRect working at all - only had a single
>> texel mapped it seemed.
>>   - had weird issue where I would sometimes have to close the gemwin
>> (0, destroy) and then re create it to see the textures assigned to
>> texture units.
>>         this happened most often after closing and re-opening the patch.
>>
>> Please see the included question(s) within the PD patch concerning
>> using framebuffer to grab the output of the rendered shader and send
>> it to yet another shader. Ive included an exposure shader in an
>> attempt to make a chain of GLSL effects. I however could not get
>> gemframebuffer to output any usable texture after using glslprogram.
>>
>> Thanks, hope this is helpful to those out there
>>
>> FUDDLE DUDDLE !@#!@#!@#()*!@#(*@#
>>
>> :)
>>
>>
>>
>>
>> _______________________________________________
>> PD-list at iem.at mailing list
>> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
>>
>>
>>
> 
> 




More information about the Pd-list mailing list