• April 14, 2021, 04:33:02 PM

Author Topic:  Revisiting the 3D Newton  (Read 4267 times)

0 Members and 1 Guest are viewing this topic.

gforce

• Fractal Friend
• Posts: 11
Re: Revisiting the 3D Newton
« Reply #15 on: July 25, 2018, 03:31:06 AM »
I have tried another 4D variant (using a 2x2 matrix of real numbers), but the result was too weird.

I would be interested in this variation, I'd be even more interested in that variant with the all the bells and whistles you've added to JIT_gnj_RealPowNewton_04. It might not look good with simple transformations like rotation but i think it will have potential for hybrid formulas

FractalDave

• Posts: 183
Re: Revisiting the 3D Newton
« Reply #16 on: August 09, 2018, 01:03:16 PM »
To produce something really generic one could simply allow the user to define f(h) and g(h) (for 3D h=a+bi+cj) where the "Newton" is performed as:
Code: [Select]
init:
h = 0 or value from coord for julia
oldh = 0
a = value from coord for mandy or constant for julia
loop:
oldh = h
h = (f(h) - a) / (g(h) + user const)
Obviously for proper Newtons g(h) should be the derivative of f(h), in particular it should be 1 degree less - but then again why stick to either ?
In this case allowing the option of either divergent or convergent bailout or indeed both might be useful.
The meaning and purpose of life is to give life purpose and meaning.

Sabine62

• 3f
• Posts: 1179
Re: Revisiting the 3D Newton
« Reply #17 on: August 13, 2018, 09:26:01 AM »
Have tried to port this to Fragmentarium. Has been so long that I have done anything with fractals and still completely lacking any understanding of math, I am so happy that the thing shows anything at all. Have stolen the DE from Mandelbulb, and no optimization at all as will have to read up on that AGAIN after all this time  Neither have any idea what should go into the loop and what not etc etc, it's all just throwing gannjondals newton blindly at fragm, but here it is for your enjoyment (or dispair  )Julia does blow up the whole thing, but added rotations which give really nice results. Also quite some fuzz, so lots  and lots of room for improvement. Oh well...Hope I get some more time to look at it.

Complete .frag in zip below
« Last Edit: August 25, 2018, 04:12:27 PM by Sabine62 »
To thine own self be true

mclarekin

• 3c
• Posts: 846
Re: Revisiting the 3D Newton
« Reply #18 on: August 13, 2018, 09:59:15 AM »
looks good.

Thanks for the frag. As usual I have learnt a new thing or two about coding and formulas from looking at it O0

Sabine62

• 3f
• Posts: 1179
Re: Revisiting the 3D Newton
« Reply #19 on: August 13, 2018, 10:19:39 AM »
Thanks, mclarekin, does look newtonesque, doesn't it Did some minor optimization and updated the frag. Not sure if it will make a big difference though speedwise.

gforce

• Fractal Friend
• Posts: 11
Re: Revisiting the 3D Newton
« Reply #20 on: August 23, 2018, 05:47:10 AM »
A little tip for making hybrids with the amazing box with these formulae, set first iteration to the number of iterations of the amazing box.(generally even 3 seems to work) (otherwise it tends to be solid renders I'm an idiot just read the description better.
« Last Edit: August 23, 2018, 06:00:47 AM by gforce »

kosalos

• Fractal Friar
• Posts: 142
Requesting help understanding equations
« Reply #21 on: August 23, 2018, 06:47:46 PM »
I am trying to understand the equations well enough to write renditions for the iPad using their metal shading language.
But I am missing something.
For example, in JIT_gnj_RealPowNewton_01.m3f, I don't see the definition of "TPIteration3D",
and I don't understand what "PIteration3D^.J1" could mean.
In other shaders I have seen the '^' operator used on floating point values.

Can you point me to a link where I can learn background info on what these shaders are based on, and
how to better understand their environment?
And just in general, any links to places where I can learn shader "best standard operations, and tricks"

Thanks for helping a beginner like me.

Sabine62

• 3f
• Posts: 1179
Re: Revisiting the 3D Newton
« Reply #22 on: August 23, 2018, 07:42:27 PM »
Great that you posted these questions, kosalos, I've been playing with gannjondal's code as well, and it's ALMOST clear to me as I have no clue really about the maths, so lots of things I still need to dig in to This is what I think might help you a little bit further:

TPIteration3D: Haven't spotted a TPIteration3D, either, maybe some leftover of something tested earlier? comes standard within the Mandelbulb3d JIT coding environment.

PIteration3D: I am not quite sure about the correct format of JIT, but basically PIteration3D works as a vec3 user input, loaded into vec3 c:

cx := PIteration3D^.J1;
cy := PIteration3D^.J2;
cz := PIteration3D^.J3;

which is used as a kind of scalar for r_pow further down:

x := fac_eff*x - cx*cos(phi_pow)*cos(theta_pow)*r_pow/Power_ ;
y := fac_eff*y - cy*cos(phi_pow)*sin(theta_pow)*r_pow/Power_ ;
z := fac_eff*z + cz*sin(phi_pow)*r_pow/Power_ ;

The ^.J1-3 seem to me the x,y,z-coordinates of PIteration3D, so if you'd declare both c and PIteration3D as vec3, the whole thing up here would look like:

vec3 PIteration3D (user input);
vec3 c;

c=PIteration3D;

z.x = fac_eff*z.x - c.x*cos(phi_pow)*cos(theta_pow)*r_pow/Power_ ;
z.y = fac_eff*z.y - c.y*cos(phi_pow)*sin(theta_pow)*r_pow/Power_ ;
z.z = fac_eff*z.z + c.z*sin(phi_pow)*r_pow/Power_ ;

« Last Edit: August 25, 2018, 04:02:12 PM by Sabine62 »

gannjondal

• Fractal Phenom
• Posts: 44
Re: Revisiting the 3D Newton
« Reply #23 on: August 26, 2018, 06:44:19 PM »
Oh-oh. So many updates!  I should really come back more often.
But honestly, this long summer made me too lazy in mind

Have tried to port this to Fragmentarium. Has been so long that I have done anything with fractals and still completely lacking any understanding of math, I am so happy that the thing shows anything at all. Have stolen the DE from Mandelbulb, and no optimization at all as will have to read up on that AGAIN after all this time Neither have any idea what should go into the loop and what not etc etc, it's all just throwing gannjondals newton blindly at fragm, but here it is for your enjoyment (or dispair )Julia does blow up the whole thing, but added rotations which give really nice results....

Great to hear some sign of life from you, Sabine!  It has really been a while
Your new version of the pictures look really interesting!
The pictures are very different to mine in MB3D, but absolutely valid as an own formula with some unique structure.

To understand the differences I have tried to analyze an older version of your .frag, and tried to get it running in Fragmentarium.
The result ...
Well I was happy to get the frag compiled with my AMD card (it seams that some functions that are part of the GLSL standard are not understood by AMD's GLSL).
As of now I get something like a better point cloud (ok, I'm an absolute Fragmentarium beginner).

Nevertheless I have attached my current version. I have re-ordered some lines, and added a ton of comments.
Maybe it helps you a bit to understand even more, or to get a version that is equivalent to mine ( if you should want to do that  ).

I am trying to understand the equations well enough to write renditions for the iPad using their metal shading language.
But I am missing something.
For example, in JIT_gnj_RealPowNewton_01.m3f, I don't see the definition of "TPIteration3D",
and I don't understand what "PIteration3D^.J1" could mean ....

Please have a look Sabine's explanations. I just want to add the point of view of an MB3D JIT formula author:

TPIteration3D is pure MB3D.
It is a big (Delphi style) structure, defined within the MB3D code, and the one-and-only structure that is exposed to JIT formula authors.
It contains almost everything you can touch when writing JIT formulas.
Don't heat up your brain with the details if you don't want to write JIT formulas for MB3D - it's too weird!

And yes, TPIteration3D^.J1/2/3 are just the built-in Julia parameters if Julia=true, and the position values in case of Julia=false. Hence it's simply the c in z=z²+c.

To produce something really generic one could simply allow the user to define f(h) and g(h) (for 3D h=a+bi+cj) where the "Newton" is performed as:
Code: [Select]
init:
h = 0 or value from coord for julia
oldh = 0
a = value from coord for mandy or constant for julia
loop:
oldh = h
h = (f(h) - a) / (g(h) + user const)

Obviously for proper Newtons g(h) should be the derivative of f(h), in particular it should be 1 degree less - but then again why stick to either ?
In this case allowing the option of either divergent or convergent bailout or indeed both might be useful.

You are right, that would simplify much!
But right now you will need to write one formula for each f().
This is true for every fractal program on the market unfortunately, even for such elaborated programms like Fragmentarium, or Ultra Fractal.
To allow it to program in a way as you have suggested you would need to marry a program that allows symbolic calculation (like Octave) with Fragmentarium & Co.
Feel free to write such a software! (but don't forget the automatic DE code optimizer)
But seriously, it may be a not too weird idea to build something like a formula generator in Octave or so, that can calculate derivations etc, so that you can just copy the result into Fragmentarium, JIT, UF, or whatever.

I have this Bookmarked, and will make a note at GitHub
it looks so good. The maths talk is above me, but the JITs i should be able to follow.  Oh man!! it is just finding the time.!!

BTW. Adding formulas and compliling a standalone Mandelbulber in QT , has never been easier
....

Thank you for your kind words, mclarekin!
On the other hand, I must it admit. I am one of those Windows users who never would use a word like 'easy' if it comes to compile a huge and complex software project (especially such with an UI).
I am not completely agnostic to programming (otherwise I would not write those JIT formulas), but I think, if you really want so see the Newton variants in Mandelbulber then it would be probably faster if you would start (feel however free to ask if really needed)...

I would be interested in this variation, I'd be even more interested in that variant with the all the bells and whistles you've added to JIT_gnj_RealPowNewton_04. It might not look good with simple transformations like rotation but i think it will have potential for hybrid formulas

The variant you have been pointing to is mathematically useless in the form I have tried; it is even not good for transformations I'm afraid (it destroys too much on information).
I have enogh other ideas, and maybe I will publish one or two other formulas if I should find something useful - But EVERYONE would stop to have even a look if I would offer something like the several hundred of Newton variants that I have in UF

Sabine62

• 3f
• Posts: 1179
Re: Revisiting the 3D Newton
« Reply #24 on: August 27, 2018, 12:06:22 AM »
HeyHey and Moin, gannjondal!
Not much time but looked quickly at the .frag
Here's some pwitty picshers for ya and attached the .frag
Hopefully will have time to study your code soon!

FractalDave

• Posts: 183
Re: Revisiting the 3D Newton
« Reply #25 on: September 13, 2018, 01:41:34 PM »
"But seriously, it may be a not too weird idea to build something like a formula generator in Octave or so, that can calculate derivations etc, so that you can just copy the result into Fragmentarium, JIT, UF, or whatever."

In UF I just paired some operations with their derivatives so the user could then select which are used in the iterated formula, if I remember correctly even including some functions of functions....with plain complex it's very simple but generic 2D or 3D+ except quaternions/bicomplex gets complicated due to non-standard derivatives so I didn't get that far, though another formula of mine for UF does allow generic manipulations of general 2D numbers i.e. so with x,y real new(x,y)=f(x,y),g(x,y) where f() and g() can be defined by the user - this is something else I'm intending to add as 3D+ either to UF or possibly other software

Edit: Ooops, sorry my mistake, I did do the Multivariable Newton formula in mmf3.ufm !!

FractalDave

• Posts: 183
Re: Revisiting the 3D Newton
« Reply #26 on: October 01, 2018, 10:24:43 PM »
Just remembered that for general 2D (or higher) formulas such as new (x,y) = (f(x,y),g(x,y)) you need to use the Jacobi for the correct derivatives, I'd've mentioned that in my last post but couldn't remember the name (am getting old).

gannjondal

• Fractal Phenom
• Posts: 44
Re: Revisiting the 3D Newton
« Reply #27 on: November 06, 2020, 11:02:40 PM »
I have this Bookmarked, and will make a note at GitHub
it looks so good. The maths talk is above me, but the JITs i should be able to follow.  Oh man!! it is just finding the time.!!

BTW. Adding formulas and compliling  a standalone Mandelbulber in QT , has never been easier

In hybrid mode we can now test all the combinations of DE method and DE function, to find which best suits the hybrid settings.  Also, this reconfiguartion allows me to easily add other DE functions.  Previously we could not use fast anaytic DE when hybridizing linear with logrthmic type formulas.

Honestly I was always too lazy to work in all that dependencies needed to really incorporate a new c++ formula and its UI into the Mandelbulber project. Well, I'm not really a programmer.
But once I have seen the new possibility to create OpenCL custom formulas (thank you for this!) I have tried to create a formula for Mandelbulber as well.
And it seams that it has worked.

For the Newton bulb:
Code: [Select]
# Mandelbulber settings file
# version 2.23
# only modified parameters
[main_parameters]
ambient_occlusion_enabled true;
ambient_occlusion_quality 8;
background_color_1 0200 0200 2600;
bailout 4;
brightness 1,5;
camera -2,06733311933425 0,968800238310736 -2,08784365965326;
camera_distance_to_target 5,02843344069542;
camera_rotation -125,669393428518 49,7239995053859 -173,65953118383;
camera_top 0,680413070276891 -0,352436274306258 -0,642515934704735;
DE_factor 0,5;
delta_DE_function 6;
delta_DE_method 2;
detail_level 2;
file_background C:\work\frac\mandelbulber2\textures\background.jpg;
file_envmap C:\work\frac\mandelbulber2\textures\envmap.jpg;
file_lightmap C:\work\frac\mandelbulber2\textures\lightmap.jpg;
flight_last_to_render 0;
formula_1 10000;
formula_stop_iteration_1 500;
formula_stop_iteration_2 500;
gamma 0,65;
glow_color_2 f000 f300 ce00;
glow_intensity 2,5;
hdr true;
image_height 2160;
image_proportion 2;
image_width 2880;
julia_c -1 0 0;
keyframe_last_to_render 0;
mat1_coloring_speed 0,1;
mat1_is_defined true;
mat1_specular_metallic_roughness 0,3;
raytraced_reflections true;
target 0,573546289257179 -0,926725805690159 1,74854524572326;
use_default_bailout false;
view_distance_max 7,65686688139087;
[fractal_1]
analyticDE_offset_1 4;
analyticDE_scale_1 2;
transf_constant_julia_mode true;
transf_constant_multiplier_100 -1 0 0;
transf_function_enabled false;
transf_function_enabledAy_false true;
transf_offset_111 0,15 0 0;
transf_rotation 0 10 0;
transf_rotation2 0 10 0;
transf_vec_111 1 0 0;
[fractal_2]
analyticDE_offset_1 4;
analyticDE_scale_1 2;
transf_constant_julia_mode true;
transf_constant_multiplier_100 -1 0 0;
transf_function_enabled false;
transf_function_enabledAy_false true;
transf_offset_111 0,15 0 0;
transf_rotation 0 10 0;
transf_rotation2 0 10 0;
transf_vec_111 1 0 0;

For the hybrid (Note: This is with AnalyticDE; try also DeltaDE - for hybrids it creates clearer pictures):
Code: [Select]
# Mandelbulber settings file
# version 2.23
# only modified parameters
[main_parameters]
ambient_occlusion_enabled true;
background_color_1 0200 0300 2300;
bailout 4;
camera -2,42811955016328 1,7940514682123 -3,05765936250074;
camera_distance_to_target 7,32843344069544;
camera_rotation -146,025578108623 57,9279514045086 -162,581518612541;
camera_top 0,700067189853364 -0,503215253824273 -0,506636297564028;
DE_factor 0,5;
delta_DE_function 6;
delta_DE_method 2;
detail_level 2;
DOF_blur_opacity 2;
DOF_enabled true;
DOF_focus 3,40423846244812;
DOF_number_of_passes 2;
file_background C:\work\frac\mandelbulber2\textures\background.jpg;
file_envmap C:\work\frac\mandelbulber2\textures\envmap.jpg;
file_lightmap C:\work\frac\mandelbulber2\textures\lightmap.jpg;
flight_last_to_render 0;
fog_color_2 1a00 1d00 3b00;
formula_1 10000;
formula_2 1064;
formula_stop_iteration_1 500;
formula_stop_iteration_2 500;
hybrid_fractal_enable true;
image_height 2160;
image_proportion 2;
image_width 2880;
julia_c -1 0 0;
keyframe_last_to_render 0;
main_light_alpha 45;
main_light_beta 0;
mat1_coloring_speed 0,5;
mat1_is_defined true;
N 500;
raytraced_reflections true;
SSAO_random_mode true;
target -0,253578136137463 -1,43294530226358 3,15231633606105;
use_default_bailout false;
view_distance_max 7,65686688139087;
volumetric_fog_colour_1_distance 2,5e-06;
volumetric_fog_colour_2_distance 5e-06;
volumetric_fog_density 10;
volumetric_fog_distance_factor 2,5e-06;
volumetric_fog_enabled true;
[fractal_1]
analyticDE_offset_1 4;
analyticDE_scale_1 2;
transf_constant_julia_mode true;
transf_constant_multiplier_100 -1 0 0;
transf_function_enabled false;
transf_function_enabledAy_false true;
transf_offset_111 0,15 0 0;
transf_rotation 0 10 0;
transf_rotation2 0 10 0;
transf_vec_111 0,95 0,1 0;
[fractal_2]
analyticDE_offset_1 4;
analyticDE_scale_1 2;
transf_constant_julia_mode true;
transf_constant_multiplier_100 -1 0 0;
transf_function_enabled false;
transf_function_enabledAy_false true;
transf_offset_000 0,5 0 0;
transf_offset_111 0,2 0 0;
transf_rotation 30 0 0;
transf_rotation2 -30 0 0;
transf_vec_111 1 0 0;

mclarekin

• 3c
• Posts: 846
Re: Revisiting the 3D Newton
« Reply #28 on: November 07, 2020, 11:40:05 AM »
It has worked well,  and fast.

Are they producing same shape as JIT?

I will  have a closer look at your code later tonight

mclarekin

• 3c
• Posts: 846
Re: Revisiting the 3D Newton
« Reply #29 on: November 07, 2020, 12:10:51 PM »
10 seconds gtx 960m

Similar Topics

revisiting Jos Leys Kleinian

Started by mclarekin on Fractal Mathematics And New Theories

0 Replies
337 Views
January 25, 2019, 02:12:23 AM
by mclarekin
Newton's Garden

Started by gannjondal on Fractal Image Gallery

4 Replies
587 Views
April 17, 2018, 11:22:45 PM
by spain2points
Mandelbrot/Newton - Has it already been done?

Started by mrrudewords on Share a fractal

2 Replies
610 Views
February 09, 2019, 09:35:17 PM
by mrrudewords
Newton Fractal but different

15 Replies
1257 Views
August 29, 2019, 06:43:53 PM
by chrizbee
Newton (gannjondal)

Started by Sabine62 on Fractal Image Gallery

0 Replies
253 Views
August 15, 2018, 04:28:09 PM
by Sabine62