Skip to content

backface culling does not work like that #64

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
paroj opened this issue Jan 25, 2021 · 0 comments
Open

backface culling does not work like that #64

paroj opened this issue Jan 25, 2021 · 0 comments
Assignees

Comments

@paroj
Copy link
Contributor

paroj commented Jan 25, 2021

https://github.com/ssloy/tinyrenderer/wiki/Lesson-2-Triangle-rasterization-and-back-face-culling#flat-shading-render

Here, you cull faces based on n*light_dir. But what if the light is behind the object and the background is white?
That criterion is not sufficient to call the triangle.

Indeed, in OpenGL the culling is not based on the normal, but rather on the vertex winding (cross product in 2D).
This way culling also works without lights and normals.

Also the culling code did not make it into the current master.

@ssloy ssloy self-assigned this Feb 21, 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

2 participants