[GEM-dev] 2textures + gemframebuffer

cyrille henry cyrille.henry at la-kitchen.fr
Sun Mar 30 18:31:39 CEST 2008



marius schebella a écrit :
> hi,
> when I add the vertex shader it works.
cool

> and you are also right, that I could put the gemframebuffer anywhere.
> the real difference was that to get gemframebuffer working correctly I 
> had to use Sampler2DRect.
> 
> there remains one more problem:
> 
> [gemhead]
>   |
> [shader..]  [from_another_frambuffer]
>   |          /
> [pix_texture]
> 
> that does not work, because pix_texture does not read the dimensions 
> correctly. if I connect a pix_info to pix_texture I always get -1 -1 for 
> width and height. I would expect that the width and height are passed 
> from the other framebuffer. I think this is a bug. maybe the same one 
> why I can't use gl_MultiTexCoord>0.

a workaround is to use a dummy image : 

[gemhead]
  |
[shader..]  
  |       
[pix_image] [from_another_frambuffer]
  |          /
[pix_texture]

you'll then use the texture coordinate of the image you load, but this image is replaced by the the one from the framebuffer.

cyrille

> marius.
> 
> cyrille henry wrote:
>> hello,
>>
>>
>> marius schebella a écrit :
>>> Hi Cyrille,
>>> the patch was a part of a bigger project, so I still had vertex shader 
>>> and separator in it. Later I want to trigger the first texture (now 
>>> using a separate gemhead 10) and the gemchein with the shader from the 
>>> same gemhead (t a a a) to make sure it is rendered before, and then I 
>>> need the separator (although I also could use separate gemheads and 
>>> send bang).
>> ok.
>>> the problem is, that the shader now does not load on my machine.
>>>
>>> [glsl_fragment]: m_shader: 0    35632
>>> [glsl_program]: Info_log:
>>> [glsl_program]: ERROR: fragment shader reads varying 'texcoord0' which 
>>> is not written.
>>> ERROR: fragment shader reads varying 'texcoord1' which is not written.
>> this is a strange error :  could you try to add again the vertex shader?
>>
>>> [glsl_program]: Link failed!
>>> [glsl_program]: vertex shader running in hardware
>>> [glsl_program]: fragment shader running in hardware
>>>
>>> but, from your patch I see that you are using gemframebuffer behind 
>>> the pix_texture. gemframebuffer always surprises me! I think that 
>>> might be the solution.
>> hum, i don't think so.
>> i usually put gemframebuffer before the primitive i want to draw in the 
>> framebuffer, but it should also work where you put it.
>>
>>
>> cyrille
>>
>>
>>> thanks for looking into this.
>>> marius.
>>>
>>>
>>> cyrille henry wrote:
>>>> hello,
>>>>
>>>> i change few things in your patch : remove the glsl_vertex (as only 
>>>> the fragment was used),
>>>> remove the separator (did not understand why it was there)
>>>> clean initaliation
>>>>
>>>> none of this change made a diference.
>>>> so i finally switch to rectangulare texturing mode, and then 
>>>> everything work as expected.
>>>>
>>>> here is the corrected patch.
>>>>
>>>> cyrille
>>>>
>>>>
>>>> marius schebella a écrit :
>>>>> hi,
>>>>> I can't get gemframebuffer working with 2 shaders. see my files here:
>>>>> http://www.parasitaere-kapazitaeten.net/files/2tex+gemframe.zip
>>>>> I would like to take the output of a shader with 2 textures and use 
>>>>> it in another pix_texture. but I don't find the right way to do this...
>>>>> anybody with help?
>>>>> thanks over'n out (no more mail today)
>>>>> marius.
>>>>>
>>>>> _______________________________________________
>>>>> GEM-dev mailing list
>>>>> GEM-dev at iem.at
>>>>> http://lists.puredata.info/listinfo/gem-dev
>>>>>
>>>>>
>>>
>>> _______________________________________________
>>> GEM-dev mailing list
>>> GEM-dev at iem.at
>>> http://lists.puredata.info/listinfo/gem-dev
>>>
>>>
> 
> 
> _______________________________________________
> GEM-dev mailing list
> GEM-dev at iem.at
> http://lists.puredata.info/listinfo/gem-dev
> 
> 




More information about the GEM-dev mailing list