First load results in dark scene

Hello there :slight_smile:

I’m testing some simple stuff with BabylonJS (within a React app), and right now I’m playing around with custom models and shadows. However, I’m facing an issue that when the scene is loaded, it actually displays a totally dark scene.

However, when developing, if I change the file, the hot reload triggers and, in this case, the scene loads correctly. The script is actually very simple, so I’m not really sure what I’m doing wrong.

Recording

Recording 2022-09-23 at 14.17.10

Files

As you can see, nothing really special, small script, the model is just a plane with a texture.
I suppose it’s not React, as the other scripts/models do not have this issue. If someone can unblock me I would be grateful :pray:

Thanks in advance !

Hey,
I don’t know why but the
shadowGenerator.addShadowCaster(plane, false);
is causing the issue

1 Like

This is kind of expected as you have only one plane casting shadow on itself so you need to set your bias properly but in any case having a plane casting shadow to itself is a perf drain as you are sure it will never be in shadow :slight_smile:

2 Likes

Thanks to both of you !
As expected, it’s just a stupid mistake from me :sweat_smile: I learned something today :smile:

1 Like