From: Mikko Rasa Date: Tue, 23 Jun 2020 14:01:53 +0000 (+0300) Subject: Naming tweaks in builtin shaders X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=146df2d02940a04aeafe854bdd981a1489cc80b3;p=libs%2Fgl.git Naming tweaks in builtin shaders --- 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;