mirror of
https://github.com/PixelGuys/Cubyz.git
synced 2025-09-12 05:53:51 -04:00
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:
parent
54337f17fd
commit
cc6fb4b55a
@ -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.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user