Add support for ShadowGenerator
Attempting to construct a ShadowGenerator results in the following error:
TypeError: undefined is not an object (evaluating 'gl.TEXTURE_2D')
I'm guessing there is just something that hasn't been implemented in Babylon Native that is needed to support this.
I'am taking a look. Might not be a lot of work...
Actually, it's more work than anticipated. Half is done with PR #415 Need to finish creating the depth texture support.
I've found an issue in bgfx shader patching code. Fixing it before moving on this issue.
Current status for shadows:
- [x] Basic shadow implemented
- [x] Filtering and order or rendering fixed with this PR https://github.com/BabylonJS/BabylonNative/pull/739
- [ ] Cubemap shadows not supported yet
Need to finish creating the depth texture support.
@CedricGuillemet in relation to your comment above, is the depth texture / depth renderer supported in Babylon Native at this point in time?
@brian-hay depth renderer/texture should work. But it's not been tested properly yet. Thus some caps flags are disabled. For example, a recent and related forum thread: https://forum.babylonjs.com/t/issue-with-depth-texture-rendering-in-babylon-native/32066/6?u=cedric
Hi @CedricGuillemet yes that post was from me :-)
I tried your proposed temporary workaround and it worked!
Closing for now. If someone needs the cubemap shadow support, we should open a new issue.