Re: [info-performer] performer shading language

Date view Thread view Subject view Author view

From: Terry Welsh (mogumbo++at++gmail.com)
Date: 06/29/2005 06:45:07


Hmmm. I can't see any huge problem there. It looks like you might be
using the negative incident vector, though. Try adding this minus
sign to your vertex shader.

vViewVec = normalize(-worldPos.xyz);

-- 
Terry Welsh - mogumbo 'at' gmail.com
www.reallyslick.com  |  www.infiscape.com  |  www.vrsource.org

> From: Bambang Veriansyah <vaveri++at++yahoo.com> > Date: Tue, 28 Jun 2005 17:48:34 -0700 (PDT) > Subject: Re: [info-performer] performer shading language > > > Thanks Terry, > > I modified my fragment shader as your suggestion, > > Here is the my fragment shader: > > vec4 reflVec; > reflVec.xyz = reflect(vViewVec, vNormal); > reflVec = ViewMatrix_inverse * reflVec; > vec4 refl = textureCube(envMap, reflVec.xyz); > gl_FragColor = refl; > > > When I change the eye direction, the reflection is > correct.But if I change the eye position, the > reflection still not correct. > Do I miss something ? Should I send the eye position > to the shader? > > Thanks in advanced. > > > ================================================== > Terry Welsh wrote: > > It looks like you need to transform reflVec from view > space to world space before you use it to access your > cube map. To do this, you can pass the inverse view > matrix to your shader as a uniform and multiply > reflVec by it. In fact, you only really need the > upper-left 3x3 of that matrix, since translation > doesn't matter in this case. >


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed Jun 29 2005 - 06:45:08 PDT