Title: Raymarching misses fractal? Post by: fractalnoob on June 08, 2013, 10:47:14 AM Hi
I hope this is the right place to ask. I'd like to reproduce the fractal from this blog post: http://blog.hvidtfeldts.net/index.php/2011/08/distance-estimated-3d-fractals-iii-folding-space/comment-page-1/#comment-20302 section "A Real Fractal". The post uses Raymarchiing and a distance function. The problem is, that my ray misses the fractal. I don't know what sensible values for "Iteration" and "scale" to set and I guess, that may ray construction is also a little bit off... Here is my code: Constants: Code: const float Iterations = 4; Fractal DE: Code: float distanceFromPoint(vec3 z) {Construction of rays Code: vec2 q = gl_FragCoord.xy / u_ws.xy; I hope someone can give me a hint. Title: Re: Raymarching misses fractal? Post by: AndyAlias on June 21, 2013, 06:35:43 AM I found that scale 2.0 produces the Sierpinski Pyramid. Also, length(z) on the last line of the distance function is the distance to a point in space. Unless you have a very high iteration count you wont see anything as most rays wont get close enough to any points. Use (length(z)-radius) to get the distance to a sphere instead (radius 1.5 seems to be about optimal for this one). |