GLSL and multitexturing
Rhadamés Carmona <[email protected]>
| Newsgroups | gmane.games.devel.opengl |
|---|---|
| Organization | Fat City Network Services, San Diego, California |
| Message-ID | <[email protected]> |
I am getting serious problems with multitexturing under GLSL. By example, in
this test (I commented most of the instructions) I cannot sample the 2nd and
3rd texture properly. The "equivalent" code works in CG.
I am using all front-end supposed stuff I have to know:
glGetUniformLocationARB, glUniform1iARB ...
Only the first texture can be sampled properly. I installed nvidia drivers
71.89, and I am testing over fx5200. I am using glew from this zip file
glew-1.3.3-win32.zip. I am developping under glut.
I found some guys with a kind of same problem in another forum. I would want
to know what's going on.
http://www.cgshaders.org/forums/viewtopic.php?p=13527&sid=72be21d52b43f0f5f7f7224e2953dc94#13527
If you know any solution, please, let me know it.
Rix
//vertex shader
void main()
{
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
gl_TexCoord[1] = gl_TextureMatrix[0] * gl_MultiTexCoord1;
gl_TexCoord[2] = gl_MultiTexCoord2;
gl_Position = ftransform();
}
// fragment shader
uniform sampler3D A;
uniform sampler2D B;
uniform sampler2D C;
void main (void)
{
gl_FragColor = texture2D(C, gl_TexCoord[2]);
// it sux... I think, it samples the "last 2D texture binded" in texture
unit0, even with GL_TEXTURE_2D disable in unit0...Oh my GOD!!!
}
-----
FAQ and OpenGL Resources at:
http://www.geocities.com/SiliconValley/Hills/9956/OpenGL
--
Author: =?iso-8859-1?Q?Rhadam=E9s_Carmona?=
INET: [email protected]
Fat City Hosting, San Diego, California -- http://www.fatcity.com
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [email protected] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB OPENGL-GAMEDEV-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).