From cc6fb4b55a2ebe7df37200fa93ae51599ca2f130 Mon Sep 17 00:00:00 2001 From: IntegratedQuantum Date: Thu, 28 Sep 2023 17:12:46 +0200 Subject: [PATCH] Improve performance by not calling the raycasting code when the model is a full cube. Only 0.5 ms, but better than nothing. --- assets/cubyz/shaders/chunks/chunk_fragment.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/cubyz/shaders/chunks/chunk_fragment.fs b/assets/cubyz/shaders/chunks/chunk_fragment.fs index 887ad54e..edf4484a 100644 --- a/assets/cubyz/shaders/chunks/chunk_fragment.fs +++ b/assets/cubyz/shaders/chunks/chunk_fragment.fs @@ -230,7 +230,7 @@ void main() { const float threshold = 1; const float interpolationRegion = 1.25; float interp = (variance - threshold)/threshold/(interpolationRegion - 1); - if(!passDitherTest(interp)) { + if(modelIndex != 0 && !passDitherTest(interp)) { result = rayMarching(startPosition, direction); } else { result = RayMarchResult(true, faceNormal, faceNormal, ivec3(startPosition)); // At some point it doesn't make sense to even draw the model.