PDA

View Full Version : How to treat GLSL vertex shader in world-space?



TexFetch
12-17-2004, 01:59 AM
Hello,

I'm just thinking about treating vertex shader in world-space,
but I don't understand how to do it concretely.

The vertex shader in eye-space is:

vec4 VertexPos = gl_ModelViewMatrix * gl_Vertex;

LightVec = LightPos.xyz - VertexPos.xyz;
ViewVec = -VertexPos.xyz;
NormalVec = gl_NormalMatrix * gl_Normal;

gl_Position = ftransform();Would you tell me how to treat vertex shader in world-space, please?

Thanks.