-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjulia_frag.glsl
56 lines (45 loc) · 1006 Bytes
/
julia_frag.glsl
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
#version 330 core
#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif
precision mediump int;
in vec2 pos;
out vec4 FragColor;
uniform vec2 C;
uniform float R;
uniform float max_steps;
uniform vec4 max_color;
uniform vec4 min_color;
float cosh(float val){
float tmp = exp(val);
float cosH = (tmp + 1.0 / tmp) / 2.0;
return cosH;
}
float sinh(float val)
{
float tmp = exp(val);
float sinH = (tmp - 1.0 / tmp) / 2.0;
return sinH;
}
void main(){
vec4 base_color = vec4(0.0f, 0.0f, 0.0f, 1.0f);
FragColor = base_color;
float diff = 0.0f;
float u;
float v;
float w_r = pos.x;
float w_i = pos.y;
float c_r = C.x;
float c_i = C.y;
for(int i = 0; i < max_steps; i++){
u = w_r;
v = w_i;
%%%%%
if (w_r*w_r + w_i*w_i > (R*R)){
FragColor = mix(min_color, max_color, (1.0f/max_steps) * i);
break;
}
}
}