first
This commit is contained in:
commit
b97b3a9ae4
79 changed files with 1729 additions and 0 deletions
33
exo1/shaders/exo1_zexemples_jolies/mandelbrot.gdshader
Normal file
33
exo1/shaders/exo1_zexemples_jolies/mandelbrot.gdshader
Normal file
|
@ -0,0 +1,33 @@
|
|||
shader_type canvas_item;
|
||||
|
||||
const int max_itter = 256;
|
||||
|
||||
const vec2 zoom_center = vec2(-0.74364388703, 0.13182590421);
|
||||
|
||||
int get_mandelbrot_count(vec2 uv, float zoom_factor){
|
||||
vec2 scaled_uv = (uv - vec2(0.5)) * 4.0 * zoom_factor + zoom_center;
|
||||
float c_re = scaled_uv.x;
|
||||
float c_im = scaled_uv.y;
|
||||
|
||||
float re = 0.0;
|
||||
float im = 0.0;
|
||||
|
||||
for (int i = 0; i < max_itter; i++){
|
||||
float t_re = re;
|
||||
re = re*re - im*im + c_re;
|
||||
im = 2.0*im*t_re + c_im;
|
||||
if (re*re + im*im > 4.0){
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void fragment() {
|
||||
float smooth_sine = (sin(TIME) * 0.5 + 0.5);
|
||||
float zoom_factor = mix(0.001, 1.0, smoothstep(0.0, 1.0, smooth_sine));
|
||||
int mandelbrot_count = get_mandelbrot_count(UV, zoom_factor);
|
||||
float m_cn = float(mandelbrot_count) / float(max_itter);
|
||||
COLOR.rgb = vec3(m_cn, m_cn*2.0, m_cn*3.0);
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
uid://d0n6gjxkt6okq
|
8
exo1/shaders/exo1_zexemples_jolies/plasma.gdshader
Normal file
8
exo1/shaders/exo1_zexemples_jolies/plasma.gdshader
Normal file
|
@ -0,0 +1,8 @@
|
|||
shader_type canvas_item;
|
||||
|
||||
void fragment() {
|
||||
vec2 uv = UV;
|
||||
float v = sin(uv.x * 10.0 + TIME) + sin(uv.y * 10.0 + TIME) + sin((uv.x + uv.y) * 10.0 + TIME);
|
||||
float c = (sin(v) + 1.0) / 2.0;
|
||||
COLOR = vec4(vec3(c, c * 0.5, 1.0 - c), 1.0);
|
||||
}
|
1
exo1/shaders/exo1_zexemples_jolies/plasma.gdshader.uid
Normal file
1
exo1/shaders/exo1_zexemples_jolies/plasma.gdshader.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://03ee6p7b6pnn
|
6
exo1/shaders/exo1_zexemples_jolies/zolie_user.gdshader
Normal file
6
exo1/shaders/exo1_zexemples_jolies/zolie_user.gdshader
Normal file
|
@ -0,0 +1,6 @@
|
|||
shader_type canvas_item;
|
||||
|
||||
void fragment() {
|
||||
// Called for every pixel the material is visible on.
|
||||
COLOR.br = UV;
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
uid://sl1g7w1jmk6x
|
7
exo1/shaders/exo1_zexemples_jolies/zolie_user2.gdshader
Normal file
7
exo1/shaders/exo1_zexemples_jolies/zolie_user2.gdshader
Normal file
|
@ -0,0 +1,7 @@
|
|||
shader_type canvas_item;
|
||||
|
||||
void fragment() {
|
||||
// Called for every pixel the material is visible on.
|
||||
COLOR.gr = UV;
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
uid://bjw6mgbjij8fc
|
Loading…
Add table
Add a link
Reference in a new issue