Skip to content

Commit

Permalink
Updated one missed VSM shader chunk for WebGPU compatibility (playcan…
Browse files Browse the repository at this point in the history
…vas#6348)

Co-authored-by: Martin Valigursky <mvaligursky@snapchat.com>
  • Loading branch information
2 people authored and slimbuck committed May 20, 2024
1 parent 8e4d268 commit a0f48f4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/scene/shader-lib/chunks/lit/frag/shadowEVSM.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
export default /* glsl */`
float VSM$(sampler2D tex, vec2 texCoords, float resolution, float Z, float vsmBias, float exponent) {
float VSM$(TEXTURE_ACCEPT(tex), vec2 texCoords, float resolution, float Z, float vsmBias, float exponent) {
vec3 moments = texture2D(tex, texCoords).xyz;
return calculateEVSM(moments, Z, vsmBias, exponent);
}
float getShadowVSM$(sampler2D shadowMap, vec3 shadowCoord, vec4 shadowParams, float exponent, vec3 lightDir) {
return VSM$(shadowMap, shadowCoord.xy, shadowParams.x, shadowCoord.z, shadowParams.y, exponent);
float getShadowVSM$(TEXTURE_ACCEPT(shadowMap), vec3 shadowCoord, vec4 shadowParams, float exponent, vec3 lightDir) {
return VSM$(TEXTURE_PASS(shadowMap), shadowCoord.xy, shadowParams.x, shadowCoord.z, shadowParams.y, exponent);
}
float getShadowSpotVSM$(sampler2D shadowMap, vec3 shadowCoord, vec4 shadowParams, float exponent, vec3 lightDir) {
return VSM$(shadowMap, shadowCoord.xy, shadowParams.x, length(lightDir) * shadowParams.w + shadowParams.z, shadowParams.y, exponent);
float getShadowSpotVSM$(TEXTURE_ACCEPT(shadowMap), vec3 shadowCoord, vec4 shadowParams, float exponent, vec3 lightDir) {
return VSM$(TEXTURE_PASS(shadowMap), shadowCoord.xy, shadowParams.x, length(lightDir) * shadowParams.w + shadowParams.z, shadowParams.y, exponent);
}
`;

0 comments on commit a0f48f4

Please sign in to comment.