Babylon.js: Cascaded Shadow Maps crashes entire scene on iOS

Created on 12 Mar 2020  路  9Comments  路  Source: BabylonJS/Babylon.js

Verified using both iPad & iPhone:

Cascaded Shadow Maps lead to Script Error / crash of entire Scene.

Problems does not occur on Android, likely due to it supporting WebGL2.

If the feature can't be implemented on iOS, it should instead provide a warning and not crash the scene (ideally of course it would fallback to normal shadow Generator, but I suppose this logic could also be implemented by the developer).

Applies to all Playground examples that are references on the following page:

https://doc.babylonjs.com/babylon101/shadows_csm

bug

All 9 comments

Totally agree 馃憤

@Popov72 could you check this one ?

Well, it's already handled.

In the CSM constructor:

        if (this._scene.getEngine().webGLVersion == 1) {
            throw "CSM can only be used in WebGL2";
        }

it's up to the developer to catch the exception and handle it gracefully.

I don't think we can do any better as we are in a constructor, we can't return a specific value to indicate it is not supported.

Ohhhhhh I thought there were no custom message, my bad. Do you think we should log a message instead ? as we do in other places in babylon ?

A bit like we do in SSA02RenderingPipeline with a isSupported method and an error log ???

Ok, going to make a PR for that!

See #7817

Closed by #7817

Was this page helpful?
0 / 5 - 0 ratings