Skip to content

In Lesson 6, matrix used to transform normal vector in Darboux frame may be wrong. #155

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Exisfar opened this issue Mar 17, 2025 · 1 comment

Comments

@Exisfar
Copy link

Exisfar commented Mar 17, 2025

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?

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());
@fortunely
Copy link

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().

Do you have any idea? I don't know why.

ref:
OpenGL Normal Vector Transformation

@github-staff github-staff deleted a comment from Exisfar Apr 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@fortunely @Exisfar and others