Sign in to follow this  
tomer

usePercentageCloserFiltering shadow doesn't work on Samsung S8+

Recommended Posts

Hello,

When using "usePercentageCloserFiltering" on Samsung S8+ (Android 8.0.0) I get "Unable to compile effect" after that any texture that can receive shadows doesn't work, reproduce with the doc's playground (https://playground.babylonjs.com/#B48X7G#1)

Any temporary workaround will be appreciated!

I the following stack trace:

babylon.js:4 BJS - [02:50:41]: Uniforms:  world, view, viewProjection, vEyePosition, vLightsType, vAmbientColor, vDiffuseColor, vSpecularColor, vEmissiveColor, vFogInfos, vFogColor, pointSize, vDiffuseInfos, vAmbientInfos, vOpacityInfos, vReflectionInfos, vEmissiveInfos, vSpecularInfos, vBumpInfos, vLightmapInfos, vRefractionInfos, mBones, vClipPlane, diffuseMatrix, ambientMatrix, opacityMatrix, reflectionMatrix, emissiveMatrix, specularMatrix, bumpMatrix, normalMatrix, lightmapMatrix, refractionMatrix, diffuseLeftColor, diffuseRightColor, opacityParts, reflectionLeftColor, reflectionRightColor, emissiveLeftColor, emissiveRightColor, refractionLeftColor, refractionRightColor, vReflectionPosition, vReflectionSize, logarithmicDepthConstant, vTangentSpaceParams, alphaCutOff, vLightData0, vLightDiffuse0, vLightSpecular0, vLightDirection0, vLightGround0, lightMatrix0, shadowsInfo0, depthValues0, diffuseSampler, ambientSampler, opacitySampler, reflectionCubeSampler, reflection2DSampler, emissiveSampler, specularSampler, bumpSampler, lightmapSampler, refractionCubeSampler, refraction2DSampler, shadowSampler0, depthSampler0
t._ErrorEnabled @ babylon.js:4
babylon.js:4 BJS - [02:50:41]: Attributes:  position, normal, uv
t._ErrorEnabled @ babylon.js:4
babylon.js:4 BJS - [02:50:41]: Error: 0:89: S0032: no default precision defined for parameter 'webgl_4aeb46af4241331f'
t._ErrorEnabled @ babylon.js:4
babylon.js:4 BJS - [02:50:41]: Trying next fallback.
t._ErrorEnabled @ babylon.js:4
babylon.js:4 BJS - [02:50:41]: Unable to compile effect:
t._ErrorEnabled @ babylon.js:4
babylon.js:4 BJS - [02:50:41]: Uniforms:  world, view, viewProjection, vEyePosition, vLightsType, vAmbientColor, vDiffuseColor, vSpecularColor, vEmissiveColor, vFogInfos, vFogColor, pointSize, vDiffuseInfos, vAmbientInfos, vOpacityInfos, vReflectionInfos, vEmissiveInfos, vSpecularInfos, vBumpInfos, vLightmapInfos, vRefractionInfos, mBones, vClipPlane, diffuseMatrix, ambientMatrix, opacityMatrix, reflectionMatrix, emissiveMatrix, specularMatrix, bumpMatrix, normalMatrix, lightmapMatrix, refractionMatrix, diffuseLeftColor, diffuseRightColor, opacityParts, reflectionLeftColor, reflectionRightColor, emissiveLeftColor, emissiveRightColor, refractionLeftColor, refractionRightColor, vReflectionPosition, vReflectionSize, logarithmicDepthConstant, vTangentSpaceParams, alphaCutOff, vLightData0, vLightDiffuse0, vLightSpecular0, vLightDirection0, vLightGround0, lightMatrix0, shadowsInfo0, depthValues0, diffuseSampler, ambientSampler, opacitySampler, reflectionCubeSampler, reflection2DSampler, emissiveSampler, specularSampler, bumpSampler, lightmapSampler, refractionCubeSampler, refraction2DSampler, shadowSampler0, depthSampler0
t._ErrorEnabled @ babylon.js:4
babylon.js:4 BJS - [02:50:41]: Attributes:  position, normal, uv
t._ErrorEnabled @ babylon.js:4
babylon.js:4 BJS - [02:50:41]: Error: 0:83: S0032: no default precision defined for parameter 'webgl_4aeb46af4241331f'
t._ErrorEnabled @ babylon.js:4

Thanks, Tomer.

Edited by tomer

Share this post


Link to post
Share on other sites

Hello, unfortunately this is a driver issue and we cannot fix it. The percentage closer filtering requires a functional webgl2 driver and this is not the case on android 8 (depending on the device)

Only workaround is to turn this filter off and use another one :(

Share this post


Link to post
Share on other sites

Can I somehow detect if percentage closer filtering is supported?

Cause from what I saw it's the balance between quality and performance?

(It also reproduce on s9 and note 5)

Also, If I may suggest update the documentation about that :)

Thanks again!

Edited by tomer

Share this post


Link to post
Share on other sites

Thanks a lot for your help,

but how can I do it? if the exception already occurred and I turn it off I need a way to re-render the entire scene.

There is no way of knowing that this filter is not supported by the browser before trying to render it? and if so, maybe throw an error but still render the material (but without shadows?)

Cause since I last comment I saw more and more unsupported devices which makes me think of using a different shadow filter even tough this one looks so much better and the performance is great!

Are you sure it depends on the Android version? cause I saw the filter working on devices with Android 6.0 but don't work on brand new devices with Android 8.0 (and 7.0)

 

Tomer

Share this post


Link to post
Share on other sites

The filter depends on a really simple webgl2 feature but this feature is not well supported on Android :(

Regarding how to deal with the problem: add a callback to material.onError and in the callback just turn off the filter on the shadowGenerator. This will force the material to recompile

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.