Title: Infinite staircase DE Post by: DarkBeam on February 05, 2015, 06:35:41 PM ;D Yeah this is totally crazy but fun result, a helicoidal staircase that goes on infinitely :alien:
Code: // valid for thickness << abs hstep, and hstep must be < 0 Shown here together with his best friend, the infinite checkerboard :D (http://i.imgur.com/M6qLpfJ.jpg) Oh my ;) Title: Re: Infinite staircase DE Post by: knighty on February 05, 2015, 07:52:34 PM Niiice!
:thumbsup1: Title: Re: Infinite staircase DE Post by: eiffie on February 05, 2015, 10:44:06 PM Nice formula and render!
Title: Re: Infinite staircase DE Post by: DarkBeam on February 06, 2015, 12:41:37 AM Oh I am very honored, masters of raytracing :embarrass:
Thanks a lot! Just hoping I transcribed correctly, 2 days of fight to finally reveal it :) Title: Re: Infinite staircase DE Post by: cKleinhuis on February 06, 2015, 12:51:54 AM nice, tststs no shadertoy implementation? and beside, how does this de behave when hybridised with another de ? :D hehe
Title: Re: Infinite staircase DE Post by: DarkBeam on February 07, 2015, 10:55:58 AM Forgot to tell ...
1. Formula is approximated! If thickness is big, some cuts will be shown, the trouble will be evident for big N values probably. 2. Hstep must be < 0 :) Title: Re: Infinite staircase DE Post by: subblue on February 17, 2015, 09:24:14 PM Very interesting!
Can you explain some of the terms of the algorithm, for instance how are split(.., .., ..), intpu, fracpu, intpz, fracpz defined? Title: Re: Infinite staircase DE Post by: DarkBeam on February 17, 2015, 10:02:55 PM Split should ... split a number into its int and fractional part:
Split(5.844,a,b) -> a=5 and b=0.844 :) Please try to implement. I don't know if I copied right... Title: Re: Infinite staircase DE Post by: TruthSerum on May 23, 2015, 10:17:07 PM Here it is in GLSL:
Code: void split(float x, inout float a, inout float b) {Here is how I tried (and failed) to trace it: Code: float trace(vec3 o, vec3 r) {Very blocky results: (http://i.imgur.com/7avsZTj.png) Title: Re: Infinite staircase DE Post by: DarkBeam on May 24, 2015, 11:15:31 AM Thinking... :D
Instead of floor and frac what if you use Void split(float x, inout float a, inout float b) { a = round(x); b = x-a; } Try also thickness 0.1 position 2.0 :) Formula isn't perfect for all combinations but should work normally. Thanks for trying Title: Re: Infinite staircase DE Post by: TruthSerum on May 24, 2015, 01:47:26 PM I tried it with these parameter changes, but I could not improve the result :-\
FYI GLSL has only floor/fract, but not round. I implemented: Code: float round(float x) {Title: Re: Infinite staircase DE Post by: DarkBeam on May 25, 2015, 12:08:56 AM Too bad I cannot help further at this time. I am sorry. :sad1:
Title: Re: Infinite staircase DE Post by: visual.bermarte on May 26, 2015, 05:37:38 PM Not perfect but not bad neither :)
(http://orig13.deviantart.net/e727/f/2015/146/7/e/staircase_by_bermarte-d8utgue.jpg) Title: Re: Infinite staircase DE Post by: TruthSerum on May 26, 2015, 05:58:22 PM Now to compute normals :)
Title: Re: Infinite staircase DE Post by: DarkBeam on May 27, 2015, 12:31:28 PM The problem is I don't remember exactly all the details now and assembly uses some different funcs. So try to disassemble the m3f ;)
The mb3d function has perfect normals and all actually. (see 1st post) Title: Re: Infinite staircase DE Post by: visual.bermarte on June 01, 2015, 03:00:09 AM It goes a little bit better using Code: a=sign(x)*floor(abs(x)+0.5); |