Skip to content

Conversation

@Pierce-qiang
Copy link
Contributor

Dear Author,
I noticed that in your chapter 5 advanced_lighting ->
1.advanced_lighting && 2.gamma_correction && 3. shadow_mapping_depth
In your code, the floor data's normal is inverted, that is Clockwise, notice cross(x, z) = -y
When I cull the front face, the floor disappears. While moving the camera under the floor I can see it

@JoeyDeVries
Copy link
Owner

Hey! Default culling mode is back face culling. When you call the front face the floor is indeed expected to dissapear as the top part of the floor is its front face.

@Pierce-qiang
Copy link
Contributor Author

Oh! I'm sorry for saying wrong, I mean cull the back face!!!
You can see the vertex sequence to check it!
Or just cull the back face to test it.

@Pierce-qiang
Copy link
Contributor Author

Oh, I see. You invert normal to reserve floor's depth when using the method which culls the front face to solve Peter panning problem.
In this way, the floor will not be culled when acquiring a depth map.

@JoeyDeVries
Copy link
Owner

Ahh, forgot about that for the shadow mapping; indeed, not necessary for gamma correction and advanced lighting. You can commit these separately if you want, but I won't commit the changes for shadow mapping tutorials.

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

Successfully merging this pull request may close these issues.

2 participants