From 146df2d02940a04aeafe854bdd981a1489cc80b3 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 23 Jun 2020 17:01:53 +0300 Subject: [PATCH] Naming tweaks in builtin shaders --- shaderlib/common.glsl | 4 ++-- shaderlib/msp_interface.glsl | 2 +- shaderlib/phong.glsl | 2 +- shaderlib/singlepass.glsl | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/shaderlib/common.glsl b/shaderlib/common.glsl index 7222b00f..05648e4c 100644 --- a/shaderlib/common.glsl +++ b/shaderlib/common.glsl @@ -65,7 +65,7 @@ void main() } #pragma MSP stage(fragment) -vec3 get_normal_sample() +vec3 get_fragment_normal() { if(use_normal_map) return texture(normal_map, texcoord.xy).xyz*2.0-1.0; @@ -75,7 +75,7 @@ vec3 get_normal_sample() vec4 get_environment_sample(vec3 direction) { - return texture(environment, direction); + return texture(environment_map, direction); } vec3 get_reflection(vec3 normal, vec3 look) diff --git a/shaderlib/msp_interface.glsl b/shaderlib/msp_interface.glsl index b1b887ea..c90ab5aa 100644 --- a/shaderlib/msp_interface.glsl +++ b/shaderlib/msp_interface.glsl @@ -57,7 +57,7 @@ uniform ShadowMap mat4 shd_eye_matrix; }; -uniform samplerCube environment; +uniform samplerCube environment_map; uniform EnvMap { mat3 env_eye_matrix; diff --git a/shaderlib/phong.glsl b/shaderlib/phong.glsl index e3b97f58..90f0ac8a 100644 --- a/shaderlib/phong.glsl +++ b/shaderlib/phong.glsl @@ -101,7 +101,7 @@ void main() vec3 look; if(use_normal_map) { - normal = get_normal_sample(); + normal = get_fragment_normal(); look = normalize(tbn_look_dir); } else diff --git a/shaderlib/singlepass.glsl b/shaderlib/singlepass.glsl index 2de3f612..eef6a532 100644 --- a/shaderlib/singlepass.glsl +++ b/shaderlib/singlepass.glsl @@ -72,7 +72,7 @@ vec3 get_normal_sample() vec4 get_environment_sample(vec3 direction) { - return texture(environment, direction); + return texture(environment_map, direction); } vec3 normal; -- 2.43.0