diff --git a/assets/cubyz/shaders/chunks/chunk_fragment.fs b/assets/cubyz/shaders/chunks/chunk_fragment.fs index a23b7cdc..2d797d13 100644 --- a/assets/cubyz/shaders/chunks/chunk_fragment.fs +++ b/assets/cubyz/shaders/chunks/chunk_fragment.fs @@ -227,7 +227,10 @@ bool passDitherTest(float alpha) { void main() { RayMarchResult result; float variance = perpendicularFwidth(direction); - if(variance <= 4.0) { + const float threshold = 1; + const float interpolationRegion = 1.25; + float interp = (variance - threshold)/threshold/(interpolationRegion - 1); + if(!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.