bosottip
Forums Freshman
 
Posts: 10
|
 |
« on: January 07, 2017, 02:05:47 PM » |
|
Hi.
I've got reasonable results with my own ray tracer and explorer using standard formulae like Mandelbulb and Mandelbox. I've seen interesting pictures of several hybrids and tried to implement them. I'm able to paste into my tracer different formulae, iterate them in any sequence, but sounds like I haven't understood how the hybrids work. I searched the site for information, but what I found mostly relates to formulae and parameters applicable to Mandelbuber or other standar tracers and no detailed description of how hybrids are implemented.
Below is my HLSL loop code. I'm not using DE, yust bailing out on radius. Iterx and addretx are set outside the loop to changhe number of iterations, add or not the constant value.
rot(v0) is the standard Mandelbulb rotation. cubefold and spherefold are from the standard Mandelbox.
Anything obviously worng with what I'm doing?
Thanks for any suggestion. Regards.
void searchloop() { for (iteration = 0; (lv0 < 12) && (iteration < maxiter); iteration++) { if (iteration >= miniter0 && iteration < maxiter0) { v0 = cubefold(v0, fold0); v0 = spherefold(v0) * sc + vret * addret0; lv0 = length(v0); //if (lv0 >= 12) break; } if (iteration >= miniter1 && iteration < maxiter1) { v0 = cubefold(v0, fold1) + vret * addret1; lv0 = length(v0); //if (lv0 >= 12) break; } if (iteration >= miniter2 && iteration < maxiter2) { v0 = rot(v0) + vret * addret2; lv0 = length(v0); //if (lv0 >= 12) break; } lv0 = length(v0); } }
|
|
|
|
|
Logged
|
|
|
|
|
SamTiba
|
 |
« Reply #1 on: January 14, 2017, 02:51:21 AM » |
|
Just what do you think is a 'hybrid' ? It's like a connection between different formulas, so lets say we calculate a Julia-set and we have two parameters a and b and want to make some kind of hybid. We have the variables from the gaussian number plane but that is not enough, we need some more! so we take the iteration counter and use it as a variable too. When we only calculate for a fixed amount of iterations we can easily build a hybrid from that (using a + (b-a)*steps/maxsteps as the new parameter). Other types need different implementations
Try to enhance this idea, what else can we do with the iteration counter as a variable? What things can we use as a variable to build hybrids other then that?
There's a lot to explore, just think of anything you can imagine
|
|
|
|
|
Logged
|
|
|
|
|
mclarekin
|
 |
« Reply #2 on: January 14, 2017, 05:30:16 AM » |
|
I am not sure what defines a hybrid. Two different standard type formulas mixed is a hybrid Then the gray area, a formula manipulated by parts of another type of formula Then there are variations of a standard formula, which I don't class as hybrids, but maybe they are?
Anyhow your approach looks OK, (Hmm depending on what is the "Mandelbulb rotation" )
Here are some comments about variations/hybrids:
Vary z & c (and DE) by mathematical functions, including using the iteration time dimension i. For instance z = z + i * factor1 + i * i * factor2, but I would avoid doing this sort of thing if you are a beginner. Use pre-transforms ie that iterate a function once (maybe more) before entering the main formula iteration loop. In OpenCL I often have a PrismShape transform in the initial conditions, prior to the iteration loop. This single transform provides a lot of variations. As a general rule, pretransforms and the first few iterations of the formula, have the most influence over the hybrid. The possibilities are infinite.
Your approach with miniter maxiter is what I do when experimenting. Often I begin with a standard formula and gradually add additional transforms (all with start/stop controls). Start/stop controls then let me see over what iteration range it will produce a satisfactory result. Sometimes I can only run the iteration once or twice at the beginning or near bailout. The stop/start controls allows me to play with the sequence of transforms within the loop. And sometimes you will find that a transform does not noticeably change the fractal after the first few iterations and so can be stopped early to save some calculation time.
It is helpful to have a "transform bank" where you store a lot of coded transforms that can be easily inserted into your loop, to test the infinite possibilities.
As a general rule, the more you manipulate the less likely you will find a good hybrid (and analytical DE gets difficult).
Mixing linear type with logarithmic type formulas is more difficult than linear with linear.
Look at existing formula codes helps ( I recommend Darkbeams codes to start with, for they probably show the most additional parameters and mathematical twists that can be tried)
If you see a hybrid made in Mandelbulber I can probably show you how it was created.
|
|
|
|
|
Logged
|
|
|
|
bosottip
Forums Freshman
 
Posts: 10
|
 |
« Reply #3 on: January 18, 2017, 11:50:03 PM » |
|
Hi, @mclarekin. Thanks for you suggestions. I'll make few more experiments. So far, I get things like this:  and I'm trying to figure out how to get pseudo-kleinian like: 
|
|
|
|
« Last Edit: January 19, 2017, 12:16:21 AM by bosottip »
|
Logged
|
|
|
|
|
mclarekin
|
 |
« Reply #4 on: January 19, 2017, 12:44:08 AM » |
|
This is actually one of the examples in Mandelbulber, so the settings file is in the Mandelbulber repository at github, or if you have installed the program then you can find it in "load examples." But here is part of the iteration loop code from Mandelbulber fractal_formulas.cpp, there is a rotation and a post offset in the code below, but was not used in the example. If you look at Fragmentarium examples you may find a less confusing version of the code. I have never tried rendering these without analytical DE. A main point is that you have chosen a formula where the iteration loop is terminated on maxiter, (not the more common bailout). Every iteration makes the fractal more complex, up to a point where there is no visible change. So with this formula try stopping iterations at maybe 6 and 20 iters to see the difference. If you get it working you can try applying a box fold or a prismshape fold before the pseudo kleinian CVector3 Csize = fractal->transformCommon.additionConstant0777; CVector3 tempZ = z; // correct c++ version. if (z.x > Csize.x) tempZ.x = Csize.x; if (z.x < -Csize.x) tempZ.x = -Csize.x; if (z.y > Csize.y) tempZ.y = Csize.y; if (z.y < -Csize.y) tempZ.y = -Csize.y; if (z.z > Csize.z) tempZ.z = Csize.z; if (z.z < -Csize.z) tempZ.z = -Csize.z;
z = tempZ * 2.0 - z; double k = max(fractal->transformCommon.minR05 / z.Dot(z), 1.0); z *= k; aux.DE *= k + fractal->analyticDE.tweak005;
if (fractal->transformCommon.functionEnabledRFalse && i >= fractal->transformCommon.startIterationsR && i < fractal->transformCommon.stopIterationsR) z = fractal->transformCommon.rotationMatrix.RotateVector(z);
z += fractal->transformCommon.additionConstant000; // no bailout
aux.pseudoKleinianDE = fractal->analyticDE.scale1;
|
|
|
|
Logged
|
|
|
|
bosottip
Forums Freshman
 
Posts: 10
|
 |
« Reply #5 on: January 19, 2017, 01:00:48 AM » |
|
I've just used my own tracer, never tried Mandelbulber, but looks it's worth having a look at it. Thanks.
|
|
|
|
|
Logged
|
|
|
|
|
cKleinhuis
|
 |
« Reply #6 on: January 19, 2017, 09:41:18 AM » |
|
hello, regarding hybrids this is one of my favorite topics, hybrids can be any forms of regulated formula modification, 2 ways of hybridizations exists, both are interchangeable and mix/mashup able as you like but you should be aware of the concept behind so i write some five cent worth words:
1. parameter only hybridization - each iteration can have its own set of parameters, this can either be a total long array defininig exact values for each iteration to use as c variable - some mathematical function to shift parameters with iters as variable as described above - and many other fance methods to obtain parameters (e.g. alternating where an array of seed values is used with modulo index access)
the important property of this method is that it basically adds no extra computational time the more efficient new parameters are generated the less is the impact compared to the unhybrided formula
another property of parameter only hybridisation is that it does NOT create any completely different shapes but adds an unlimited amount of parameters to modify ANY iterative function
2. formula hybridisation the second way acts on the formula itself, interchanging the formula for each iteration, various methods can be applied here to determine which formula to use in every iteration, it is always possible to define a formula with parameters for each iteration but for practical uses some modular arithmetic helps out here as well some types we can describe here:
- consecutive - in consecutive manner a changepoint is defined at which iteration to exchange to a new formula and afterwards this formula is used - alternative - as described above for parameter hybrids ...
so, regarding behaviour or property behaviours of the generated fractal some things should one be aware of as well:
- a hybrid can only kickin as long as a point is NOT diverged, if the iteration is left before reaching the hybrid iteration nothing changes at all, this can be used for loophole effects where the inner part of a fractal is exchanged with the another fractal starting from weird positions giving very weird outcomes
- as always keep in mind changing starting conditions heavily effects later iterations especially when using hybrids
so and final word is all above described methods apply to any iterative system, so it is applicable for 2d and 3d
mandelbulb3d has a nice hybridisation build in consecutive/alternative with possibility to set range for any entry this set up is a very flexible hybrid definition form without imposing to much calculation overhead
|
|
|
|
|
Logged
|
---
divide and conquer - iterate and rule - chaos is No random!
|
|
|
|
cKleinhuis
|
 |
« Reply #7 on: January 19, 2017, 09:43:10 AM » |
|
Anything obviously worng with what I'm doing?
no this just looks fine, its simple as that, i have written some things down in prev post
|
|
|
|
|
Logged
|
---
divide and conquer - iterate and rule - chaos is No random!
|
|
|
|
cKleinhuis
|
 |
« Reply #8 on: January 19, 2017, 09:46:37 AM » |
|
|
|
|
|
|
Logged
|
---
divide and conquer - iterate and rule - chaos is No random!
|
|
|
|
mclarekin
|
 |
« Reply #9 on: January 21, 2017, 12:33:43 AM » |
|
a) another hybrid type tweak is the position of of bailout check(s) within a formula. ie constructing a formula from seven transforms and having the bailout check after the 4th transform instead of at the end.
Or having a bailout check after the 3rd and the 7th transform. But more checks = slower calculation.
In respect to analytical DE. Sometimes playing with the position of bailout check(s) I will find a setup that fits with the DE calc better .
b) In respect to varying parameters over time, the curvilinear curve (see attached image), is my current preference because it is easy to manipulate. I can easily have the parameter dropping below the start value then bring it back up to a positive tweak.
c) In mandelbulberV2 each of the 9 slots has a weight parameter (like apophysis). This opens up a huge amount of hybridization but no one seems to experiment with it much .
|
|
|
|
Logged
|
|
|
|
bosottip
Forums Freshman
 
Posts: 10
|
 |
« Reply #10 on: January 21, 2017, 11:04:50 AM » |
|
@ mclarekin Hi, thanks for your hints. As I said in my original post, I'm using my own shader where I don't use DE, just bailing out on radius. I found that it doesn't make a big difference in terms of speed, it's easier and the results look very similar. I've been playing with hybrids and, yes, there's a huge room for experiments.
But right now I'm focusing on pseudo kleinian. Looks like I'm not doing the right things. I think I'll finally download Mundelbulber trying to figure out how it works to fix my shader.
|
|
|
|
|
Logged
|
|
|
|
|