From 2a6c4a5f1a824a9b393d32b23b4e31e71a2c0dc4 Mon Sep 17 00:00:00 2001 From: Sinan Date: Tue, 1 Aug 2023 04:27:15 +0200 Subject: [PATCH] Enable smooth triangle shading (custom per-vertex normals) (#2067) * Removed triangle normal recalculation to enable smooth triangle shading. * Updated comment --- .../net/coderbot/iris/mixin/vertices/MixinBufferBuilder.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/coderbot/iris/mixin/vertices/MixinBufferBuilder.java b/src/main/java/net/coderbot/iris/mixin/vertices/MixinBufferBuilder.java index ca0050e06d..550ada0f4c 100644 --- a/src/main/java/net/coderbot/iris/mixin/vertices/MixinBufferBuilder.java +++ b/src/main/java/net/coderbot/iris/mixin/vertices/MixinBufferBuilder.java @@ -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); }