Improve performance by not calling the raycasting code when the model is a full cube.

Only 0.5 ms, but better than nothing.
This commit is contained in:
IntegratedQuantum 2023-09-28 17:12:46 +02:00
parent 54337f17fd
commit cc6fb4b55a

View File

@ -230,7 +230,7 @@ void main() {
const float threshold = 1; const float threshold = 1;
const float interpolationRegion = 1.25; const float interpolationRegion = 1.25;
float interp = (variance - threshold)/threshold/(interpolationRegion - 1); float interp = (variance - threshold)/threshold/(interpolationRegion - 1);
if(!passDitherTest(interp)) { if(modelIndex != 0 && !passDitherTest(interp)) {
result = rayMarching(startPosition, direction); result = rayMarching(startPosition, direction);
} else { } else {
result = RayMarchResult(true, faceNormal, faceNormal, ivec3(startPosition)); // At some point it doesn't make sense to even draw the model. result = RayMarchResult(true, faceNormal, faceNormal, ivec3(startPosition)); // At some point it doesn't make sense to even draw the model.