Crist-JRoger
|
|
« on: October 30, 2015, 09:47:55 PM » |
|
I just played with mandelbulb.frag and decide to post frag file. It is very similar to the gnarl 3d but it is not really gnarl I added z.x=abs(z.y) in DE(vec3 pos). The idea is not mine, i found the same change on DA - originally it was z.x=cos(z.x). It can be changed to z=abs(z.y). Maybe somebody will be interested and will make "really" 3D gnarl.
|
|
|
Logged
|
|
|
|
LMarkoya
Strange Attractor
Posts: 282
|
|
« Reply #1 on: October 30, 2015, 11:33:21 PM » |
|
Nice, I like it!...and nice render
|
|
|
Logged
|
|
|
|
DarkBeam
Global Moderator
Fractal Senior
Posts: 2512
Fragments of the fractal -like the tip of it
|
|
« Reply #2 on: October 30, 2015, 11:43:37 PM » |
|
Totally different from gnarl but nice
|
|
|
Logged
|
No sweat, guardian of wisdom!
|
|
|
Crist-JRoger
|
|
« Reply #3 on: October 31, 2015, 09:01:36 AM » |
|
LMarkoya, thank you! DarkBeam i know that gnarl is spiral, so it just looks similar to the gnarl. Maybe exist formula for real gnarl in fragmentarium
|
|
|
Logged
|
|
|
|
DarkBeam
Global Moderator
Fractal Senior
Posts: 2512
Fragments of the fractal -like the tip of it
|
|
« Reply #4 on: October 31, 2015, 10:57:03 AM » |
|
of course is possible as heightfield You simply calculate the formula for x and y, you extract the magnitude then for the DE add to z that mag - edventually corrected with some log() Example magold = x*x + y*y; For (i=0; i<16; i++) { Xn = x - 0.1 sin(y + 5 sin (2y-0.2*x)); yn = ...; // pick whatever you like with sin cos etc add more sines do it yourself X= xn; Y= yn; } Mag = Magold - x*x - y*y; Mag = log( 1.5+ mag); // smooth Return z-Mag;
|
|
« Last Edit: October 31, 2015, 11:06:16 AM by DarkBeam »
|
Logged
|
No sweat, guardian of wisdom!
|
|
|
Patryk Kizny
|
|
« Reply #5 on: October 31, 2015, 01:14:43 PM » |
|
That's cool! What raytracer did you use for it?
|
|
|
Logged
|
Visual Artist, Director & Cinematographer specialized in emerging imaging techniques.
|
|
|
Crist-JRoger
|
|
« Reply #6 on: October 31, 2015, 05:15:51 PM » |
|
DarkBeam, i'm really not sure what to do with your formulas in fragmentarium I do not know glsl or other programming language So i write that float Mag(vec3 pos) { vec3 z=pos; int i=0; float magold = z.x*z.x + z.y*z.y; for (i=0; i<16; i++) { float xn = z.x - 0.1* sin(z.y + 5*sin(2*z.y-0.2*z.x)); float yn = z.y - 0.1* sin(z.x + 5*sin(2*z.x-0.2*z.y)); z.x= xn; z.y= yn; } float mag = magold - z.x*z.x - z.y*z.y; mag = log(1.5+ mag); // smooth return z-mag; } How add Mag to DE? Patryk Kizny, it was long time ago, used first mod by knighty with "3DKn-1.0.0.frag"
|
|
|
Logged
|
|
|
|
DarkBeam
Global Moderator
Fractal Senior
Posts: 2512
Fragments of the fractal -like the tip of it
|
|
« Reply #7 on: October 31, 2015, 10:57:12 PM » |
|
Mag should already be a DE. Try to see what comes ...
|
|
|
Logged
|
No sweat, guardian of wisdom!
|
|
|
Crist-JRoger
|
|
« Reply #8 on: November 01, 2015, 12:31:09 AM » |
|
I tried to do as you say before asking you. So i got very very smooth mandelbulb like glued balls. Something wrong. Maybe i wrote something incorrectly. How add mag to z? DE in mandelbulb already has a return. And as i understand, return z-mag must be replaced with something.
|
|
|
Logged
|
|
|
|
DarkBeam
Global Moderator
Fractal Senior
Posts: 2512
Fragments of the fractal -like the tip of it
|
|
« Reply #9 on: November 01, 2015, 10:07:06 AM » |
|
Probably I did a mess try again this You should get a plane ... but extruded float Mag(vec3 pos) { vec3 z=pos; int i=0; float Xold = z.x; float Yold = z.y; float xn = 0.0; float yn = 0.0; for (i=0; i<16; i++) { xn = z.x - 0.1* sin(z.y + 5*sin(2*z.y-0.2*z.x)); yn = z.y - 0.1* sin(z.x + 5*sin(2*z.x-0.2*z.y)); z.x= xn; z.y= yn; } xn = Xold-z.x; yn = Yold-z.y; float mag = 1.5 + xn*xn+ yn*yn; mag = log(mag); //smooth return z.z-mag; }
|
|
« Last Edit: November 01, 2015, 10:21:38 AM by DarkBeam »
|
Logged
|
No sweat, guardian of wisdom!
|
|
|
Crist-JRoger
|
|
« Reply #10 on: November 01, 2015, 11:48:46 AM » |
|
I am sorry, i don`t know what to do with this code... What means You should get a plane ... but extruded
?
|
|
|
Logged
|
|
|
|
DarkBeam
Global Moderator
Fractal Senior
Posts: 2512
Fragments of the fractal -like the tip of it
|
|
« Reply #11 on: November 01, 2015, 05:56:36 PM » |
|
The resulting DE (of Mag() ) should be an horizontal plane (like the water you use often) Cannot help further... I wrote the script for you so you can use it. You can also display it in a mandelbulb surface. Do few iters then do return Mag(z)... If it does not work ask further Luca
|
|
|
Logged
|
No sweat, guardian of wisdom!
|
|
|
Crist-JRoger
|
|
« Reply #12 on: November 01, 2015, 09:03:32 PM » |
|
Okay, i get result... if i may say... It looks terrible FudgeFactor less than 0,01 for decrease noise upd.: Okay. With pseudo-kleinian it looks much better! Thank you for gnarl in Frag!
|
|
« Last Edit: November 01, 2015, 09:39:04 PM by Crist-JRoger »
|
Logged
|
|
|
|
DarkBeam
Global Moderator
Fractal Senior
Posts: 2512
Fragments of the fractal -like the tip of it
|
|
« Reply #13 on: November 01, 2015, 11:21:44 PM » |
|
No problem. The formula is just an example not really the correct one! But use it as a base ... change the numbers ... the functions... everything. Because you will surely find a better one I just made it by memory... The formula itself is like that... xn = z.x +- (small number)* sin( put some function of y here... use nested sines... add a grain of x ... etc) Interesting variants with cos instead of sin. Fantasy has no limits in gnarly!
|
|
|
Logged
|
No sweat, guardian of wisdom!
|
|
|
Crist-JRoger
|
|
« Reply #14 on: November 02, 2015, 08:26:26 PM » |
|
Spend some time played with gnarl on a simple surface. To understand how it works. And i find that geometry of spirals is perfect and may be changed by different variables. So, all that related to 3D - is bad especially when increases height, when 3d small it looks not so bad. - need very low fudge factor(0.2-0.01). It follows that we need a lot of maxraysteps (2000-4000), or reduce detail, or both. - shadows are noisy with crazy banding ever when dithering=1. Normal view when detail=2-2.5, so it`s too much. Maybe you can tell how optimize code... Interesting result when return z.z-abs(mag); A few renders. I attached frag with some presets and my version of renderer.
|
|
|
Logged
|
|
|
|
|