Skip to content

Cube not illuminated by a light source #1252

Answered by robertosfield
Daoudou asked this question in Q&A
Discussion options

You must be logged in to vote

You can't light a cube with a single normal, it'll just light from single direction.

You'll need to use per vertex normals, and duplication the vertices for each face to enable you to set up the normals. This is a bit awkward but it's down to the way that modern (last 20 years :-) now manage vertex shaders, even GL fixed function pipeline maps to this.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by robertosfield
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants