Commit 8f6e3d77 authored by BrutPitt's avatar BrutPitt
Browse files

ver 1.6.0 WiP - new experiment for 3D/4D fractals (volumetric -> sparse random dots)

parent fc0b50d2
......@@ -329,18 +329,42 @@ void AttractorBase::searchLyapunov()
////////////////////////////////////////////////////////////////////////////
void fractalBedouin::Step(vec4 &v, vec4 &vp)
void volBedouin::Step(vec4 &v, vec4 &vp)
{
int i;
do {
i = 0;
vec4 p0(fastPrng64.xoshiro256p_Range(sMin.x,sMax.x),
fastPrng64.xoshiro256p_Range(sMin.y,sMax.y),
fastPrng64.xoshiro256p_Range(sMin.z,sMax.z), 0.f);
vec4 p0(random3Dpoint());
v = vec4(0.f);
//v = p0;
for(float val = 0.f; i<maxIter && val<upperLimit; i++) {
vp.x = v.x*v.x - v.y*v.y - v.z*v.z + sin(p0.x);
vp.y = 2.f*v.x*v.z + sin(p0.y);
vp.z = 2.f*v.x*v.y + sin(p0.z);
val = dot(vec3(vp), vec3(vp));
v = vp;
}
vp = p0;
} while(i<kMax || (skipConvergent && i>=maxIter));
outColor = float(i) / float(maxIter);
}
void volSinRealMandel::Step(vec4 &v, vec4 &vp)
{
int i;
do {
i = 0;
vec4 p0(random3Dpoint());
v = vec4(0.f);
for(float val = 0.f; i<maxIter && val<upperLimit; i++) {
......@@ -349,13 +373,6 @@ void fractalBedouin::Step(vec4 &v, vec4 &vp)
vp.z = v.y*v.y + 2.f*v.x*v.z + sin(p0.z);
/*
vp.x = v.x*v.x - v.y*v.y - v.z*v.z + sin(p0.x);
vp.y = 2.f*v.x*v.z + sin(p0.y);
vp.z = 2.f*v.x*v.y + sin(p0.z);
*/
val = dot(vec3(vp), vec3(vp));
v = vp;
......@@ -368,6 +385,7 @@ void fractalBedouin::Step(vec4 &v, vec4 &vp)
outColor = float(i) / float(maxIter);
}
void volQuatJulia::Step(vec4 &v, vec4 &vp)
{
......@@ -375,14 +393,10 @@ void volQuatJulia::Step(vec4 &v, vec4 &vp)
int i;
do {
i = 0;
vec4 p0(fastPrng64.xoshiro256p_Range(sMin.x,sMax.x),
fastPrng64.xoshiro256p_Range(sMin.y,sMax.y),
fastPrng64.xoshiro256p_Range(sMin.z,sMax.z), 0.f);
//v = vec4(0.f);
vec4 p0(random3Dpoint());
v = p0;
for(float val = 0.f; i<maxIter && val<upperLimit; i++) {
vp.x = v.x*v.x - v.y*v.y - v.z*v.z - v.w*v.w;
vp.y = 2.f*v.x*v.y;
vp.z = 2.f*v.x*v.z;
......
......@@ -316,6 +316,12 @@ public:
virtual inline float colorFunc(const vec4 &v, const vec4 &vp) { return outColor; }
virtual void additionalDataCtrls();
inline const vec4 random3Dpoint() {
return vec4(fastPrng64.xoshiro256p_Range(sMin.x,sMax.x),
fastPrng64.xoshiro256p_Range(sMin.y,sMax.y),
fastPrng64.xoshiro256p_Range(sMin.z,sMax.z), 0.f);
}
protected:
int maxIter = 256;
int skipTop = 12;
......@@ -327,12 +333,20 @@ protected:
};
class fractalBedouin : public volumetricFractals
class volBedouin : public volumetricFractals
{
public:
fractalBedouin() {
stepFn = (stepPtrFn) &fractalBedouin::Step;
}
volBedouin() { stepFn = (stepPtrFn) &volBedouin::Step; }
protected:
void Step(vec4 &v, vec4 &vp);
void startData();
};
class volSinRealMandel : public volumetricFractals
{
public:
volSinRealMandel() { stepFn = (stepPtrFn) &volSinRealMandel::Step; }
protected:
void Step(vec4 &v, vec4 &vp);
......@@ -342,9 +356,7 @@ protected:
class volQuatJulia : public volumetricFractals
{
public:
volQuatJulia() {
stepFn = (stepPtrFn) &volQuatJulia::Step;
}
volQuatJulia() {stepFn = (stepPtrFn) &volQuatJulia::Step; }
int getPtSize() { return attPt4D; }
......@@ -646,7 +658,8 @@ public:
PB(BicomplexJExplorer , u8"\uf0da", FRACTAL_COLOR , "biComplexJExplorer" )
PB(glynnJB_IIM , u8"\uf0da", FRACTAL_COLOR , "Glynn JuliaBulb" )
PB(fractalBedouin , u8"\uf0da", VOLFRAC_COLOR , "Bedouin" )
PB(volBedouin , u8"\uf0da", VOLFRAC_COLOR , "Bedouin" )
PB(volSinRealMandel , u8"\uf0da", VOLFRAC_COLOR , "SinRealMandel" )
PB(volQuatJulia , u8"\uf0da", VOLFRAC_COLOR , "quatJulia" )
PB(tetrahedronGaussMap, u8"\uf0da", IFS_COLOR , "tetrahedronGaussMap")
......
......@@ -864,7 +864,18 @@ void Dadras::startData()
Insert(vVal[0]);
}
void fractalBedouin::startData()
void volBedouin::startData()
{
vVal.push_back(vec4(.1f, -.17f, .7f, 0.f));
kVal.push_back(.1f);
kVal.push_back(-.17f);
kVal.push_back(.7f);
Insert(vVal[0]);
}
void volSinRealMandel::startData()
{
vVal.push_back(vec4(.1f, -.17f, .7f, 0.f));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment