Where the Hard Light RainsRoqen's DomainMashupStructure 9 Detail
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!  :thumbs:


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_AO
uniform float time;
#include "DE-Kn2cr11.frag"

#group Mandelbulb
uniform 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 radius
uniform float Bailout; slider[0,5,30]

// Alternate is slightly different, but looks more like a Mandelbrot for Power=2
uniform 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=2
void 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 Default
FOV = 0.62536
Eye = 2.36954,0.2323344,-0.5576415
Target = -6.25064,-0.6224971,1.310623
Up = -0.2169631,0.0713181,-0.9684369
EquiRectangular = false
FocalPlane = 1.478633
Aperture = 0.121802
InFocusAWidth = 1
DofCorrect = true
ApertureNbrSides = 7
ApertureRot = 0
ApStarShaped = true
Gamma = 2
ToneMapping = 5
Exposure = 1
Brightness = 1
Contrast = 1
Saturation = 1
GaussianWeight = 2
AntiAliasScale = 1
Bloom = true
BloomIntensity = 0.7324914
BloomPow = 2.195946
BloomTaps = 46
BloomStrong = 1
DepthToAlpha = false
ShowDepth = false
DepthMagnitude = 1
Detail = -4.5
RefineSteps = 4
FudgeFactor = 0.6435868
MaxRaySteps = 2622
MaxDistance = 20
Dither = 0
NormalBackStep = 1
DetailAO = -0.2284069
coneApertureAO = 0.5
maxIterAO = 62
FudgeAO = 1
AO_ambient = 1
AO_camlight = 1
AO_pointlight = 1
AoCorrect = 0
Specular = 0.052459
SpecularExp = 3.389831
CamLight = 1,0.9529412,0.8941177,0.1318182
AmbiantLight = 0.5490196,0.8823529,1,0.1020882
Reflection = 0.3490196,0.3490196,0.3490196
ReflectionsNumber = 1
SpotGlow = true
SpotLight = 1,0.9568627,0.8784314,1.618161
LightPos = 2.466368,1.121076,-1.569507
LightSize = 0
LightFallOff = 0.1127396
LightGlowRad = 0
LightGlowExp = 0
HardShadow = 1
ShadowSoft = 1.731207
ShadowBlur = 0.010158
perf = true
SSS = false
sss1 = 0
sss2 = 0.0010858
BaseColor = 1,1,1
OrbitStrength = 0.8829365
X = 0.003921569,0.1372549,1,1
Y = 0.972549,0.3215686,0.01568628,1
Z = 1,0.9686275,0,1
R = 0.7960784,0.5019608,0.3098039,1
BackgroundColor = 0.1490196,0.2392157,0.1411765
GradientBackground = 0.3261
CycleColors = true
Cycles = 3.40895
EnableFloor = false
FloorNormal = 0,0,0
FloorHeight = 0
FloorColor = 1,1,1
HF_Fallof = 2.257799
HF_Const = 0
HF_Intensity = 0.1386364
HF_Dir = 0,0,1
HF_Offset = -1.54195
HF_Color = 0.4627451,0.6196079,0.6745098,0.6062356
HF_Scatter = 1.938775
HF_Anisotropy = 0.9960784,0.3843137,0.007843138
HF_FogIter = 3
HF_CastShadow = true
EnCloudsDir = true
CloudDir = -0.8271845,0.6737864,-0.2427184
CloudScale = 1
CloudFlatness = -0.0867398
CloudTops = 2.040816
CloudBase = 0.0680272
CloudDensity = 1
CloudRoughness = 1.645875
CloudContrast = 6.526526
CloudColor = 0.65,0.68,0.7
CloudColor2 = 0.07,0.17,0.24
SunLightColor = 0.7,0.5,0.3
Cloudvar1 = 2
Cloudvar2 = 9.334641
CloudIter = 3
CloudBgMix = 1
WindDir = 0,0,1
WindSpeed = 1
Iterations = 12
ColorIterations = 8
Power = 3.92053
Bailout = 7.765487
AlternateVersion = true
RotVector = 1,1,1
RotAngle = 138.5553
Julia = true
JuliaC = 0.9274725,-1.010989,-0.2945055
InvertC = -1.170921,0.1165372,-0.0610433
#endpreset

Stats:
Views: 160
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

Image Linking Codes
BB Thumbnail Image Code
BB Medium Image Code
Direct Link
0 Members and 1 Guest are viewing this picture.

Comments (12) rss

3DickUlus
3e
*****
Offline Offline

Posts: 1140



View Profile WWW
December 16, 2018, 12:59:30 PM
:awe: he's very cute ( it's a he right ??? )
Sabine62
Fractal Frankfurter
*
Offline Offline

Posts: 619


It's just a jump to the left...


View Profile WWW
December 16, 2018, 01:07:51 PM
:)) Couldn't say!  ;D

Thanks a lot, Dick, and thank you again for sharing all these fun transforms!  :)  :thumbs:
gerson
Fractal Friar
*
Offline Offline

Posts: 140



View Profile
December 17, 2018, 07:29:59 PM
I 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.frag
Including file: C:/temp/Fragmentarium-2.0.0-180102/Examples/Include/MathUtils.frag
Including file: C:/temp/Fragmentarium-2.0.0-180102/Examples/Include/DE-Kn2cr11.frag
Including file: C:/temp/Fragmentarium-2.0.0-180102/Examples/Include/3DKn-1.0.5.frag
Including buffershader: C:/temp/Fragmentarium-2.0.0-180102/Examples/Include/BufferShader-1.0.1.frag
Parse: C:/temp/Fragmentarium-2.0.0-180102/Examples/Include/BufferShader-1.0.1.frag
Mandelbulb Distance Estimator
DE-RaytracerKn-0.9.12.frag: Original shader by syntopia. Modifications by knighty + Eiffie + ChrisJRodgers:
- Added multiple reflections
3DKn-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,EnableFloor
Camera: 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 RGBA32F
Maximum texture size: 16384x16384
Could 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 Frankfurter
*
Offline Offline

Posts: 619


It's just a jump to the left...


View Profile WWW
December 18, 2018, 01:31:19 PM
The time-error is my fault, sorry!  :embarrass:
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_AO
uniform float time;
#include "DE-Kn2cr11.frag"



#group Mandelbulb
uniform 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 radius
uniform float Bailout; slider[0,5,30]

// Alternate is slightly different, but looks more like a Mandelbrot for Power=2
uniform 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=2
void 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 Default
FOV = 0.62536
Eye = 2.36954,0.2323344,-0.5576415
Target = -6.25064,-0.6224971,1.310623
Up = -0.2169631,0.0713181,-0.9684369
EquiRectangular = false
FocalPlane = 1.478633
Aperture = 0.121802
InFocusAWidth = 1
DofCorrect = true
ApertureNbrSides = 7
ApertureRot = 0
ApStarShaped = true
Gamma = 2
ToneMapping = 5
Exposure = 1
Brightness = 1
Contrast = 1
Saturation = 1
GaussianWeight = 2
AntiAliasScale = 1
Bloom = true
BloomIntensity = 0.7324914
BloomPow = 2.195946
BloomTaps = 46
BloomStrong = 1
DepthToAlpha = false
ShowDepth = false
DepthMagnitude = 1
Detail = -4.5
RefineSteps = 4
FudgeFactor = 0.6435868
MaxRaySteps = 2622
MaxDistance = 20
Dither = 0
NormalBackStep = 1
DetailAO = -0.2284069
coneApertureAO = 0.5
maxIterAO = 62
FudgeAO = 1
AO_ambient = 1
AO_camlight = 1
AO_pointlight = 1
AoCorrect = 0
Specular = 0.052459
SpecularExp = 3.389831
CamLight = 1,0.9529412,0.8941177,0.1318182
AmbiantLight = 0.5490196,0.8823529,1,0.1020882
Reflection = 0.3490196,0.3490196,0.3490196
ReflectionsNumber = 1
SpotGlow = true
SpotLight = 1,0.9568627,0.8784314,1.618161
LightPos = 2.466368,1.121076,-1.569507
LightSize = 0
LightFallOff = 0.1127396
LightGlowRad = 0
LightGlowExp = 0
HardShadow = 1
ShadowSoft = 1.731207
ShadowBlur = 0.010158
perf = true
SSS = false
sss1 = 0
sss2 = 0.0010858
BaseColor = 1,1,1
OrbitStrength = 0.8829365
X = 0.003921569,0.1372549,1,1
Y = 0.972549,0.3215686,0.01568628,1
Z = 1,0.9686275,0,1
R = 0.7960784,0.5019608,0.3098039,1
BackgroundColor = 0.1490196,0.2392157,0.1411765
GradientBackground = 0.3261
CycleColors = true
Cycles = 3.40895
EnableFloor = false
FloorNormal = 0,0,0
FloorHeight = 0
FloorColor = 1,1,1
HF_Fallof = 2.257799
HF_Const = 0
HF_Intensity = 0.1386364
HF_Dir = 0,0,1
HF_Offset = -1.54195
HF_Color = 0.4627451,0.6196079,0.6745098,0.6062356
HF_Scatter = 1.938775
HF_Anisotropy = 0.9960784,0.3843137,0.007843138
HF_FogIter = 3
HF_CastShadow = true
EnCloudsDir = true
CloudDir = -0.8271845,0.6737864,-0.2427184
CloudScale = 1
CloudFlatness = -0.0867398
CloudTops = 2.040816
CloudBase = 0.0680272
CloudDensity = 1
CloudRoughness = 1.645875
CloudContrast = 6.526526
CloudColor = 0.65,0.68,0.7
CloudColor2 = 0.07,0.17,0.24
SunLightColor = 0.7,0.5,0.3
Cloudvar1 = 2
Cloudvar2 = 9.334641
CloudIter = 3
CloudBgMix = 1
WindDir = 0,0,1
WindSpeed = 1
Iterations = 12
ColorIterations = 8
Power = 3.92053
Bailout = 7.765487
AlternateVersion = true
RotVector = 1,1,1
RotAngle = 138.5553
Julia = true
JuliaC = 0.9274725,-1.010989,-0.2945055
InvertC = -1.170921,0.1165372,-0.0610433
#endpreset


Last modified by: Sabine62 December 18, 2018, 01:41:26 PM
gerson
Fractal Friar
*
Offline Offline

Posts: 140



View Profile
December 18, 2018, 04:37:59 PM
I 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.frag
Including file: C:/temp/Fragmentarium-2.0.0-180102/Examples/Include/MathUtils.frag
Including file: C:/temp/Fragmentarium-2.0.0-180102/Examples/Include/DE-Kn2cr11.frag
Including file: C:/temp/Fragmentarium-2.0.0-180102/Examples/Include/3DKn-1.0.5.frag
Including buffershader: C:/temp/Fragmentarium-2.0.0-180102/Examples/Include/BufferShader-1.0.1.frag
Parse: C:/temp/Fragmentarium-2.0.0-180102/Examples/Include/BufferShader-1.0.1.frag
Mandelbulb Distance Estimator
DE-RaytracerKn-0.9.12.frag: Original shader by syntopia. Modifications by knighty + Eiffie + ChrisJRodgers:
- Added multiple reflections
3DKn-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: EnableFloor
Camera: 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 RGBA32F
Maximum texture size: 16384x16384
Could 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 Frankfurter
*
Offline Offline

Posts: 619


It's just a jump to the left...


View Profile WWW
December 18, 2018, 09:02:09 PM
Too 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=4
Maybe 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 Frogurt
******
Offline Offline

Posts: 492



View Profile
December 20, 2018, 08:58:45 AM
I have trouble with rand, i think when using  pre-fragM V2.5 files in  V2.5
I go to example and open the historic mandelbulb.fract  and paste in my old code after the # includes.

The following compiles and works for me



Code: [Select]
#info Mandelbulb Distance Estimator
#define providesInit

#include "MathUtils.frag"
#include "DE-Raytracer.frag"


#group Mandelbulb
uniform 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 radius
uniform float Bailout; slider[0,5,30]

// Alternate is slightly different, but looks more like a Mandelbrot for Power=2
uniform 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=2
void 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 Default
FOV = 0.62536
Eye = 2.36954,0.2323344,-0.5576415
Target = -6.25064,-0.6224971,1.310623
Up = -0.2169631,0.0713181,-0.9684369
EquiRectangular = false
FocalPlane = 1.478633
Aperture = 0.121802
InFocusAWidth = 1
DofCorrect = true
ApertureNbrSides = 7
ApertureRot = 0
ApStarShaped = true
Gamma = 2
ToneMapping = 5
Exposure = 1
Brightness = 1
Contrast = 1
Saturation = 1
GaussianWeight = 2
AntiAliasScale = 1
Bloom = true
BloomIntensity = 0.7324914
BloomPow = 2.195946
BloomTaps = 46
BloomStrong = 1
DepthToAlpha = false
ShowDepth = false
DepthMagnitude = 1
Detail = -4.5
RefineSteps = 4
FudgeFactor = 0.6435868
MaxRaySteps = 2622
MaxDistance = 20
Dither = 0
NormalBackStep = 1
DetailAO = -0.2284069
coneApertureAO = 0.5
maxIterAO = 62
FudgeAO = 1
AO_ambient = 1
AO_camlight = 1
AO_pointlight = 1
AoCorrect = 0
Specular = 0.052459
SpecularExp = 3.389831
CamLight = 1,0.9529412,0.8941177,0.1318182
AmbiantLight = 0.5490196,0.8823529,1,0.1020882
Reflection = 0.3490196,0.3490196,0.3490196
ReflectionsNumber = 1
SpotGlow = true
SpotLight = 1,0.9568627,0.8784314,1.618161
LightPos = 2.466368,1.121076,-1.569507
LightSize = 0
LightFallOff = 0.1127396
LightGlowRad = 0
LightGlowExp = 0
HardShadow = 1
ShadowSoft = 1.731207
ShadowBlur = 0.010158
perf = true
SSS = false
sss1 = 0
sss2 = 0.0010858
BaseColor = 1,1,1
OrbitStrength = 0.8829365
X = 0.003921569,0.1372549,1,1
Y = 0.972549,0.3215686,0.01568628,1
Z = 1,0.9686275,0,1
R = 0.7960784,0.5019608,0.3098039,1
BackgroundColor = 0.1490196,0.2392157,0.1411765
GradientBackground = 0.3261
CycleColors = true
Cycles = 3.40895
EnableFloor = false
FloorNormal = 0,0,0
FloorHeight = 0
FloorColor = 1,1,1
HF_Fallof = 2.257799
HF_Const = 0
HF_Intensity = 0.1386364
HF_Dir = 0,0,1
HF_Offset = -1.54195
HF_Color = 0.4627451,0.6196079,0.6745098,0.6062356
HF_Scatter = 1.938775
HF_Anisotropy = 0.9960784,0.3843137,0.007843138
HF_FogIter = 3
HF_CastShadow = true
EnCloudsDir = true
CloudDir = -0.8271845,0.6737864,-0.2427184
CloudScale = 1
CloudFlatness = -0.0867398
CloudTops = 2.040816
CloudBase = 0.0680272
CloudDensity = 1
CloudRoughness = 1.645875
CloudContrast = 6.526526
CloudColor = 0.65,0.68,0.7
CloudColor2 = 0.07,0.17,0.24
SunLightColor = 0.7,0.5,0.3
Cloudvar1 = 2
Cloudvar2 = 9.334641
CloudIter = 3
CloudBgMix = 1
WindDir = 0,0,1
WindSpeed = 1
Iterations = 12
ColorIterations = 8
Power = 3.92053
Bailout = 7.765487
AlternateVersion = true
RotVector = 1,1,1
RotAngle = 138.5553
Julia = true
JuliaC = 0.9274725,-1.010989,-0.2945055
InvertC = -1.170921,0.1165372,-0.0610433
#endpreset
knighty
Fractal Feline
**
Offline Offline

Posts: 185


View Profile
December 20, 2018, 11:05:16 AM
:thumbs: :thumbs: :thumbs:
Sabine62
Fractal Frankfurter
*
Offline Offline

Posts: 619


It's just a jump to the left...


View Profile WWW
December 20, 2018, 11:32:36 AM
Thank 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  ;D)  
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  :embarrass:

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 Frankfurter
*
Offline Offline

Posts: 619


It's just a jump to the left...


View Profile WWW
December 20, 2018, 09:33:03 PM
Thank you knighty (in case those thumbs-up were meant for the image ;) )  :)
timemit
Fractal Friar
*
Offline Offline

Posts: 131



View Profile WWW
December 25, 2018, 03:22:49 PM
Lovely little weirdo : )
Sabine62
Fractal Frankfurter
*
Offline Offline

Posts: 619


It's just a jump to the left...


View Profile WWW
December 27, 2018, 11:07:03 AM
Thanks, Tim! :)

Return to Gallery


Powered by SMF Gallery Pro