From b1f69d0539767ff70b46ba15a1079d192cf51bf8 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Fri, 12 May 2023 11:56:18 +0200 Subject: [PATCH] resolmve some issues --- shaders/credits.fs | 2 +- shaders/credits.vs | 4 ++-- shaders/manif.fs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/shaders/credits.fs b/shaders/credits.fs index 8ed5eae..a7e8fd5 100644 --- a/shaders/credits.fs +++ b/shaders/credits.fs @@ -5,5 +5,5 @@ out vec4 fragColor; void main(void) { vec4 c = texture(tex, vsoTexCoord); - fragColor = vec4(c.rgb, length(c.rgb) > 0.0 ? 1.0 : 0.0); + fragColor = vec4(c.rgb, length(c.rgb) > 0 ? 1 : 0); } diff --git a/shaders/credits.vs b/shaders/credits.vs index f0cf83c..6c6c0ac 100644 --- a/shaders/credits.vs +++ b/shaders/credits.vs @@ -7,9 +7,9 @@ uniform mat4 modview, proj; out vec2 vsoTexCoord; void main(void) { - gl_Position = proj * modview * vec4(vsiPosition, 1.0); + gl_Position = proj * modview * vec4(vsiPosition, 1); if(inv != 0) { - vsoTexCoord = vec2(vsiTexCoord.s, 1.0 - vsiTexCoord.t); + vsoTexCoord = vec2(vsiTexCoord.s, 1 - vsiTexCoord.t); } else { vsoTexCoord = vec2(vsiTexCoord.s, vsiTexCoord.t); } diff --git a/shaders/manif.fs b/shaders/manif.fs index 1f0cca6..aa485b0 100644 --- a/shaders/manif.fs +++ b/shaders/manif.fs @@ -14,9 +14,9 @@ void main() { const vec3 vue = vec3(0, 0, -1); const vec4 soleil_color = vec4(0.81f, 0.78f, 0.66f, 1.0f); vec3 torche = normalize(pos_model.xyz - lum_pos.xyz); - float intensite_lumineuse = clamp(dot(vec_normal, -torche), 0, 1); + 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); + float intensite_specularite = pow(clamp(dot(reflet, -vue), 0., 1.), 10); fragColor = intensite_specularite * lum_color + 0.1 * soleil_color + 0.9 * intensite_lumineuse * couleur; }