Skip to content

Commit b148584

Browse files
committed
Prevent flashing when passing through the fractal without marble.
1 parent 2a3905b commit b148584

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

assets/frag.glsl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,12 @@ vec4 ray_march(inout vec4 p, vec4 ray, float sharpness) {
221221
//March the ray
222222
float d = DE(p);
223223
if (d < 0.0 && sharpness == 1.0) {
224-
vec3 v = iMarblePos.xyz - iMat[3].xyz;
224+
vec3 v;
225+
if (abs(iMarblePos.x) >= 999.0f) {
226+
v = (-20.0 * iMarbleRad) * iMat[2].xyz;
227+
} else {
228+
v = iMarblePos.xyz - iMat[3].xyz;
229+
}
225230
d = dot(v, v) / dot(v, ray.xyz) - iMarbleRad;
226231
}
227232
float s = 0.0;

0 commit comments

Comments
 (0)