BURT 3D

  • 19 Replies
  • 159 Views

0 Members and 1 Guest are viewing this topic.

Offline 3DickUlus

  • *
  • 3f
  • ******
  • Posts: 1402
    • Digilantism
« Reply #15 on: May 31, 2019, 05:30:18 AM »
Ok, cleaned things up a bit, removed color code in an effort to keep it as simple as possible, adding color stuff is an exercise for the user ;)
Honestly Sabine62 I would not have done this on my own, thank you for the nudge ;)

Code: [Select]
#info 3Dickulus' Burt's bisector
#info https://fractalforums.org/fractal-mathematics-and-new-theories/28/is-there-a-name-for-this-fractal/2748/msg13925#msg13925
#info Distance Estimator
#info Zn+1 = -Zn^3 + Zn^2 + Zn^1 + C
#info
#define WANG_HASH
#include "MathUtils.frag"

//#define providesColor
#define providesInit
//#define USE_IQ_CLOUDS
#define KN_VOLUMETRIC
#define USE_EIFFIE_SHADOW
#define MULTI_SAMPLE_AO

#include "DE-Kn2cr11.frag"

#group Burt's Bisector Bulb
// Number of fractal iterations.
uniform int Iterations;  slider[0,9,100]
// Number of color iterations.
uniform int ColorIterations;  slider[0,9,100]
// Bailout radius
uniform float Bailout; slider[0,5,30]
uniform vec3 RotVector; slider[(-1,-1,-1),(0,0,0),(1,1,1)]
uniform float RotAngle; slider[0.0,0,360]
uniform bool Julia; checkbox[false]
uniform vec3 JuliaC; slider[(-2,-2,-2),(0,0,0),(2,2,2)]

mat3 rot;

void init() {
rot = rotationMatrix3(RotVector, RotAngle);
}

float power = 0.0;

void powN(inout vec3 z, float r, inout float dr) {
// extract polar coordinates
float theta = acos(z.z/r);
float phi = atan(z.y,z.x);
dr =  pow( r, power-1.0)*power*dr + 1.0;

// scale and rotate the point
float zr = pow( r,power);
theta = theta*power;
phi = phi*power;

// convert back to cartesian coordinates
z = zr*vec3(sin(theta)*cos(phi), sin(phi)*sin(theta), cos(theta));

}

float DE(vec3 pos) {
vec3 z=pos;
float r;
float dr=1.0;
int i=0;
r=length(z);

vec3 z3=-z;
vec3 z2=z;
vec3 z1=z;

while(r<Bailout && (i<Iterations)) {

power = 3.;
powN(z3,r,dr);
power = 2.;
powN(z2,r,dr);
power = 1.;
powN(z1,r,dr);

z=z3+z2+z1;

z+=(Julia ? JuliaC : pos);
z*=rot;

z3=-z;
z2=z;
z1=z;

r=length(z);

if (i<ColorIterations) orbitTrap = min(orbitTrap, abs(vec4(z.x,z.y,z.z,r*r)));
i++;
}

return 0.5*log(r)*r/dr;

}

#preset Default
Gamma = 1
Brightness = 1
Contrast = 1
Saturation = 1
FOV = 0.4
Eye = -3.49456263,0.020474322,-0.705406666
Target = -2.49937892,0.024657886,-0.567591131
Up = 0.121945783,-0.001467107,-0.880541503
EquiRectangular = false
ToneMapping = 5
Exposure = 1
GaussianWeight = 1
AntiAliasScale = 2
DepthToAlpha = false
ShowDepth = false
DepthMagnitude = 1
Detail = -4.5
FudgeFactor = 0.279863481
NormalBackStep = 1
CamLight = 1,0.925490201,0.850980401,0.202830188
BaseColor = 1,1,1
OrbitStrength = 0.567567567
X = 0.5,0.600000024,0.600000024,0.699999988
Y = 1,0.600000024,0,0.656682028
Z = 0.800000012,0.779999971,1,0.767281106
R = 0.400000006,0.699999988,1,0.474048443
BackgroundColor = 0.776470602,0.945097983,0.996078372
GradientBackground = 3.59393232
CycleColors = true
Cycles = 3.0953488
EnableFloor = true
FloorNormal = 0,0,1
FloorHeight = 0.087248329
FloorColor = 1,0.843137264,0.521568656
FocalPlane = 4.87878819
Aperture = 0
InFocusAWidth = 0.644752018
DofCorrect = true
ApertureNbrSides = 7
ApertureRot = 0
ApStarShaped = false
Bloom = false
BloomIntensity = 0
BloomPow = 2
BloomTaps = 4
BloomStrong = 1
LensFlare = false
FlareIntensity = 0.25
FlareSamples = 8
FlareDispersal = 0.25
FlareHaloWidth = 0.5
FlareDistortion = 1
RefineSteps = 4
MaxRaySteps = 5385
MaxDistance = 78.9779322
Dither = 0
DetailAO = -0.848017619
coneApertureAO = 0.5
maxIterAO = 10
FudgeAO = 0.136413641
AO_ambient = 0.7
AO_camlight = 1
AO_pointlight = 1
AoCorrect = 0
Specular = 0.90131579
SpecularExp = 152.887882
AmbiantLight = 0.831372619,0.952941179,1,0.200000003
Reflection = 0.200000003,0.200000003,0.200000003
ReflectionsNumber = 1
SpotGlow = true
SpotLight = 1,0.952941179,0.905882418,1.09622413
LightPos = -7.23981895,-1.5837105,-3.8461538
LightSize = 0
LightFallOff = 0
LightGlowRad = 0
LightGlowExp = 1
HardShadow = 0.61774744
ShadowSoft = 18.1506849
ShadowBlur = 0
perf = false
SSS = false
sss1 = 0.1
sss2 = 0.5
HF_Fallof = 0.050774298
HF_Const = 0
HF_Intensity = 0.01594533
HF_Dir = 0,0,1
HF_Offset = 0
HF_Color = 0.00392156886,0.984313726,1,0.953237409
HF_Scatter = 0.068181818
HF_Anisotropy = 0.403921574,0.215686277,0.0313725509
HF_FogIter = 1
HF_CastShadow = false
EnCloudsDir = false
CloudDir = 0,0,1
CloudScale = 1
CloudFlatness = 0
CloudTops = -1.29545454
CloudBase = -4.13636364
CloudDensity = 1
CloudRoughness = 1
CloudContrast = 1
CloudColor = 0.649999976,0.680000007,0.699999988
CloudColor2 = 0.0700000003,0.170000002,0.239999995
SunLightColor = 0.699999988,0.5,0.300000012
Cloudvar1 = 0.99
Cloudvar2 = 1
CloudIter = 5
CloudBgMix = 1
WindDir = 0,0,1
WindSpeed = 1
Iterations = 10
ColorIterations = 9
Bailout = 2
Julia = false
JuliaC = 0,0,0
RotVector = 0,1,0
RotAngle = 45
#endpreset

...going to look closer at yours too mclarekin  :thumbs: just need some time  :-\

edit: rot back after julia
« Last Edit: June 01, 2019, 02:33:38 AM by 3DickUlus »
Fragmentarium is not a toy, it is a very versatile tool that can be used to make toys ;)

https://en.wikibooks.org/wiki/Fractals/fragmentarium

Offline mclarekin

  • *
  • Fractal Frankfurter
  • *
  • Posts: 604
« Reply #16 on: May 31, 2019, 07:44:18 AM »
@3DickUlus dont look at mine yet it keeps getting fixed.  :fp:
I will implement in C++ to find out what is the best way of dealing with the DE.
But in theory it is now z = z^4 + z^3 +z^2 + z + c, for integer powers only, using asin atan2 type Mandelbulbs
where each seperate power has a weight control.

@sabine62, it is fast as there is no pow(). latest beta version attached (even faster)

Offline 3DickUlus

  • *
  • 3f
  • ******
  • Posts: 1402
    • Digilantism
« Reply #17 on: May 31, 2019, 04:30:34 PM »
 -z^3 + z^2 + z is Burt

Yours has an extra term and not negating the first so I think it would be quite a bit different.

Offline mclarekin

  • *
  • Fractal Frankfurter
  • *
  • Posts: 604
« Reply #18 on: June 01, 2019, 12:53:19 AM »
Yep, I am coding the asine atan2 generic  (eventually starting at z^8) , you can choose any subset of terms, and they can be positive or negative terms)

Offline 3DickUlus

  • *
  • 3f
  • ******
  • Posts: 1402
    • Digilantism
« Reply #19 on: June 08, 2019, 09:22:58 AM »
I'm done (for now) playing with the code for Burt's Bisector Bulb, finding some really amazing stuff hiding in this one.

Basic coloring, change to suit as you please.
Added absXYZ options.

All of the thumbs in the contact are in BBB.frag as presets.


lamp
BURT 2D

Started by 3DickUlus on Code Snippets (fragments)

12 Replies
889 Views
Last post April 24, 2019, 09:06:28 AM
by Sabine62