main #136
@ -75,9 +75,15 @@ vec3 PCFTileAware(sampler2DShadow shadowMap,
|
|||||||
|
|
||||||
#ifdef _ShadowMapTransparent
|
#ifdef _ShadowMapTransparent
|
||||||
if (transparent == false) {
|
if (transparent == false) {
|
||||||
vec4 shadowmap_transparent = texture(shadowMapTransparent, uv);
|
vec3 transResult = vec3(0.0);
|
||||||
if (shadowmap_transparent.a < compare)
|
for (int x = -1; x <= 1; x++) {
|
||||||
result *= shadowmap_transparent.rgb;
|
for (int y = -1; y <= 1; y++) {
|
||||||
|
vec4 smt = texture(shadowMapTransparent,
|
||||||
|
clamp(uv + vec2(x, y) / smSize, tileMin, tileMax));
|
||||||
|
transResult += (smt.a < compare) ? smt.rgb : vec3(1.0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
result *= transResult / 9.0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -142,9 +148,15 @@ vec3 PCF(sampler2DShadow shadowMap,
|
|||||||
|
|
||||||
#ifdef _ShadowMapTransparent
|
#ifdef _ShadowMapTransparent
|
||||||
if (transparent == false) {
|
if (transparent == false) {
|
||||||
vec4 shadowmap_transparent = texture(shadowMapTransparent, uv);
|
vec3 transResult = vec3(0.0);
|
||||||
if (shadowmap_transparent.a < compare)
|
for (int x = -1; x <= 1; x++) {
|
||||||
result *= shadowmap_transparent.rgb;
|
for (int y = -1; y <= 1; y++) {
|
||||||
|
vec4 smt = texture(shadowMapTransparent,
|
||||||
|
uv + vec2(x, y) / smSize);
|
||||||
|
transResult += (smt.a < compare) ? smt.rgb : vec3(1.0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
result *= transResult / 9.0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -187,9 +199,19 @@ vec3 PCFCube(samplerCubeShadow shadowMapCube,
|
|||||||
|
|
||||||
#ifdef _ShadowMapTransparent
|
#ifdef _ShadowMapTransparent
|
||||||
if (transparent == false) {
|
if (transparent == false) {
|
||||||
vec4 shadowmap_transparent = texture(shadowMapCubeTransparent, ml);
|
vec3 transResult = vec3(0.0);
|
||||||
if (shadowmap_transparent.a < compare)
|
vec4 smt = texture(shadowMapCubeTransparent, ml);
|
||||||
result *= shadowmap_transparent.rgb;
|
transResult += (smt.a < compare) ? smt.rgb : vec3(1.0);
|
||||||
|
for (int x = -1; x <= 1; x += 2) {
|
||||||
|
for (int y = -1; y <= 1; y += 2) {
|
||||||
|
for (int z = -1; z <= 1; z += 2) {
|
||||||
|
smt = texture(shadowMapCubeTransparent,
|
||||||
|
ml + vec3(x, y, z) * s);
|
||||||
|
transResult += (smt.a < compare) ? smt.rgb : vec3(1.0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
result *= transResult / 9.0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -385,9 +407,15 @@ vec3 PCFFakeCube(sampler2DShadow shadowMap,
|
|||||||
|
|
||||||
#ifdef _ShadowMapTransparent
|
#ifdef _ShadowMapTransparent
|
||||||
if (transparent == false) {
|
if (transparent == false) {
|
||||||
vec4 shadowmap_transparent = texture(shadowMapTransparent, uvtiled);
|
vec3 transResult = vec3(0.0);
|
||||||
if (shadowmap_transparent.a < compare)
|
for (int x = -1; x <= 1; x++) {
|
||||||
result *= shadowmap_transparent.rgb;
|
for (int y = -1; y <= 1; y++) {
|
||||||
|
vec4 smt = texture(shadowMapTransparent,
|
||||||
|
clamp(uvtiled + vec2(x, y) / smSize, 0.0, 1.0));
|
||||||
|
transResult += (smt.a < compare) ? smt.rgb : vec3(1.0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
result *= transResult / 9.0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user