BabylonNative icon indicating copy to clipboard operation
BabylonNative copied to clipboard

Add support for ShadowGenerator

Open ryantrem opened this issue 5 years ago • 7 comments

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.

ryantrem avatar Sep 12 '20 22:09 ryantrem

I'am taking a look. Might not be a lot of work...

CedricGuillemet avatar Sep 21 '20 14:09 CedricGuillemet

Actually, it's more work than anticipated. Half is done with PR #415 Need to finish creating the depth texture support.

CedricGuillemet avatar Sep 25 '20 10:09 CedricGuillemet

I've found an issue in bgfx shader patching code. Fixing it before moving on this issue.

CedricGuillemet avatar Dec 14 '20 15:12 CedricGuillemet

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

CedricGuillemet avatar Jun 02 '21 13:06 CedricGuillemet

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 avatar Jul 10 '22 20:07 brian-hay

@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

CedricGuillemet avatar Jul 20 '22 07:07 CedricGuillemet

Hi @CedricGuillemet yes that post was from me :-)

I tried your proposed temporary workaround and it worked!

brian-hay avatar Jul 20 '22 09:07 brian-hay

Closing for now. If someone needs the cubemap shadow support, we should open a new issue.

bghgary avatar May 25 '23 19:05 bghgary