From f31b36f199ad6134bfa666701e59fbb00cb53be5 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sun, 21 May 2023 07:52:10 +0200 Subject: [PATCH] naming --- shaders/manif.fs | 8 ++++---- src/manif.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/shaders/manif.fs b/shaders/manif.fs index d782d1e..6ad4824 100644 --- a/shaders/manif.fs +++ b/shaders/manif.fs @@ -8,21 +8,21 @@ out vec4 fragColor; const int max = 20; // should change in cpu too uniform vec4 couleur; -uniform vec4 lum_pos[max]; +uniform vec4 lumPos[max]; uniform mat4 view; -uniform vec4 lum_color[max]; +uniform vec4 lumColor[max]; void main() { const vec3 vue = vec3(0, 0, -1); const vec4 soleil_color = vec4(0.81f, 0.78f, 0.66f, 1.0f); for(int i = 0; i < max; i++) { - vec3 torche = normalize(pos_model.xyz - lum_pos[i].xyz); + vec3 torche = normalize(pos_model.xyz - lumPos[i].xyz); float intensite_lumineuse = clamp(dot(vec_normal, -torche), 0., 1.); vec3 reflet = (transpose(inverse(view)) * vec4(reflect(torche, vec_normal), 0)).xyz; float intensite_specularite = pow(clamp(dot(reflet, -vue), 0., 1.), 10); - vec4 color = intensite_specularite * lum_color[i] + 0.1 * soleil_color + 0.9 * intensite_lumineuse * couleur; + vec4 color = intensite_specularite * lumColor[i] + 0.1 * soleil_color + 0.9 * intensite_lumineuse * couleur; if(i == 0) { fragColor = color; } else { diff --git a/src/manif.c b/src/manif.c index 5f20f2d..ffa33d5 100644 --- a/src/manif.c +++ b/src/manif.c @@ -172,8 +172,8 @@ static void draw(void) { /* On devrait donner HEROS_NUMBER mais pour éviter de ne plus rien voir avec * les lumières, on en donne que 20 */ - glUniform4fv(glGetUniformLocation(_pId, "lum_pos"), 20, (float *)lumpos); - glUniform4fv(glGetUniformLocation(_pId, "lum_color"), 20, (float *)lumcolor); + glUniform4fv(glGetUniformLocation(_pId, "lumPos"), 20, (float *)lumpos); + glUniform4fv(glGetUniformLocation(_pId, "lumColor"), 20, (float *)lumcolor); deplacement += (float)(0.4 * M_PI * dt); glUseProgram(0);