You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I learned that we need to use normal vector in view space to compute the illumination whereas you computed it in clip space. I think passing (Projection*ModelView).inverse_transpose may be wrong. Instead we should pass ModelView.inverse_transpose to compute the transformed normal vector?
In opengl(see ref), Normal Vector Transformation just transforms a normal vector from object space to eye space.
In my opinion, just MODELVIEW matrix affects the normal vector transformation, not including PROJECTION, VIEWPORT matrix. But in lesson6, it uses (Projection*ModelView).invert_transpose() to get normal transformation to calculate varying_nrm, but not use ModelView.invert_transpose().
I learned that we need to use normal vector in view space to compute the illumination whereas you computed it in clip space. I think passing
(Projection*ModelView).inverse_transpose
may be wrong. Instead we should passModelView.inverse_transpose
to compute the transformed normal vector?My opinion:
Shader shader(ModelView, (Projection*ModelView).invert_transpose(), M*(Viewport*Projection*ModelView).invert());
to
Shader shader(ModelView, (ModelView).invert_transpose(), M*(Viewport*Projection*ModelView).invert());
The text was updated successfully, but these errors were encountered: