PDA

View Full Version : GLSL RenderTexture



rcpedersen
04-17-2005, 10:41 AM
Hi I am trying to use Mark Harris RenderTexture class to perform some multi pass volume rendering.

I have to perform at least 3 passes and I will have to store each pass in a render-texture.

How do I send a RenderTexture down to a GLSL fragment shader, so that I can perform an operation as:


gl_FragColor = gl_Color - texture2D(rayintersection,gl_TexCoord[0].st);I have without success tried to use the following:


glUseProgramObjectARB(*direction);
// results for previous pass, stored in a RenderTexture
g_prtRayIntersection->EnableTextureTarget();
g_prtRayIntersection->Bind();
glUniform1iARB(sampler, 0);

guyinhell
04-17-2005, 10:24 PM
might it be that you didn't share display list shader programs and texture unit?

rcpedersen
04-17-2005, 11:43 PM
No, the RenderTexture class shares by default,
lists, textures, and program objects.

rcpedersen
05-04-2005, 02:33 AM
I have found the error ;-)