-
Bug
-
Resolution: Fixed
-
1.20.30.22 Preview, 1.20.30.21 Preview, 1.20.30.20 Preview, 1.20.40.21 Preview
-
Confirmed
-
Android
-
1093262
Deferred pipeline sun shadows look broken on Android
Device: Samsung Galaxy s10 SM-G9730
Steps to Reproduce:
- Enable deferred pipeline on android beta version
- Observe sun shadows
Observed Results:
Shadows have visible flickering artefacts (see attached video)
Expected Results:
Shadows will look normal
Notes:
The frame captured with graphics debugger looks completely normal, artefacts only occur during gameplay on the device itself.
I tried fixing it by editing shader code, and this is the minimum set of edits that resolved the issue on my device (both edits are necessary for it to function properly, removing either causes artefacts to appear)
bool areCascadedShadowsEnabled(float mode) { return round(mode) == 1.0; // Instead of int(mode) == 1 } float GetShadowAmount(ShadowParameters params, DirectionalLightParams light, vec3 worldPos, float NdL, float viewDepth) { vec4 projPos; float amt = 1.0; float cloudAmt = 1.0; bool isSun = light.isSun > 0; // This has to be computed before GetShadowCascade() is called, otherwise artefacts occur. Storing just light.isSun and comparing it with 0 after GetShadowCascade() didn't fix the issue. int cascade = GetShadowCascade(light, worldPos, projPos); if (cascade != -1) { float bias = params.shadowBias[light.index] + params.shadowSlopeBias[light.index] * clamp(tan(acos(NdL)), 0.0, 1.0); projPos.z -= bias / projPos.w; vec2 uv = vec2(projPos.x, projPos.y) * 0.5f + 0.5f; amt = GetFilteredShadow(params, light.index, projPos.z, cascade, uv); if (isSun && params.cloudshadowsEnabled > 0) { // Here use computed previously variable instead of direct light.isSun > 0 comparison. cloudAmt = GetFilteredCloudShadow(params, worldPos, NdL); if (cloudAmt < 1.0) { cloudAmt = max(cloudAmt, 1.0 - params.cloudshadowContribution); amt = min(amt, cloudAmt); } } float shadowRange = params.shadowParams.y; float shadowFade = smoothstep(max(0.0, shadowRange - 8.0), shadowRange, -viewDepth); amt = mix(amt, 1.0, shadowFade); } return amt; }
- is duplicated by
-
MCPE-174023 Shadow and Lighting glitch
- Resolved
-
MCPE-174024 Graphic Update
- Resolved
-
MCPE-174046 Lights and shadows doesn't work with the new shaders
- Resolved
-
MCPE-174171 Deffered Lightings Technical Shaders Issue
- Resolved
-
MCPE-174417 Glitching of shadows in Deffered technical preview(MCPE)
- Resolved
-
MCPE-174499 Shadows are pixelated on technical deferred rendering
- Resolved
-
MCPE-175046 Shadow Bug on technical deferred graphics For Adreno 618
- Resolved