Title: reflective menger Post by: marius on June 11, 2011, 05:35:43 AM Since reflections are the new hotness, I played with adding 1 level to a simple glsl shader. ;D
Title: Re: reflective menger Post by: marius on June 13, 2011, 07:42:08 AM Since reflections are the new hotness, I played with adding 1 level to a simple glsl shader. ;D Watch on youtube.com for proper 3d playback options! Improved the shader a bit and added a loop. Showing the reflections nicely now. Watch on youtube for proper playback! http://www.youtube.com/watch?v=V56CTViaOgQ Title: Re: reflective menger Post by: knighty on June 13, 2011, 09:19:32 PM :thumbsup1:
I have done some expriments with reflection too. here is the script ;D. Title: Re: reflective menger Post by: marius on June 13, 2011, 09:46:12 PM I have done some expriments with reflection too. here is the script ;D. Ah, very cool! Indeed, was playing with your other pkleinian scripts as well w/ adding a simple reflection pass. I'll post an animation soon, that Theli-at fractal lends itself very well for reflections with all the balls and surfaces. Is it OK if i tweak your script for boxplorer2 and add it to code.google.com/p/boxplorer2 set of configs ? Title: Re: reflective menger Post by: marius on June 14, 2011, 10:13:26 AM I have done some expriments with reflection too. here is the script ;D. Ah, very cool! Indeed, was playing with your other pkleinian scripts as well w/ adding a simple reflection pass. I'll post an animation soon, that Theli-at fractal lends itself very well for reflections with all the balls and surfaces. Is it OK if i tweak your script for boxplorer2 and add it to code.google.com/p/boxplorer2 set of configs ? http://www.youtube.com/watch?v=I0ilmEcsj8c Title: Re: reflective menger Post by: knighty on June 14, 2011, 08:20:36 PM Wow! looks much better than on my 400x300 window, taking into account that youtoube degrades video's quality.
Is it OK if i tweak your script for boxplorer2 and add it to code.google.com/p/boxplorer2 set of configs ? Yes :ok: . (Reminding me that I haven't asked Rrrola for permission :evil1:. The script is based on his original mandelbox shader implementation :angel1:. Hope he's not upset about that. :-\)Title: Re: reflective menger Post by: visual.bermarte on June 14, 2011, 08:33:53 PM I quite like them both! O0
I think would be nice to have 20+ params for boxplorer2 :) Title: Re: reflective menger Post by: marius on June 14, 2011, 08:39:58 PM Wow! looks much better than on my 400x300 window, taking into account that youtoube degrades video's quality. Is it OK if i tweak your script for boxplorer2 and add it to code.google.com/p/boxplorer2 set of configs ? Yes :ok: . (Reminding me that I haven't asked Rrrola for permission :evil1:. The script is based on his original mandelbox shader implementation :angel1:. Hope he's not upset about that. :-\)I know, been a while since we heard from Rrrola :hmh: He did put boxplorer out there w/ a pretty open license for all to enjoy and tweak: http://code.google.com/p/boxplorer/source/browse/trunk/LICENSE IANAL, but appears to me we're in spirit of that. btw, love the coloring in your shader. Been iterating and struggling to get something as nice with the pkleinians. I'll tinker around some more with them, the pkleinian-menger w/ reflections should be nice. I really should unify the common code out of the shaders.. I have some questions about the tracing code in your shader; min_dist cannot be (say 1e-5) small w/o affecting the reflections badly. Hard to crank up the detail that way :hmh: It would be nice to have some screen resolution adaptive level of detail (min_dist morph?). Played a bit with that in some shaders w/ boxplorer2 but no panacea. Can you enlighten me on the ULP logic in your marche() function? Title: Re: reflective menger Post by: knighty on June 14, 2011, 11:10:09 PM I know, been a while since we heard from Rrrola :hmh: I think I should add that licence to my boxplorer shaders (just in case they burn someone's graphics card ;D). Thanks for the link.He did put boxplorer out there w/ a pretty open license for all to enjoy and tweak: http://code.google.com/p/boxplorer/source/browse/trunk/LICENSE IANAL, but appears to me we're in spirit of that. btw, love the coloring in your shader. Been iterating and struggling to get something as nice with the pkleinians. I'll tinker around some more with them, the pkleinian-menger w/ reflections should be nice. I really should unify the common code out of the shaders.. Glad you like it. it's also possible to color by integer iteration number used with a variant that cheks when the iterated point becomes invariant. The later gives each level of spheres a different color. I have some questions about the tracing code in your shader; min_dist cannot be (say 1e-5) small w/o affecting the reflections badly. Hard to crank up the detail that way :hmh: Well, that tracing code is still experimental (maybe forever :)).It would be nice to have some screen resolution adaptive level of detail (min_dist morph?). Played a bit with that in some shaders w/ boxplorer2 but no panacea. Can you enlighten me on the ULP logic in your marche() function? Indeed, it is written in order to have a resolution dependent rendering. The rendered surface is actually at some distance from the fractal. That distance depends linearly (using min_dist) on the distance from the eye. min_dist should be function of the resolution and the FOV. Something like this: Code: sqrt(2)*tan(0.5/180*pi*fov)/xres; I left the pixel "size" (min_dist) as parameter because this information should be given by the main program as uniform. One have also to take into account the raystep multiplier. I found that a value of around 1e-3 - 5e-4 gives good results(for a 800x600 resolution, at 1600x1200 it should be 5e-4 - 2.5e-4). a value of 1e-5 seem to be too small. I'll try to see if reflection artifacts can be reduced. My first gess is that the normals need to be more precise (needs more bits). EDIT: the banding comes from the abs() used in d_PZshape() function... You can remove it but this will give different shapes when par[9].y is around 1.0. If I remember well, the ULP is the smallest positive floating point number e such that: (1+e)-1!=0. It's just a hint about the maximum detail attainable. The way it is used in the shader is not exact. I assumed that the evaluated point is at a distance around 1.0 from the origin. There are two numbers that should in fact be parameters (BTW, I second visual's suggestion :)): 8192.0 * ULP -> precision at the surface. this is the epsilon used to stop raymarching. The bigger, the faster. Smaller values give more accurate renderings. 256.0 * ULP -> This is the minimal precision for normal vectors. Title: Re: reflective menger Post by: marius on June 14, 2011, 11:58:18 PM I quite like them both! O0 I think would be nice to have 20+ params for boxplorer2 :) Ask and thou shall receive. http://code.google.com/p/boxplorer2/source/detail?r=63 Turns out you can send more elements than array in glsl has declared, so backward compatible with older glsl files. Haven't decided how to control fields [10-19] with keyboard but at least you can use them for vectors and colors etc. via AntTweakBar #defines. Perhaps using left & right arrow to step through all par[].xyz and up & down to change value? And pick up descriptive names from #define in glsl? Title: Re: reflective menger Post by: marius on June 20, 2011, 02:00:23 AM Since reflections are the new hotness, I played with adding 1 level to a simple glsl shader. ;D Watch on youtube.com for proper 3d playback options! Improved the shader a bit and added a loop. Showing the reflections nicely now. Watch on youtube for proper playback! Spent more time on the raymarching parts. And added support for a background image. Re-rendered the menger sequence and then some. Pretty cool how the menger has a single boring color but the background bleeds in due to all the reflections. Rays are bounced up to 4 times here. Watch on youtube.com for proper 3d playback options! http://www.youtube.com/watch?v=z3oguDRThpE |