PDA

View Full Version : Cube map in fragment program



SeskaPeel
08-22-2003, 07:24 AM
Having trouble with a fragment program (GL_ARB_fragment_program) :

I want to get the color of a cube map texel, but it outputs full black. Code is : TEX result.color, inTexCoord0, texture[0], 3D ;

I pass through a vertex program that does : MOV outTexCoord0, inNormal ;

and if I remove the fragment program and pass classic gl commands it works :
glBindTexture (GL_TEXTURE_CUBE_MAP_EXT, ID) ;
glEnable(GL_TEXTURE_CUBE_MAP_EXT) ; glMatrixMode(GL_TEXTURE) ;
glLoadIdentity() ;

Actually the fragment shader outputs not black but {0.0, 0.0, 0.0, 0.0}. So to see something, I added 1.0 to the w value.

Did I missed something ?

SeskaPeel.

Mazy
08-22-2003, 08:44 AM
you shouldnt use 3D, use CUBE instead..

SeskaPeel
08-22-2003, 09:03 AM
YES, thanks !