Triangles affecting each other's fragment shading #3281
mikael-wants-to-visit-disneyland
started this conversation in
General
Replies: 1 comment
-
I found out that the issue was my assumption that the normals are those of the triangles. They are in fact supposed to be the normals of the vertices. There is thus unfortunately no option but to duplicate the vertices for each triangle, in order to get the hard edges. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to get a cube rendered:
Lets take two of the triangles as an example:
Fragment shader:
I have positioned the camera and light such that when I get the triangles rendered individually, one is very bright, the other is in shadow. However, when they are rendered together, for some reason their brightnesses change, and there is a gradient in them. What is going on? Any ideas for solving this?
Beta Was this translation helpful? Give feedback.
All reactions