//do not delete the following comments! //none of your parameters can have the following names: //frames, canvas, groups, position, forward, right, pinhole, zoom, reset //pathtrace, epsilon, iterations, temp1, bounces, sunpos, floor, focallength //aperture, breakout //additionally, the following words cannot be used in code: //E, PI, seed, first, depth //put any uniforms here, in the format //name : type, //[input method] //valid input methods: [default value] or [default, min, max, step] //valid types: i32, f32, u32, vec[1,2,3,4] cutoff : f32, //[2.5, .1, 10., .01] steps : i32, //[4, 1, 10, 1] c : vec3, //[.5, 0, 2, .01] //Code: //Code from: https://www.shadertoy.com/view/4sGyRR //Recommended parameter values: //c - {.8, .7, 1.13} //steps - 6 fn DE(z : vec3) -> f32 { return max(fractal(z), length(z) - uniforms.cutoff); } fn fractal(z : vec3) -> f32 { var c = uniforms.c; var scale = 1.; var p = z; for (var i = 0; i < uniforms.steps; i = i + 1) { p = 2. * clamp(p, -c, c) - p; var r2 = dot(p, p); var k = max(1. / r2, .03); p = p * k; scale = scale * k; } var l = length(p.xy); var rxy = l - 3.; var n = l * p.z; rxy = max(rxy, -(n) / length(p) - .02); return (rxy) / abs(scale); } fn getColor(z : vec3) -> vec3 { return vec3(1.); }