HOME | DD

C-JR — Metamorphose

Published: 2014-08-12 18:02:39 +0000 UTC; Views: 826; Favourites: 24; Downloads: 42
Redirect to original
Description done in Fragmentarium
render info: resolution 1920x1080, 700 subframes, used   knightyff.deviantart.com/art/W… modified DE-raytracer, QuaternionMandelbrot4D.frag, PseudoKleinian.frag, Koch01.frag

code:

#info Menger Distance Estimator.
#define providesInit
#include "DE-Raytracerkn-1.0.0.frag"
#include "MathUtils.frag"
#info 4D Quaternion Mandelbrot Distance Estimator
#define providesInit
#group 4D Quaternion Mandelbrot
uniform float Scale; slider[0.00,3,4.00]
uniform vec3 RotVector; slider[(0,0,0),(1,0,0),(1,1,1)]
uniform float RotAngle; slider[0.00,60,360]


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

uniform int Iterations1;  slider[0,16,100]
uniform int ColorIterations1;  slider[0,16,100]
uniform float Threshold1; slider[0,10,100]
uniform float cz1; slider[-2,0,2]

float DE3(vec3 pos) {
vec4 p = vec4(pos, cz1);
p.yzw*=rot;
vec4 dp = vec4(1.0, 0.0,0.0,0.0);
for (int i = 0; i < Iterations1; i++) {
dp = 2.0* vec4(p.x*dp.x-dot(p.yzw, dp.yzw), p.x*dp.yzw+dp.x*p.yzw+cross(p.yzw, dp.yzw));
p = vec4(p.x*p.x-dot(p.yzw, p.yzw), vec3(2.0*p.x*p.yzw)) +  vec4(pos, 0.0);
float p2 = dot(p,p);
if (i if (p2 > Threshold1) break;
}
float r = length(p);
return  0.5 * r * log(r) / length(dp);
}

float DE1(vec3 z)
{
float r;
int n = 0;
while (n < 1 && dot(z,z)<10000.0) {
z.xy = abs(z.xy);
if(z.y>z.x) z.xy=z.yx;
z.y=-abs(z.y);
z.x+=1./3.;if(z.z>z.x) z.xz=z.zx; z.x-=1./3.;
z.x-=1./3.;if(z.z>z.x) z.xz=z.zx; z.x+=1./3.;
//z = rot *z;
z=Scale* (z);
z = rot *z;

r = dot(z, z);
if (n<1) orbitTrap = min(orbitTrap, abs(vec4(z,r)));

n++;
}
return abs(length(z)) * pow(Scale, float(-n));
}
#info Theli-at's Pseudo Kleinian (Scale 1 JuliaBox + Something (here a Menger Sponge)).
#group PseudoKleinian
#define USE_INF_NORM
uniform int MI; slider[0,5,20]
uniform float Size; slider[0,1,2]
uniform vec3 CSize; slider[(0,0,0),(1,1,1),(2,2,2)]
uniform vec3 C; slider[(-2,-2,-2),(0,0,0),(2,2,2)]
uniform float DEoffset; slider[0,0,0.01]
uniform vec3 Offset; slider[(-2,-2,-2),(0,0,0),(2,2,2)]
uniform int MnIterations;  slider[0,2,20]
uniform int ColorIterations;  slider[0,2,20]
uniform float MnScale; slider[0.00,3.0,4.00]
uniform vec3 MnOffset; slider[(0,0,0),(1,1,1),(2,2,2)]

float Menger(vec3 z)
{
float r;

int n = 0;
z = abs(z);
if (z.x if (z.x if (z.y if (z.z<1./3.){ z.z -=2.*( z.z-1./3.);}

while (n < MnIterations && dot(z,z)<100.0) {

z=MnScale* (z-MnOffset)+MnOffset;

z = abs(z);
if (z.x if (z.x< z.z){ z.xz = z.zx;}
if (z.y if (z.z<1./3.*MnOffset.z){ z.z -=2.*( z.z-1./3.*MnOffset.z);}

r = dot(z-MnOffset, z-MnOffset);

n++;
}

return float(z.x-MnOffset) * pow(MnScale, float(-n));
}

float Thing2(vec3 p){
#ifdef USE_INF_NORM  
vec3 p1=abs(p);
float r2=max(p1.x,max(p1.y,p1.z));
#else
float r2=dot(p,p);
#endif
float DEfactor=1.;
 
for(int i=0;i p=2.*clamp(p, -CSize, CSize)-p;
     
r2=dot(p,p);
float k=max(Size/r2,1.);
p*=k;DEfactor*=k;
     
p+=C;
#ifdef USE_INF_NORM  
p1=abs(p);
r2=max(p1.x,max(p1.y,p1.z));
#else
r2=dot(p,p);
#endif
if (i < ColorIterations) orbitTrap = min(orbitTrap, abs(vec4(p,r2)));
}
return abs(0.5*Menger(p-Offset)/DEfactor-DEoffset);
}

float DE(vec3 pos){
return  min(DE1(pos),Thing2(pos))*DE3(pos);
}

#preset default
FOV = 0.43698
Eye = 1.07416,0.0446494,-2.49888
Target = -1.23624,-1.12276,7.32203
FocalPlane = 1.46067
Aperture = 0.20312
InFocusAWidth = 1
ApertureNbrSides = 6
ApertureRot = 0
ApStarShaped = false
Gamma = 1.10575
ToneMapping = 5
Exposure = 3
Brightness = 1.2
Contrast = 1.85565
Saturation = 1
GaussianWeight = 1
AntiAliasScale = 2
Detail = -4.2
DetailAO = -0.07448
FudgeFactor = 1
MaxRaySteps = 2000
Dither = 1
NormalBackStep = 1
AO = 0,0,0,0.95745
Specular = 0
SpecularExp = 7.355
SpecularMax = 100
SpotLight = 0.403922,0.992157,1,11
SpotLightDir = 0.5065,0.45454
CamLight = 1,0.407843,0.258824,1.66154
CamLightMin = 0.13924
Glow = 1,1,1,0
GlowMax = 20
Fog = 0.38016
HardShadow = 0.89744
ShadowSoft = 1.6
Reflection = 0
ReflectionsNumber = 0
DebugSun = false
BaseColor = 1,1,1
OrbitStrength = 0.47945
X = 0.5,0.6,0.6,1
Y = 1,0.6,0,1
Z = 0.8,0.78,1,1
R = 0.4,0.7,1,0.2653
BackgroundColor = 0.0823529,0.478431,0.647059
GradientBackground = 0.7143
CycleColors = true
Cycles = 1.047
EnableFloor = true
FloorNormal = 0.71794,0,-0.0002
FloorHeight = -4.375
FloorColor = 0,1,1
Scale = 2.91228
RotVector = 1,1,1
RotAngle = 180
Iterations1 = 100
ColorIterations1 = 3
Threshold1 = 100
cz1 = 0
MI = 20
Size = 1.25
CSize = 2,0.0645,0.90266
C = 0.05852,-1.03124,2
DEoffset = 0
Offset = 0.03848,0.28832,-0.3846
MnIterations = 16
ColorIterations = 2
MnScale = 3.08
MnOffset = 1.982,1.61702,1.6383
Up = 0.805447,0.214596,0.207106
#endpreset
Related content
Comments: 16

timemit [2014-08-24 18:33:40 +0000 UTC]

great stuff

👍: 0 ⏩: 1

C-JR In reply to timemit [2014-08-24 21:03:10 +0000 UTC]

are you tried to repeat this?

👍: 0 ⏩: 0

kirashik [2014-08-13 18:54:38 +0000 UTC]

Цвета просто невероятные!

👍: 0 ⏩: 1

C-JR In reply to kirashik [2014-08-15 11:34:22 +0000 UTC]

Спасибо )  

👍: 0 ⏩: 0

Kondratij [2014-08-13 11:59:33 +0000 UTC]

Супер.

👍: 0 ⏩: 1

C-JR In reply to Kondratij [2014-08-15 11:33:28 +0000 UTC]

Спасибо!

👍: 0 ⏩: 0

KPEKEP [2014-08-13 11:33:48 +0000 UTC]

Класс

👍: 0 ⏩: 1

C-JR In reply to KPEKEP [2014-08-15 11:33:18 +0000 UTC]

Спасиб ) попробуй код, покрути

👍: 0 ⏩: 0

batjorge [2014-08-12 23:53:27 +0000 UTC]

Great picture!

👍: 0 ⏩: 1

C-JR In reply to batjorge [2014-08-15 11:32:47 +0000 UTC]

 Thank you very much! 

👍: 0 ⏩: 0

poca2hontas [2014-08-12 21:10:12 +0000 UTC]

Excellent!

👍: 0 ⏩: 1

C-JR In reply to poca2hontas [2014-08-15 11:32:36 +0000 UTC]

Thank you! )

👍: 0 ⏩: 0

Swoopswatkill [2014-08-12 19:02:03 +0000 UTC]

I had been wondering for some time how to put different ".frag" formulas together. Thanks for sharing parameters!

👍: 0 ⏩: 1

C-JR In reply to Swoopswatkill [2014-08-12 19:44:22 +0000 UTC]

here another scripts crist-jroger.deviantart.com/ar…

👍: 0 ⏩: 1

Swoopswatkill In reply to C-JR [2014-08-12 19:46:41 +0000 UTC]

Thanks, man!

👍: 0 ⏩: 1

C-JR In reply to Swoopswatkill [2014-08-12 20:13:49 +0000 UTC]

welcome!

👍: 0 ⏩: 0