Hi,
I'm working on a Fragment Shader which needs to access 2 different
Textures (texUnit0,texUnit1), but when I want to get the color with
texture2DRect( texUnit0, vec2(x,y));
or
texture2DRect( texUnit1, vec2(x,y));
I receive always the color of the first texture, although the two
images are different.
The material is defined as:
beginEditCP(material);
// the second parameter should be the Texture Unit
material->addChunk(texture[0], 0);
material->addChunk(texture[1], 1);
endEditCP(material);
The texture as:
beginEditCP(texture[i]); // were i is 0 and 1
texture[i]->setTarget(GL_TEXTURE_RECTANGLE_NV);
texture[i]->setImage(image[i]); // image[0] and image[1] are
different
texture[i]->setInternalFormat(GL_FLOAT_RGBA32_NV);
texture[i]->setMinFilter( GL_NEAREST ); // GL_LINEAR
texture[i]->setMinFilter( GL_NEAREST ); // GL_LINEAR
texture[i]->setScale(false);
endEditCP(texture[i]);
In the fragment shader the texture units are defined as:
uniform samplerRECT texUnit0;
uniform samplerRECT texUnit1;
and I access the textures values using:
texture2DRect( texUnit0, vec2(x,y));
texture2DRect( texUnit1, vec2(x,y));
Am I forgetting something?
Shouldn't this work?
Thanks in advance,
--
Josef Grunig
www.blending-life.org
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users