first
This commit is contained in:
commit
b97b3a9ae4
79 changed files with 1729 additions and 0 deletions
26
exo1/shaders/exo1_tableaux/1uv_painting_example.gdshader
Normal file
26
exo1/shaders/exo1_tableaux/1uv_painting_example.gdshader
Normal file
|
@ -0,0 +1,26 @@
|
|||
shader_type canvas_item;
|
||||
|
||||
// Un peu de lecture au debut, mais c'est important !
|
||||
// J'ai fait au plus court pour vous bande de tiktok kids
|
||||
// Mais c'est important et y'a que ca a lire
|
||||
|
||||
void fragment() {
|
||||
|
||||
// La fonction fragment() est appele pour chaque pixel du tableau a chaque frame
|
||||
// Donc ici environ 28980 fois chaque frame, mais le GPU gere sans soucis !
|
||||
// En input hidden, on a une variable global UV
|
||||
// UV est un vecteur (x, y) avec x et y entre 0 et 1
|
||||
// UV represente la position normalized du pixel
|
||||
// (0, 0) c'est en haut a gauche et (1, 1) en bas a droite
|
||||
|
||||
COLOR.rgb = vec3(UV, 0);
|
||||
|
||||
// COLOR est une variable global, c'est un input et un output
|
||||
// C'est la color du pixel qu'on traite
|
||||
// Ici on dit que la couleur : red = UV.x et green = UV.y et blue a 0
|
||||
// Et on voit que en haut a gauche c'est noir, et en bas a droite c'est jaune (red + green)
|
||||
|
||||
// TODO
|
||||
// Fait des petites modifs de la seule ligne de ce programme pour voir ce que ca fait
|
||||
// Mettre blue a 1 ou faire des modifs sur UV etc... testez des trucs !
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
uid://bqkbm7kxjbvbl
|
9
exo1/shaders/exo1_tableaux/2diagonale.gdshader
Normal file
9
exo1/shaders/exo1_tableaux/2diagonale.gdshader
Normal file
|
@ -0,0 +1,9 @@
|
|||
shader_type canvas_item;
|
||||
|
||||
void fragment() {
|
||||
// Called for every pixel the material is visible on.
|
||||
// Deux trucs a utiliser : UV et COLOR
|
||||
// N'hesite pas a poser des questions (sur la syntaxe de glsl par exemple)
|
||||
|
||||
COLOR.rgb = vec3(0, 1, 0);
|
||||
}
|
1
exo1/shaders/exo1_tableaux/2diagonale.gdshader.uid
Normal file
1
exo1/shaders/exo1_tableaux/2diagonale.gdshader.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://u4ti6qojfd6n
|
12
exo1/shaders/exo1_tableaux/3circle.gdshader
Normal file
12
exo1/shaders/exo1_tableaux/3circle.gdshader
Normal file
|
@ -0,0 +1,12 @@
|
|||
shader_type canvas_item;
|
||||
|
||||
|
||||
void fragment() {
|
||||
// La fonction length renvoie la longeur d'un vec2, vec3 ou vec4
|
||||
// la syntaxe c'est length(ton vecteur)
|
||||
// ca donne plus une eclipse qu'un cercle
|
||||
// Pour avoir un cercle faudrait normaliser avec TEXTURE_PIXEL_SIZE
|
||||
// (qui donne la taille WIDTH et HEIGHT de notre canvas)
|
||||
COLOR.rgb = vec3(0, 1, 1);
|
||||
}
|
||||
|
1
exo1/shaders/exo1_tableaux/3circle.gdshader.uid
Normal file
1
exo1/shaders/exo1_tableaux/3circle.gdshader.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://tueskvsn60l0
|
10
exo1/shaders/exo1_tableaux/4uv_time.gdshader
Normal file
10
exo1/shaders/exo1_tableaux/4uv_time.gdshader
Normal file
|
@ -0,0 +1,10 @@
|
|||
shader_type canvas_item;
|
||||
|
||||
void fragment() {
|
||||
// TIME est une variable globale qui contient le temps depuis lequel godot tourne
|
||||
// sin, cos etc... sont super utilise avec TIME
|
||||
// car ca permet d'avoir des trucs periodiques
|
||||
COLOR.rgb = vec3(sin(UV.x + TIME), cos(UV.y + 2.0*TIME), sin(UV.x + UV.y + 3.0*TIME));
|
||||
// parfois sin et cos peuvent valoir moins de 0
|
||||
// Mais c'est pas grave c'
|
||||
}
|
1
exo1/shaders/exo1_tableaux/4uv_time.gdshader.uid
Normal file
1
exo1/shaders/exo1_tableaux/4uv_time.gdshader.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://uusggwbep2j4
|
5
exo1/shaders/exo1_tableaux/5circle_time.gdshader
Normal file
5
exo1/shaders/exo1_tableaux/5circle_time.gdshader
Normal file
|
@ -0,0 +1,5 @@
|
|||
shader_type canvas_item;
|
||||
|
||||
void fragment() {
|
||||
// Bon vous avez tout les outils en main, testez des trucs
|
||||
}
|
1
exo1/shaders/exo1_tableaux/5circle_time.gdshader.uid
Normal file
1
exo1/shaders/exo1_tableaux/5circle_time.gdshader.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://clc4aqodbhhv5
|
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
|
20
exo1/shaders/pastouche/ground.gdshader
Normal file
20
exo1/shaders/pastouche/ground.gdshader
Normal file
|
@ -0,0 +1,20 @@
|
|||
shader_type canvas_item;
|
||||
// ET OUI, MEME LE SOL C'EST UN SHADER
|
||||
// Petite shader juste pour faire un ptit effet de perspective tiled sur le sol
|
||||
// J'avais la flemme de faire des belles textures lol
|
||||
uniform float skew_amount = 0.5;
|
||||
|
||||
void vertex() {
|
||||
// Called for every vertex the material is visible on.
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
vec2 skewed_uv = UV;
|
||||
skewed_uv.x += (1.0 - UV.y) * skew_amount;
|
||||
COLOR = texture(TEXTURE, skewed_uv);
|
||||
}
|
||||
|
||||
//void light() {
|
||||
// // Called for every pixel for every light affecting the CanvasItem.
|
||||
// // Uncomment to replace the default light processing function with this one.
|
||||
//}
|
1
exo1/shaders/pastouche/ground.gdshader.uid
Normal file
1
exo1/shaders/pastouche/ground.gdshader.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://dvegch8bn85w4
|
Loading…
Add table
Add a link
Reference in a new issue