Jump to content

usePercentageCloserFiltering shadow doesn't work on Samsung S8+


tomer
 Share

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
Link to comment
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 :(

Link to comment
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
Link to comment
Share on other sites

this is a transient bug. Not all devices have it, so it is tough to document.

You can always add a callback on your material.onError and turn off the filter if there is a compilation error

Link to comment
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

Link to comment
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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...