this is not really a OpenSG question,
but maybe someone can help me anyway.
I have made 2 simple program, a vp and a fp.
they should grab the scene, convert em in eye coord
and then paint everything red.
As long for the red thing, they are working, so i
assume they are correctly loaded. Now i wanted to tex map
the scene, so i made some facility to pass texture coords
form vp to fp, but surprise surprise, it is not working...
here are my programs:
//VP
uniform vec4 Camera;
varying vec3 PixColor;
varying vec3 TexCoord;
varying vec4 Eye;
void main (void)
{
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
Eye = glPosition - Camera;
//TexCoord = vec3 (gl_Normal);
TexCoord = vec3 (1.0,0.0,0.0);
}
note that i set *constant* tex coord, just for debug reasons.
//FP
uniform samplerCube map;
varying vec3 PixColor;
varying vec3 TexCoord;
varying vec4 Eye;
void main(void)
{
// vec4 pixcolor = textureCube (map, TexCoord);
//gl_FragColor = vec4 (pixcolor);
// just to check output
// gl_FragColor = vec4 (1,0,0,1);
gl_FragColor = vec4 (TexCoord, 1.0);
}
this FP should set all fragments to the color held into TexCoord (which
is red). It isn't very nice, but again it is for debug purposes...
Whenever i use TexCoord variable, the program fails and std OpenGL
pipeline is restored. What i am mistaking in the variables passing from
a program to the other? I set up correctly TexCoord in the vp to 1,0,0,
but then probably i lose it somewhere in the execution...
any clues?
thx enrico
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
digital self defense, top technical experts, no vendor pitches,
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users