Skip to content

Commit

Permalink
Enable smooth triangle shading (custom per-vertex normals) (#2067)
Browse files Browse the repository at this point in the history
* Removed triangle normal recalculation to enable smooth triangle shading.

* Updated comment
  • Loading branch information
SinanAkkoyun authored Aug 1, 2023
1 parent df4d70c commit 2a6c4a5
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ private void fillExtendedData(int vertexAmount) {
midV /= vertexAmount;

if (vertexAmount == 3) {
NormalHelper.computeFaceNormalTri(normal, polygon);
// Removed to enable smooth shaded triangles. Mods rendering triangles with bad normals need to recalculate their normals manually or otherwise shading might be inconsistent.
// NormalHelper.computeFaceNormalTri(normal, polygon);
} else {
NormalHelper.computeFaceNormal(normal, polygon);
}
Expand Down

0 comments on commit 2a6c4a5

Please sign in to comment.