From: Bambang Veriansyah (vaveri++at++yahoo.com)
Date: 06/27/2005 04:58:25
hi,
I try to make a program using GLSL in Performer.
My shader is used to generate a water reflection using
cube texture.
The problem is when I change the camera position in
the viewer using view->setEye(xyz, hpr), the
reflection does not change.
Here my vertex shader:
vNormal = normalize(gl_NormalMatrix * gl_Normal);
vec4 worldPos = gl_ModelViewMatrix * gl_Vertex;
vViewVec = normalize(worldPos.xyz);
gl_Position = gl_ModelViewProjectionMatrix *
gl_Vertex;
and this is my fragment shader:
vec3 reflVec = reflect(vViewVec, vNormal);
vec4 refl = textureCube(envMap, reflVec.xyz);
gl_FragColor = refl;
Is there anyone can help me?
Thanks in advanced
__________________________________
Yahoo! Mail Mobile
Take Yahoo! Mail with you! Check email on your mobile phone.
http://mobile.yahoo.com/learn/mail
This archive was generated by hypermail 2b29 : Mon Jun 27 2005 - 04:58:21 PDT