DE is still somewhat problematic, gone for linear now.

`#info Riemann - darkbeam's version of msltoe's: http://www.fractalforums.com/the-3d-mandelbulb/riemann-fractals/msg33500/#msg33500`

#info link to msltoe's original: http://www.fractalforums.com/new-theories-and-research/another-way-to-make-my-riemann-sphere-'bulb'-using-a-conformal-transformation/

#include "MathUtils.frag"

//#include "DE-Raytracer.frag"

//#define USE_IQ_CLOUDS

#define KN_VOLUMETRIC

#define USE_EIFFIE_SHADOW

#define MULTI_SAMPLE_AO

#include "DE-Kn2cr11.frag"

#group Riemann

uniform float scale; slider[-30,0,30]

uniform float b; slider[-30,0,30]

uniform float c; slider[-30,1,30]

uniform int imax; slider[0,9,100]

uniform int ColorIterations; slider[0,3,100]

uniform float ssh; slider[-30,0,30]

uniform float tsh; slider[-30,0,30]

uniform float rp; slider[-30,1,30]

uniform vec3 sh; slider[(-20,-20,-20),(0,0,0),(20,20,20)]

uniform float DEOffset; slider[-2,0,2]

float DE(vec3 pos) {

vec3 z=pos;

float r;

float dr=1.0;

int i=0;

float norm=0.;

int iter=1;

float pi =22.0/7.0;

while ((norm<8 )&&(iter<imax)) {

//(rotate xyz)

r=scale/sqrt(dot(z,z));

z.x=z.x/r;

z.y=z.y/r;

z.z=z.z/r;

r=abs(r);

float s = z.z/(1.0-z.x);

float t = z.y/(1.0-z.x);

float w=1.0+s*s+t*t;

s=abs(sin(pi*s+ssh));

t=abs(sin(pi*t+tsh));

dr = pow( r, w-1.0)*w*dr + 1.0;

r=-0.25+pow(r,rp*w);

w=2/(1+s*s+t*t); // It pretends rp=-2 and not +2, why? I've found the answer, since I use 1/r instead of r cheesy

// originally; w=1+s*s+t*t;z=r*2*s/w;y=r*2*t/w;

// x=r*(-1+s*s+t*t)/w=r*(1-2/w); optimized & subst...

z.x=r*(1.0-w);

z.y=r*t*w;

z.z=r*s*w;

z+=sh;

norm = dot(z,z);

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

iter++;

}

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

return (r-DEOffset)/abs(dr); //linear DE

}

#preset Default

FOV = 0.2743972

Eye = 0.5199772,-0.3772395,-11.23907

Target = 0.1376391,-0.0478597,-2.391812

Up = -0.9939773,-0.0159249,-0.0423623

EquiRectangular = false

FocalPlane = 8.878717

Aperture = 0.085044

InFocusAWidth = 0.5223881

DofCorrect = true

ApertureNbrSides = 7

ApertureRot = 0

ApStarShaped = false

Gamma = 1

ToneMapping = 5

Exposure = 0.6522

Brightness = 1

Contrast = 1

Saturation = 1

GaussianWeight = 1

AntiAliasScale = 2.5

Bloom = false

BloomIntensity = 0

BloomPow = 2

BloomTaps = 4

BloomStrong = 1

DepthToAlpha = false

ShowDepth = false

DepthMagnitude = 1

Detail = -2.5

RefineSteps = 4

FudgeFactor = 0.0160047

MaxRaySteps = 5000

MaxDistance = 67.10605

Dither = 0

NormalBackStep = 1

DetailAO = -0.1765276

coneApertureAO = 0.1933373

maxIterAO = 46

FudgeAO = 0.9405941

AO_ambient = 0.935167

AO_camlight = 1.616921

AO_pointlight = 1.559222

AoCorrect = 0.3280794

Specular = 0.5907336

SpecularExp = 16.364

CamLight = 1,0.9058824,0.8078431,1.364176

AmbiantLight = 1,1,1,0.8057554

Reflection = 0.8862745,0.7764706,0.6666667

ReflectionsNumber = 1

SpotGlow = true

SpotLight = 1,0.9098039,0.7529412,10

LightPos = -2.850412,-0.0706714,-4.09894

LightSize = 0.0023447

LightFallOff = 0.1686508

LightGlowRad = 1.004159

LightGlowExp = 1.166865

HardShadow = 0.7700059

ShadowSoft = 1.793349

ShadowBlur = 0

perf = false

SSS = false

sss1 = 0.1

sss2 = 0.5

BaseColor = 1,1,1

OrbitStrength = 0.3891509

X = 1,1,1,1

Y = 0.345098,0.666667,0,1

Z = 1,0.666667,0,1

R = 0.2470588,0.3176471,0.1764706,1

BackgroundColor = 0.4627451,0.7686275,0.9960784

GradientBackground = 1.231231

CycleColors = true

Cycles = 0.1

EnableFloor = true NotLocked

FloorNormal = 1,0,0

FloorHeight = 2.445684

FloorColor = 1,0.4039216,0.003921569

HF_Fallof = 0.2118705

HF_Const = 0

HF_Intensity = 0

HF_Dir = 0,0,1

HF_Offset = -9.111374

HF_Color = 0.6196079,0.8156863,1,3

HF_Scatter = 0

HF_Anisotropy = 0.509804,0.254902,0

HF_FogIter = 1

HF_CastShadow = false

EnCloudsDir = false

CloudDir = 0,0,1

CloudScale = 1

CloudFlatness = 0

CloudTops = 1

CloudBase = -1

CloudDensity = 1

CloudRoughness = 1

CloudContrast = 1

CloudColor = 0.65,0.68,0.7

CloudColor2 = 0.07,0.17,0.24

SunLightColor = 0.7,0.5,0.3

Cloudvar1 = 0.99

Cloudvar2 = 1

CloudIter = 5

CloudBgMix = 1

WindDir = 0,0,1

WindSpeed = 1

scale = 3

b = 0

c = 1

imax = 33

ColorIterations = 9

ssh = 0

tsh = 0

rp = 1.997704

sh = 0,0,0

DEOffset = 0

#endpreset