Roqen's DomainMashup
Previous Image | Next Image
Description: Roqen's code here: https://fractalforums.org/code-snippets-fragments/74/roqens-domain-mashup/2390 Thank you for sharing, 3Dickulus!

Code: [Select]
// Output generated from file: D:/fractal/Fragmentarium123/Fragmentarium/Examples/Historical 3D Fractals/Mandelbulb.frag// Created: Wed Oct 3 11:55:21 2018#info Mandelbulb Distance Estimator#define providesInit#include "MathUtils.frag"//#include "DE-Raytracer.frag"#define USE_IQ_CLOUDS#define KN_VOLUMETRIC#define USE_EIFFIE_SHADOW#define MULTI_SAMPLE_AOuniform float time;#include "DE-Kn2cr11.frag"#group Mandelbulbuniform vec3 InvertC; slider[(-5,-5,-5),(0,0,0),(5,5,5)]// Number of fractal iterations.uniform int Iterations;  slider[0,9,100]// Number of color iterations.uniform int ColorIterations;  slider[0,9,100]// Mandelbulb exponent (8 is standard)uniform float Power; slider[0,8,16]// Bailout radiusuniform float Bailout; slider[0,5,30]// Alternate is slightly different, but looks more like a Mandelbrot for Power=2uniform bool AlternateVersion; checkbox[false]uniform vec3 RotVector; slider[(0,0,0),(1,1,1),(1,1,1)]uniform float RotAngle; slider[0.00,0,180]uniform bool Julia; checkbox[false]uniform vec3 JuliaC; slider[(-2,-2,-2),(0,0,0),(2,2,2)]mat3 rot;void init() { rot = rotationMatrix3(normalize(RotVector), RotAngle);}// Roqen's domain mashup performs the active c = T(s)vec3 domainMap(vec3 c){  float s = dot(c,c);  return c/s + InvertC;}// This is my power function, based on the standard spherical coordinates as defined here:// http://en.wikipedia.org/wiki/Spherical_coordinate_system//// It seems to be similar to the one Quilez uses:// http://www.iquilezles.org/www/articles/mandelbulb/mandelbulb.htm//// Notice the north and south poles are different here.void powN1(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));}// This is a power function taken from the implementation by Enforcer:// http://www.fractalforums.com/mandelbulb-implementation/realtime-renderingoptimisations///// I cannot follow its derivation from spherical coordinates,// but it does give a nice mandelbrot like object for Power=2void powN2(inout vec3 z, float zr0, inout float dr) { float zo0 = asin( z.z/zr0 ); float zi0 = atan( z.y,z.x ); float zr = pow( zr0, Power-1.0 ); float zo = zo0 * Power; float zi = zi0 * Power; dr = zr*dr*Power + 1.0; zr *= zr0; z  = zr*vec3( cos(zo)*cos(zi), cos(zo)*sin(zi), sin(zo) );}// Compute the distance from pos to the Mandelbox.float DE(vec3 pos) { vec3 z=pos; float r; float dr=1.0; int i=0; r=length(z); while(r<Bailout && (i<Iterations)) { if (AlternateVersion) { powN2(z,r,dr); } else { powN1(z,r,dr); } z+=(Julia ? JuliaC : pos); z += domainMap(-z); r=length(z); z*=rot; //if (i<ColorIterations) orbitTrap = min(orbitTrap, abs(vec4(z.x,z.y,z.z,r*r))); if (i<ColorIterations) orbitTrap = min(orbitTrap, abs(vec4(domainMap(-z),r))); //...where r = length(z) i++; }// if ((type==1) && r<Bailout) return 0.0; return 0.5*log(r)*r/dr; /* Use this code for some nice intersections (Power=2) float a =  max(0.5*log(r)*r/dr, abs(pos.y)); float b = 1000; if (pos.y>0)  b = 0.5*log(r)*r/dr; return min(min(a, b), max(0.5*log(r)*r/dr, abs(pos.z))); */}#preset DefaultFOV = 0.62536Eye = 2.36954,0.2323344,-0.5576415Target = -6.25064,-0.6224971,1.310623Up = -0.2169631,0.0713181,-0.9684369EquiRectangular = falseFocalPlane = 1.478633Aperture = 0.121802InFocusAWidth = 1DofCorrect = trueApertureNbrSides = 7ApertureRot = 0ApStarShaped = trueGamma = 2ToneMapping = 5Exposure = 1Brightness = 1Contrast = 1Saturation = 1GaussianWeight = 2AntiAliasScale = 1Bloom = trueBloomIntensity = 0.7324914BloomPow = 2.195946BloomTaps = 46BloomStrong = 1DepthToAlpha = falseShowDepth = falseDepthMagnitude = 1Detail = -4.5RefineSteps = 4FudgeFactor = 0.6435868MaxRaySteps = 2622MaxDistance = 20Dither = 0NormalBackStep = 1DetailAO = -0.2284069coneApertureAO = 0.5maxIterAO = 62FudgeAO = 1AO_ambient = 1AO_camlight = 1AO_pointlight = 1AoCorrect = 0Specular = 0.052459SpecularExp = 3.389831CamLight = 1,0.9529412,0.8941177,0.1318182AmbiantLight = 0.5490196,0.8823529,1,0.1020882Reflection = 0.3490196,0.3490196,0.3490196ReflectionsNumber = 1SpotGlow = trueSpotLight = 1,0.9568627,0.8784314,1.618161LightPos = 2.466368,1.121076,-1.569507LightSize = 0LightFallOff = 0.1127396LightGlowRad = 0LightGlowExp = 0HardShadow = 1ShadowSoft = 1.731207ShadowBlur = 0.010158perf = trueSSS = falsesss1 = 0sss2 = 0.0010858BaseColor = 1,1,1OrbitStrength = 0.8829365X = 0.003921569,0.1372549,1,1Y = 0.972549,0.3215686,0.01568628,1Z = 1,0.9686275,0,1R = 0.7960784,0.5019608,0.3098039,1BackgroundColor = 0.1490196,0.2392157,0.1411765GradientBackground = 0.3261CycleColors = trueCycles = 3.40895EnableFloor = falseFloorNormal = 0,0,0FloorHeight = 0FloorColor = 1,1,1HF_Fallof = 2.257799HF_Const = 0HF_Intensity = 0.1386364HF_Dir = 0,0,1HF_Offset = -1.54195HF_Color = 0.4627451,0.6196079,0.6745098,0.6062356HF_Scatter = 1.938775HF_Anisotropy = 0.9960784,0.3843137,0.007843138HF_FogIter = 3HF_CastShadow = trueEnCloudsDir = trueCloudDir = -0.8271845,0.6737864,-0.2427184CloudScale = 1CloudFlatness = -0.0867398CloudTops = 2.040816CloudBase = 0.0680272CloudDensity = 1CloudRoughness = 1.645875CloudContrast = 6.526526CloudColor = 0.65,0.68,0.7CloudColor2 = 0.07,0.17,0.24SunLightColor = 0.7,0.5,0.3Cloudvar1 = 2Cloudvar2 = 9.334641CloudIter = 3CloudBgMix = 1WindDir = 0,0,1WindSpeed = 1Iterations = 12ColorIterations = 8Power = 3.92053Bailout = 7.765487AlternateVersion = trueRotVector = 1,1,1RotAngle = 138.5553Julia = trueJuliaC = 0.9274725,-1.010989,-0.2945055InvertC = -1.170921,0.1165372,-0.0610433#endpreset
Stats:
Views: 91
Total Favorities: 0 View Who Favorited
Filesize: 2.19MB
Height: 1000 Width: 1000
Posted by: Sabine62 December 16, 2018, 12:30:35 PM

Rating: by 4 members.
Total Likes: 2

 3DickUlus 3c Offline Posts: 918 December 16, 2018, 12:59:30 PM he's very cute ( it's a he right ) Sabine62 Fractal Frogurt Offline Posts: 449 It's just a jump to the left... December 16, 2018, 01:07:51 PM Couldn't say!  Thanks a lot, Dick, and thank you again for sharing all these fun transforms! gerson Fractal Phenom Offline Posts: 58 December 17, 2018, 07:29:59 PMI saved the code as a test file with .frag extension and try to run in Fragmentarium-2.0.0-nonv-noexr (Fragmentarium-2.0.0-180102) version but it gives this:What is wrong that it didnt render the image?Parse: C:/temp/Fractalforums - Roqen's DomainMashup.fragIncluding file: C:/temp/Fragmentarium-2.0.0-180102/Examples/Include/MathUtils.fragIncluding file: C:/temp/Fragmentarium-2.0.0-180102/Examples/Include/DE-Kn2cr11.fragIncluding file: C:/temp/Fragmentarium-2.0.0-180102/Examples/Include/3DKn-1.0.5.fragIncluding buffershader: C:/temp/Fragmentarium-2.0.0-180102/Examples/Include/BufferShader-1.0.1.fragParse: C:/temp/Fragmentarium-2.0.0-180102/Examples/Include/BufferShader-1.0.1.fragMandelbulb Distance EstimatorDE-RaytracerKn-0.9.12.frag: Original shader by syntopia. Modifications by knighty + Eiffie + ChrisJRodgers:- Added multiple reflections3DKn-0.9.12.frag: Original shader by syntopia. Modifications by knighty:- Assumes square shaped pixel -> no over-blurring along x axis if the rendering window width is small wrt its height- Added polygon shaped diaphragm.- Added Control for the width of the in-focus region.2 locked variables: NormalBackStep,EnableFloorCamera: Use W/S to fly. 1/3 adjusts speed. Q/E rolls. Click on 3D window for key focus. See Help Menu for more.Created front and back buffers as RGBA32FMaximum texture size: 16384x16384Could not create fragment shader: ERROR: 2:1129: 'rand' : no matching overloaded function found (using implicit conversion) ERROR: 2:1129: 'rand' : no matching overloaded function found (using implicit conversion) ERROR: 2:1130: 'rand' : no matching overloaded function found (using implicit conversion) ERROR: 2:1130: 'rand' : no matching overloaded function found (using implicit conversion) ERROR: 2:1131: 'rand' : no matching overloaded function found (using implicit conversion) ERROR: 2:1131: 'rand' : no matching overloaded function found (using implicit conversion) ERROR: 2:1132: 'rand' : no matching overloaded function found (using implicit conversion) ERROR: 2:1132: 'rand' : no matching overloaded function found (using implicit conversion) WARNING: 2:1158: 'assign' : implicit type conversion allowed from GLSL 1.20 ERROR: 2:1165: 'time' : undeclared identifier WARNING: 2:1169: 'assign' : implicit type conversion allowed from GLSL 1.20 WARNING: 2:1169: 'assign' : implicit type conversion allowed from GLSL 1.20 ERROR: 2:1169: 'rand' : no matching overloaded function found (using implicit conversion) ERROR: 2:1300: 'rot' : undeclared identifier ERROR: 2:1300: 'RotVector' : undeclared identifier ERROR: 2:1300: 'RotAngle' : undeclared identifier ERROR: 2:1300: 'rotationMatrix3' : no matching overloaded function found (using implicit conversion) ERROR: 2:1306: 'InvertC' : undeclared identifier ERROR: 2:1319: 'Power' : undeclared identifier ERROR: 2:1338: 'Power' : undeclared identifier ERROR: 2:1354: 'r' : undeclared identifier ERROR: 2:1355: 'Bailout' : undeclared identifier ERROR: 2:1355: 'Iterations' : undeclared identifier WARNING: 2:1355: 'assign' : implicit type conversion allowed from GLSL 1.20 WARNING: 2:1355: 'assign' : implicit type conversion allowed from GLSL 1.20 ERROR: 2:1356: 'AlternateVersion' : undeclared identifier ERROR: 2:1356: '' : boolean expression expected ERROR: 2:1361: 'Julia' : undeclared identifier ERROR: 2:1361: 'JuliaC' : undeclared identifier ERROR: 2:1361: '' : boolean expression expected ERROR: 2:1364: 'rot' : undeclared identifier ERROR: 2:1366: 'ColorIterations' : undeclared identifier WARNING: 2:1366: 'assign' : implicit type conversion allowed from GLSL 1.20 WARNING: 2:1366: 'assign' : implicit type conversion allowed from GLSL 1.20 Failed to compile script (125 ms). Sabine62 Fractal Frogurt Offline Posts: 449 It's just a jump to the left... December 18, 2018, 01:31:19 PMThe time-error is my fault, sorry!  The rand-error should not happen since rand should be part of your MathUtils... You can check by opening ExamplesIncludeMathUtils.frag in a text-editor and search for 'rand'.Other errors seem to indicate that your GPU has trouble with the GLSL-version?Try again with the code below and please post again here if this does not work? In that case it would be good to know the make and version of you GPU.Code: [Select]#info Mandelbulb Distance Estimator#define providesInit#include "MathUtils.frag"//#include "DE-Raytracer.frag"#define USE_IQ_CLOUDS#define KN_VOLUMETRIC#define USE_EIFFIE_SHADOW#define MULTI_SAMPLE_AOuniform float time;#include "DE-Kn2cr11.frag"#group Mandelbulbuniform vec3 InvertC; slider[(-5,-5,-5),(0,0,0),(5,5,5)]// Number of fractal iterations.uniform int Iterations;  slider[0,9,100]// Number of color iterations.uniform int ColorIterations;  slider[0,9,100]// Mandelbulb exponent (8 is standard)uniform float Power; slider[0,8,16]// Bailout radiusuniform float Bailout; slider[0,5,30]// Alternate is slightly different, but looks more like a Mandelbrot for Power=2uniform bool AlternateVersion; checkbox[false]uniform vec3 RotVector; slider[(0,0,0),(1,1,1),(1,1,1)]uniform float RotAngle; slider[0.00,0,180]uniform bool Julia; checkbox[false]uniform vec3 JuliaC; slider[(-2,-2,-2),(0,0,0),(2,2,2)]mat3 rot;void init() { rot = rotationMatrix3(normalize(RotVector), RotAngle);}// Roqen's domain mashup performs the active c = T(s)vec3 domainMap(vec3 c){  float s = dot(c,c);  return c/s + InvertC;}// This is my power function, based on the standard spherical coordinates as defined here:// http://en.wikipedia.org/wiki/Spherical_coordinate_system//// It seems to be similar to the one Quilez uses:// http://www.iquilezles.org/www/articles/mandelbulb/mandelbulb.htm//// Notice the north and south poles are different here.void powN1(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));}// This is a power function taken from the implementation by Enforcer:// http://www.fractalforums.com/mandelbulb-implementation/realtime-renderingoptimisations///// I cannot follow its derivation from spherical coordinates,// but it does give a nice mandelbrot like object for Power=2void powN2(inout vec3 z, float zr0, inout float dr) { float zo0 = asin( z.z/zr0 ); float zi0 = atan( z.y,z.x ); float zr = pow( zr0, Power-1.0 ); float zo = zo0 * Power; float zi = zi0 * Power; dr = zr*dr*Power + 1.0; zr *= zr0; z  = zr*vec3( cos(zo)*cos(zi), cos(zo)*sin(zi), sin(zo) );}// Compute the distance from pos to the Mandelbox.float DE(vec3 pos) { vec3 z=pos; float r; float dr=1.0; int i=0; r=length(z); while(r0)  b = 0.5*log(r)*r/dr; return min(min(a, b), max(0.5*log(r)*r/dr, abs(pos.z))); */}#preset DefaultFOV = 0.62536Eye = 2.36954,0.2323344,-0.5576415Target = -6.25064,-0.6224971,1.310623Up = -0.2169631,0.0713181,-0.9684369EquiRectangular = falseFocalPlane = 1.478633Aperture = 0.121802InFocusAWidth = 1DofCorrect = trueApertureNbrSides = 7ApertureRot = 0ApStarShaped = trueGamma = 2ToneMapping = 5Exposure = 1Brightness = 1Contrast = 1Saturation = 1GaussianWeight = 2AntiAliasScale = 1Bloom = trueBloomIntensity = 0.7324914BloomPow = 2.195946BloomTaps = 46BloomStrong = 1DepthToAlpha = falseShowDepth = falseDepthMagnitude = 1Detail = -4.5RefineSteps = 4FudgeFactor = 0.6435868MaxRaySteps = 2622MaxDistance = 20Dither = 0NormalBackStep = 1DetailAO = -0.2284069coneApertureAO = 0.5maxIterAO = 62FudgeAO = 1AO_ambient = 1AO_camlight = 1AO_pointlight = 1AoCorrect = 0Specular = 0.052459SpecularExp = 3.389831CamLight = 1,0.9529412,0.8941177,0.1318182AmbiantLight = 0.5490196,0.8823529,1,0.1020882Reflection = 0.3490196,0.3490196,0.3490196ReflectionsNumber = 1SpotGlow = trueSpotLight = 1,0.9568627,0.8784314,1.618161LightPos = 2.466368,1.121076,-1.569507LightSize = 0LightFallOff = 0.1127396LightGlowRad = 0LightGlowExp = 0HardShadow = 1ShadowSoft = 1.731207ShadowBlur = 0.010158perf = trueSSS = falsesss1 = 0sss2 = 0.0010858BaseColor = 1,1,1OrbitStrength = 0.8829365X = 0.003921569,0.1372549,1,1Y = 0.972549,0.3215686,0.01568628,1Z = 1,0.9686275,0,1R = 0.7960784,0.5019608,0.3098039,1BackgroundColor = 0.1490196,0.2392157,0.1411765GradientBackground = 0.3261CycleColors = trueCycles = 3.40895EnableFloor = falseFloorNormal = 0,0,0FloorHeight = 0FloorColor = 1,1,1HF_Fallof = 2.257799HF_Const = 0HF_Intensity = 0.1386364HF_Dir = 0,0,1HF_Offset = -1.54195HF_Color = 0.4627451,0.6196079,0.6745098,0.6062356HF_Scatter = 1.938775HF_Anisotropy = 0.9960784,0.3843137,0.007843138HF_FogIter = 3HF_CastShadow = trueEnCloudsDir = trueCloudDir = -0.8271845,0.6737864,-0.2427184CloudScale = 1CloudFlatness = -0.0867398CloudTops = 2.040816CloudBase = 0.0680272CloudDensity = 1CloudRoughness = 1.645875CloudContrast = 6.526526CloudColor = 0.65,0.68,0.7CloudColor2 = 0.07,0.17,0.24SunLightColor = 0.7,0.5,0.3Cloudvar1 = 2Cloudvar2 = 9.334641CloudIter = 3CloudBgMix = 1WindDir = 0,0,1WindSpeed = 1Iterations = 12ColorIterations = 8Power = 3.92053Bailout = 7.765487AlternateVersion = trueRotVector = 1,1,1RotAngle = 138.5553Julia = trueJuliaC = 0.9274725,-1.010989,-0.2945055InvertC = -1.170921,0.1165372,-0.0610433#endpresetLast modified by: Sabine62 December 18, 2018, 01:41:26 PM gerson Fractal Phenom Offline Posts: 58 December 18, 2018, 04:37:59 PMI am trying it with a Intel(R) i3-3220 runing win7 64bits.About rand, I didnt change the MathUtils.frag so it appears many times on the file (that came with original package's software).Parse: C:/temp/Fractalforums - Roqen's DomainMashup_new.fragIncluding file: C:/temp/Fragmentarium-2.0.0-180102/Examples/Include/MathUtils.fragIncluding file: C:/temp/Fragmentarium-2.0.0-180102/Examples/Include/DE-Kn2cr11.fragIncluding file: C:/temp/Fragmentarium-2.0.0-180102/Examples/Include/3DKn-1.0.5.fragIncluding buffershader: C:/temp/Fragmentarium-2.0.0-180102/Examples/Include/BufferShader-1.0.1.fragParse: C:/temp/Fragmentarium-2.0.0-180102/Examples/Include/BufferShader-1.0.1.fragMandelbulb Distance EstimatorDE-RaytracerKn-0.9.12.frag: Original shader by syntopia. Modifications by knighty + Eiffie + ChrisJRodgers:- Added multiple reflections3DKn-0.9.12.frag: Original shader by syntopia. Modifications by knighty:- Assumes square shaped pixel -> no over-blurring along x axis if the rendering window width is small wrt its height- Added polygon shaped diaphragm.- Added Control for the width of the in-focus region.1 locked variables: EnableFloorCamera: Use W/S to fly. 1/3 adjusts speed. Q/E rolls. Click on 3D window for key focus. See Help Menu for more.Created front and back buffers as RGBA32FMaximum texture size: 16384x16384Could not create fragment shader: ERROR: 2:1128: 'rand' : no matching overloaded function found (using implicit conversion) ERROR: 2:1128: 'rand' : no matching overloaded function found (using implicit conversion) ERROR: 2:1129: 'rand' : no matching overloaded function found (using implicit conversion) ERROR: 2:1129: 'rand' : no matching overloaded function found (using implicit conversion) ERROR: 2:1130: 'rand' : no matching overloaded function found (using implicit conversion) ERROR: 2:1130: 'rand' : no matching overloaded function found (using implicit conversion) ERROR: 2:1131: 'rand' : no matching overloaded function found (using implicit conversion) ERROR: 2:1131: 'rand' : no matching overloaded function found (using implicit conversion) WARNING: 2:1157: 'assign' : implicit type conversion allowed from GLSL 1.20 WARNING: 2:1168: 'assign' : implicit type conversion allowed from GLSL 1.20 WARNING: 2:1168: 'assign' : implicit type conversion allowed from GLSL 1.20 ERROR: 2:1168: 'rand' : no matching overloaded function found (using implicit conversion) ERROR: 2:1302: 'rot' : undeclared identifier ERROR: 2:1302: 'RotVector' : undeclared identifier ERROR: 2:1302: 'RotAngle' : undeclared identifier ERROR: 2:1302: 'rotationMatrix3' : no matching overloaded function found (using implicit conversion) ERROR: 2:1308: 'InvertC' : undeclared identifier ERROR: 2:1321: 'Power' : undeclared identifier ERROR: 2:1340: 'Power' : undeclared identifier ERROR: 2:1356: 'r' : undeclared identifier ERROR: 2:1357: 'Bailout' : undeclared identifier ERROR: 2:1357: 'Iterations' : undeclared identifier WARNING: 2:1357: 'assign' : implicit type conversion allowed from GLSL 1.20 WARNING: 2:1357: 'assign' : implicit type conversion allowed from GLSL 1.20 ERROR: 2:1358: 'AlternateVersion' : undeclared identifier ERROR: 2:1358: '' : boolean expression expected ERROR: 2:1363: 'Julia' : undeclared identifier ERROR: 2:1363: 'JuliaC' : undeclared identifier ERROR: 2:1363: '' : boolean expression expected ERROR: 2:1366: 'rot' : undeclared identifier ERROR: 2:1368: 'ColorIterations' : undeclared identifier WARNING: 2:1368: 'assign' : implicit type conversion allowed from GLSL 1.20 WARNING: 2:1368: 'assign' : implicit type conversion allowed from GLSL 1.20 Failed to compile script (94 ms). Sabine62 Fractal Frogurt Offline Posts: 449 It's just a jump to the left... December 18, 2018, 09:02:09 PMToo bad, gerson, I have no access to the files belonging to version 2.0... I am on version 2.5 https://fractalforums.org/index.php?action=downloads;sa=view;down=4Maybe installing the newest version will help?Your Intel(R) i3-3220 is your CPU, a GPU is your graphic card, sorry if I was not more clear! Can you tell me the brand and version of your GPU, if the installing of the newest Fragmentarium version does not help? mclarekin Fractal Fluff Offline Posts: 378 December 20, 2018, 08:58:45 AMI have trouble with rand, i think when using  pre-fragM V2.5 files in  V2.5I go to example and open the historic mandelbulb.fract  and paste in my old code after the # includes. The following compiles and works for meCode: [Select]#info Mandelbulb Distance Estimator#define providesInit#include "MathUtils.frag"#include "DE-Raytracer.frag"#group Mandelbulbuniform vec3 InvertC; slider[(-5,-5,-5),(0,0,0),(5,5,5)]// Number of fractal iterations.uniform int Iterations;  slider[0,9,100]// Number of color iterations.uniform int ColorIterations;  slider[0,9,100]// Mandelbulb exponent (8 is standard)uniform float Power; slider[0,8,16]// Bailout radiusuniform float Bailout; slider[0,5,30]// Alternate is slightly different, but looks more like a Mandelbrot for Power=2uniform bool AlternateVersion; checkbox[false]uniform vec3 RotVector; slider[(0,0,0),(1,1,1),(1,1,1)]uniform float RotAngle; slider[0.00,0,180]uniform bool Julia; checkbox[false]uniform vec3 JuliaC; slider[(-2,-2,-2),(0,0,0),(2,2,2)]mat3 rot;void init() { rot = rotationMatrix3(normalize(RotVector), RotAngle);}// Roqen's domain mashup performs the active c = T(s)vec3 domainMap(vec3 c){  float s = dot(c,c);  return c/s + InvertC;}// This is my power function, based on the standard spherical coordinates as defined here:// http://en.wikipedia.org/wiki/Spherical_coordinate_system//// It seems to be similar to the one Quilez uses:// http://www.iquilezles.org/www/articles/mandelbulb/mandelbulb.htm//// Notice the north and south poles are different here.void powN1(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));}// This is a power function taken from the implementation by Enforcer:// http://www.fractalforums.com/mandelbulb-implementation/realtime-renderingoptimisations///// I cannot follow its derivation from spherical coordinates,// but it does give a nice mandelbrot like object for Power=2void powN2(inout vec3 z, float zr0, inout float dr) { float zo0 = asin( z.z/zr0 ); float zi0 = atan( z.y,z.x ); float zr = pow( zr0, Power-1.0 ); float zo = zo0 * Power; float zi = zi0 * Power; dr = zr*dr*Power + 1.0; zr *= zr0; z  = zr*vec3( cos(zo)*cos(zi), cos(zo)*sin(zi), sin(zo) );}// Compute the distance from pos to the Mandelbox.float DE(vec3 pos) { vec3 z=pos; float r; float dr=1.0; int i=0; r=length(z); while(r0)  b = 0.5*log(r)*r/dr; return min(min(a, b), max(0.5*log(r)*r/dr, abs(pos.z))); */}#preset DefaultFOV = 0.62536Eye = 2.36954,0.2323344,-0.5576415Target = -6.25064,-0.6224971,1.310623Up = -0.2169631,0.0713181,-0.9684369EquiRectangular = falseFocalPlane = 1.478633Aperture = 0.121802InFocusAWidth = 1DofCorrect = trueApertureNbrSides = 7ApertureRot = 0ApStarShaped = trueGamma = 2ToneMapping = 5Exposure = 1Brightness = 1Contrast = 1Saturation = 1GaussianWeight = 2AntiAliasScale = 1Bloom = trueBloomIntensity = 0.7324914BloomPow = 2.195946BloomTaps = 46BloomStrong = 1DepthToAlpha = falseShowDepth = falseDepthMagnitude = 1Detail = -4.5RefineSteps = 4FudgeFactor = 0.6435868MaxRaySteps = 2622MaxDistance = 20Dither = 0NormalBackStep = 1DetailAO = -0.2284069coneApertureAO = 0.5maxIterAO = 62FudgeAO = 1AO_ambient = 1AO_camlight = 1AO_pointlight = 1AoCorrect = 0Specular = 0.052459SpecularExp = 3.389831CamLight = 1,0.9529412,0.8941177,0.1318182AmbiantLight = 0.5490196,0.8823529,1,0.1020882Reflection = 0.3490196,0.3490196,0.3490196ReflectionsNumber = 1SpotGlow = trueSpotLight = 1,0.9568627,0.8784314,1.618161LightPos = 2.466368,1.121076,-1.569507LightSize = 0LightFallOff = 0.1127396LightGlowRad = 0LightGlowExp = 0HardShadow = 1ShadowSoft = 1.731207ShadowBlur = 0.010158perf = trueSSS = falsesss1 = 0sss2 = 0.0010858BaseColor = 1,1,1OrbitStrength = 0.8829365X = 0.003921569,0.1372549,1,1Y = 0.972549,0.3215686,0.01568628,1Z = 1,0.9686275,0,1R = 0.7960784,0.5019608,0.3098039,1BackgroundColor = 0.1490196,0.2392157,0.1411765GradientBackground = 0.3261CycleColors = trueCycles = 3.40895EnableFloor = falseFloorNormal = 0,0,0FloorHeight = 0FloorColor = 1,1,1HF_Fallof = 2.257799HF_Const = 0HF_Intensity = 0.1386364HF_Dir = 0,0,1HF_Offset = -1.54195HF_Color = 0.4627451,0.6196079,0.6745098,0.6062356HF_Scatter = 1.938775HF_Anisotropy = 0.9960784,0.3843137,0.007843138HF_FogIter = 3HF_CastShadow = trueEnCloudsDir = trueCloudDir = -0.8271845,0.6737864,-0.2427184CloudScale = 1CloudFlatness = -0.0867398CloudTops = 2.040816CloudBase = 0.0680272CloudDensity = 1CloudRoughness = 1.645875CloudContrast = 6.526526CloudColor = 0.65,0.68,0.7CloudColor2 = 0.07,0.17,0.24SunLightColor = 0.7,0.5,0.3Cloudvar1 = 2Cloudvar2 = 9.334641CloudIter = 3CloudBgMix = 1WindDir = 0,0,1WindSpeed = 1Iterations = 12ColorIterations = 8Power = 3.92053Bailout = 7.765487AlternateVersion = trueRotVector = 1,1,1RotAngle = 138.5553Julia = trueJuliaC = 0.9274725,-1.010989,-0.2945055InvertC = -1.170921,0.1165372,-0.0610433#endpreset knighty Fractal Feline Offline Posts: 185 December 20, 2018, 11:05:16 AM Sabine62 Fractal Frogurt Offline Posts: 449 It's just a jump to the left... December 20, 2018, 11:32:36 AMThank you for the code, mclarekin!The rand-functions used to sit in Knighty's DE-Raytracer (last version with some additions by CJR, Eiffie, IQ etc is DE-Kn2cr11.frag). There's also a time-uniform in there which is dependant on the defining of IQ-clouds (no clouds, no time  )  With the last FragM-version(s) 3Dickulus has moved the rand-functions to MathUtils.frag, which seems a logical place for them. So that may generate errors if you have an older version of FragM. Also, for some reason, if clouds are not defined, the current DE-Kn2cr11.frag that ships with FragM2.5 needs the time-uniform declared before the ray-tracer is included. I promised to look into that, but haven't found time yet  And then, to make things even more complicated, bad/stubborn me clings to a version of Knighty's ray-tracer that I have changed a bit in many places to accommodate some more oddly behaving frags (LightPos uniform with higher values, that kind of thing) and I sometimes forget that when posting the frag   I really try not to forget to change the code to something that should work for everyone... Sabine62 Fractal Frogurt Offline Posts: 449 It's just a jump to the left... December 20, 2018, 09:33:03 PMThank you knighty (in case those thumbs-up were meant for the image ) timemit Fractal Friar Offline Posts: 131 December 25, 2018, 03:22:49 PMLovely little weirdo : ) Sabine62 Fractal Frogurt Offline Posts: 449 It's just a jump to the left... December 27, 2018, 11:07:03 AMThanks, Tim!