From b0043b3b7e1ae084a5cfd694dbd4d4f66176c2df Mon Sep 17 00:00:00 2001 From: Pavel Rojtberg Date: Wed, 8 Dec 2021 20:12:27 +0100 Subject: [PATCH] Samples: Instancing - drop unused invShadowMapSize --- Samples/Media/materials/programs/GLSL120/Instancing.frag | 5 ++--- Samples/Media/materials/programs/HLSL_Cg/Instancing_ps.cg | 7 ++----- Samples/Media/materials/scripts/Instancing.program | 2 -- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/Samples/Media/materials/programs/GLSL120/Instancing.frag b/Samples/Media/materials/programs/GLSL120/Instancing.frag index ff77fcf479d..8724b8f7e30 100644 --- a/Samples/Media/materials/programs/GLSL120/Instancing.frag +++ b/Samples/Media/materials/programs/GLSL120/Instancing.frag @@ -14,10 +14,9 @@ uniform vec4 lightAttenuation; uniform float lightGloss; #if DEPTH_SHADOWRECEIVER -uniform float invShadowMapSize; uniform sampler2D shadowMap; -float calcDepthShadow(sampler2D shadowMap, vec4 uv, float invShadowMapSize) +float calcDepthShadow(sampler2D shadowMap, vec4 uv) { uv /= uv.w; uv.z = uv.z * 0.5 + 0.5; // convert -1..1 to 0..1 @@ -41,7 +40,7 @@ void main(void) float fShadow = 1.0; #if DEPTH_SHADOWRECEIVER - fShadow = calcDepthShadow( shadowMap, oLightSpacePos, invShadowMapSize ); + fShadow = calcDepthShadow( shadowMap, oLightSpacePos ); #endif vec4 baseColour = texture2D( diffuseMap, _uv0 ); diff --git a/Samples/Media/materials/programs/HLSL_Cg/Instancing_ps.cg b/Samples/Media/materials/programs/HLSL_Cg/Instancing_ps.cg index 9c32afd8e38..a7a50cd0f39 100644 --- a/Samples/Media/materials/programs/HLSL_Cg/Instancing_ps.cg +++ b/Samples/Media/materials/programs/HLSL_Cg/Instancing_ps.cg @@ -5,7 +5,7 @@ #include "HLSL_SM4Support.hlsl" #include "InstancingVertexInterpolators.cg" -float calcDepthShadow(sampler2D shadowMap, float4 uv, float invShadowMapSize) +float calcDepthShadow(sampler2D shadowMap, float4 uv) { uv /= uv.w; return tex2D(shadowMap, uv.xy).x >= uv.z ? 1.0 : 0.0; @@ -28,14 +28,11 @@ half4 main_ps( PS_INPUT input , uniform half3 lightSpecular, uniform half4 lightAttenuation, uniform half lightGloss -#ifdef DEPTH_SHADOWRECEIVER - , uniform float invShadowMapSize -#endif ) : COLOR0 { float fShadow = 1.0f; #ifdef DEPTH_SHADOWRECEIVER - fShadow = calcDepthShadow( shadowMap, input.lightSpacePos, invShadowMapSize ); + fShadow = calcDepthShadow( shadowMap, input.lightSpacePos ); #endif const half4 baseColour = tex2D( diffuseMap, input.uv0 ); diff --git a/Samples/Media/materials/scripts/Instancing.program b/Samples/Media/materials/scripts/Instancing.program index ee6b134e72b..c5afe034f0c 100644 --- a/Samples/Media/materials/scripts/Instancing.program +++ b/Samples/Media/materials/scripts/Instancing.program @@ -80,8 +80,6 @@ fragment_program Ogre/Instancing_ps unified param_named_auto lightDiffuse light_diffuse_colour 0 param_named_auto lightSpecular light_specular_colour 0 param_named_auto lightGloss surface_shininess - - param_named_auto invShadowMapSize inverse_texture_size 1 } }