Skip to content

Commit

Permalink
Samples: Instancing - drop unused invShadowMapSize
Browse files Browse the repository at this point in the history
  • Loading branch information
paroj committed Dec 8, 2021
1 parent e03e19a commit b0043b3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
5 changes: 2 additions & 3 deletions Samples/Media/materials/programs/GLSL120/Instancing.frag
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 );
Expand Down
7 changes: 2 additions & 5 deletions Samples/Media/materials/programs/HLSL_Cg/Instancing_ps.cg
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 );
Expand Down
2 changes: 0 additions & 2 deletions Samples/Media/materials/scripts/Instancing.program
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down

0 comments on commit b0043b3

Please sign in to comment.