-
Notifications
You must be signed in to change notification settings - Fork 1
/
msltoe riemann_DeltaDE.frag
213 lines (193 loc) · 5.18 KB
/
msltoe riemann_DeltaDE.frag
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
// example by sabine
// Output generated from file: D:/fractal/Fragmentarium/Output/Sabine/riemann/riemannDeltaDE/mclarekin_riemann_DeltaDE.frag
// Created: Thu Nov 15 18:02:49 2018
// riemann spheres are slow and difficult to render well!!
#info Link to msltoes original Riemann-version: http://www.fractalforums.com/new-theories-and-research/another-way-to-make-my-riemann-sphere-'bulb'-using-a-conformal-transformation/
#info This version ported by mclarekin https://fractalforums.org/fragmentarium/17/attempting-to-port-riemann-to-fragmentarium/2263/msg10907#msg10907
#info DeltaDE by buddhi
#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"
//#include "DE-Raytracer.frag"
#define M_PI 3.1415926535897932384626433832795
#group Riemann
uniform int imax; slider[0,9,100]
uniform float Bailout; slider[0,5,10]
uniform int ColorIterations; slider[0,3,100]
uniform float scale; slider[0,1,3]
uniform float ssh; slider[-7,0,7]
uniform float tsh; slider[-7,0,7]
uniform vec3 shift; slider[(-20,-20,-20),(0,0,0),(20,20,20)]
uniform float DEScale; slider[-2,0,2]
vec3 DE1(vec3 pos) {
vec3 z=pos;
float r = length(z);
int i=0;
float rr=0.0;
int iter=1;
float pi = M_PI;
while ((rr<Bailout )&&(iter<imax)) {
// rot
// if (r < 1e-21) r = 1e-21;
z *= scale / r;
float q = 1.0 / (1.0 - z.z);
float s = z.x * q;
float t = z.y * q;
float p = 1.0 + s * s + t * t;
s = abs(sin(M_PI * s + ssh));
t = abs(sin(M_PI * t + tsh));
r *= r;
r = -0.25 + pow(r, p);
z.x = 2.0 * s;
z.y = 2.0 * t;
z.z = -1.0 + s * s + t * t;
z *= r / (1.0 + s * s + t * t);
z += shift;
rr = dot(z,z);
r = sqrt(rr);
if (iter<ColorIterations) orbitTrap = min(orbitTrap, abs(vec4(z.x,z.y,z.z,rr)));
iter++;
}
return z;
}
float DE(vec3 p) {
vec3 z=p;
float deltavalue = max(length(z) * 0.000001, DEScale * 0.1);
vec3 deltaX = vec3 (deltavalue, 0.0, 0.0);
vec3 deltaY = vec3 (0.0, deltavalue, 0.0);
vec3 deltaZ = vec3 (0.0, 0.0, deltavalue);
vec3 zCenter = DE1(z);
float r = length(zCenter);
vec3 d;
vec3 zx1 = DE1(z + deltaX);
vec3 zx2 = DE1(z - deltaX);
d.x = min(abs(length(zx1) - r), abs(length(zx2) - r)) / deltavalue;
vec3 zy1 = DE1(z + deltaY);
vec3 zy2 = DE1(z - deltaY);
d.y = min(abs(length(zy1) - r), abs(length(zy2) - r)) / deltavalue;
vec3 zz1 = DE1(z + deltaZ);
vec3 zz2 = DE1(z - deltaZ);
d.z = min(abs(length(zz1) - r), abs(length(zz2) - r)) / deltavalue;
float dr = length(d);
return 0.5 * (r) * log(r)/(dr); //logarythmic DeltaDE
//return 0.5 * (r-DEOffset)/abs(dr); //linear DeltaDE
}
#preset Default
FOV = 0.3157895
Eye = 0.0170859,-5.997446,0.0556834
Target = -0.2070382,4.962074,-0.8601221
Up = 0,0,-0.9959208
EquiRectangular = false
FocalPlane = 3.705299
Aperture = 0.0146628
InFocusAWidth = 1
DofCorrect = true
ApertureNbrSides = 7
ApertureRot = 0
ApStarShaped = false
Gamma = 1
ToneMapping = 5
Exposure = 0.6522
Brightness = 1
Contrast = 1
Saturation = 1
GaussianWeight = 1
AntiAliasScale = 0.5
Bloom = false
BloomIntensity = 0
BloomPow = 2
BloomTaps = 4
BloomStrong = 1
DepthToAlpha = false
ShowDepth = false
DepthMagnitude = 1
Detail = -2.5
RefineSteps = 4
FudgeFactor = 0.0296384
MaxDistance = 67.10605
Dither = 1
NormalBackStep = 10
DetailAO = -0.1765276
coneApertureAO = 0.1933373
maxIterAO = 46
FudgeAO = 0.9405941
AO_ambient = 0.935167
AO_camlight = 1.069813
AO_pointlight = 1.189723
AoCorrect = 0.3280794
Specular = 0.5907336
SpecularExp = 16.364
CamLight = 1,0.8078431,0.5843138,1.549229
AmbiantLight = 0.7098039,0.8666667,1,1.233813
Reflection = 0.9882353,0.8705882,0.7529412
ReflectionsNumber = 3
SpotGlow = true
SpotLight = 1,0.9098039,0.7529412,4.066066
LightPos = -0.8244994,-1.861013,-2.096584
LightSize = 0
LightFallOff = 0.1686508
LightGlowRad = 0
LightGlowExp = 0.5730404
HardShadow = 0.99
ShadowSoft = 0
ShadowBlur = 0
perf = false
SSS = false
sss1 = 0.1
sss2 = 0.5
BaseColor = 1,0.7372549,0.6117647
OrbitStrength = 1
X = 1,1,1,1
Y = 0.345098,0.666667,0,0.1186047
Z = 1,0.666667,0,1
R = 0.2470588,0.3176471,0.1764706,0.8836533
BackgroundColor = 0.1137255,0.1921569,0.2470588
GradientBackground = 1.231231
CycleColors = true
Cycles = 2.825333
EnableFloor = true NotLocked
FloorNormal = 0,0,1
FloorHeight = 1.024662
FloorColor = 0.3803922,0.3254902,0.282353
HF_Fallof = 0.2118705
HF_Const = 0
HF_Intensity = 0
HF_Dir = 0,0,1
HF_Offset = -9.111374
HF_Color = 0.7764706,0.8470588,1,3
HF_Scatter = 0
HF_Anisotropy = 0,0,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
imax = 18
ColorIterations = 9
scale = 1
ssh = 0
tsh = 0
shift = -0.1964182,-0.5430387,0.774119
DEScale = 2
Bailout = 8
MaxRaySteps = 5000
#endpreset