[GEM-dev] 2textures + gemframebuffer

cyrille henry cyrille.henry at la-kitchen.fr
Sun Mar 30 23:21:10 CEST 2008



marius schebella a écrit :
> actually, the 06. patch might be more complex, but it is not doing what 
> I need. I really need two textures, both coming from other framebuffers. 
that's what i send you in my last mail.

> and all my attempts with dummy images failed.
> can you have a look at my patch? I hope the zip does not get caught in 
> the spam.
ok
you should not send texunit to the texture you're using to texture in a square : the 1st texture (texunit 0) is used for the texturing, so sending texunit 1 will result in corrupted  data in texunit 0.
so, you have to get the texture Id out of the framebuffer, and send it to an other pix_texture. this 2nd pix_texture can then be used as texunit 1...


rendering order is very important. i don't understand why frambuffer should be render before anything else. this is certainly a small bug.

so, this patch work with image. with video, you'll may have 1 frame delay.

in fact, you're right, it's not trivial, i'll may have to clean this patch and commit it to cvs.

cyrille


> thank you!
> marius.
> 
> 
> cyrille henry wrote:
>>
>>
>> marius schebella a écrit :
>>> cyrille henry wrote:
>>>
>>>> look at example 06 in 10.glsl gem example folder.
>>>>
>>>> (a patch is better than any explanation...)
>>>
>>> this patch still uses one texture that comes directly from an image 
>>> (gemhead 17...). In my case I wanted to use both inputs from a 
>>> gemframebuffer.
>> that's not a problem.
>> just remove the part that load texture 2, and replace it by a copy of 
>> the part that use a glsl / framebuffer (changing texunit 3 to texunit 2).
>>
>> here is the result.
>> (shader are not relevant, but it work here)
>> moreover, this patch is more complex than what you need, as shader 
>> output is used for next frame as shader input to create a feedback 
>> loop, but it's easy to remove this.
>>
>> if you still have problem, i certainly have to create a 07 example...
>>
>> cyrille
>>
>>
>>> marius.
>>>
>>>
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> GEM-dev mailing list
> GEM-dev at iem.at
> http://lists.puredata.info/listinfo/gem-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2tex+gemframeR2.pd
Type: application/x-extension-pd
Size: 6486 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/gem-dev/attachments/20080330/6393aaab/attachment.bin>


More information about the GEM-dev mailing list