Why is my ceiling always black?

Hey all,

New to Babylon.js, I’m playing with importing some of my environments from Blender (With baked lightmaps) and for some reason, my ceilings (or surfaces where the normals are pointing down) are always black. Worth noting I do have a hemispheric light in the scene. Does anyone know why this is or has a solution?

Help is much appreciated

Mike

Hi @JustMikess!

This is more a topic for a Blender Forum
But you can try checking if your lights have Indirect lighting

Also check that you’re using the correct lightmap channel for your ceiling

Hey! Thanks for your response but this is definitely a Babylon thing, If I rotate the mesh 90 degrees the upper surface becomes black, seems that this is a lighting thing inside the Babylon editor. The Hemispheric light has no effect on the upper surfaces. Please see attached image…

Hi and welcome to the Community,
Kind of strange with an hemi pointing upwards. I eventually saw something like this with a dir light but here :thinking: Though, what about this light ‘range’ parameter for your hemi. I can see in SS is set to 1.79*… Could it be that from the export this value would be below the scaling of the scene in BJS? Or could it be that it’s a right-handed vs left-handed issue and the light would be actually pointing down? trying to guess here and btw, you wouldn’t happen to have a PG to share?

A hemi light with (0,1,0) direction will only lit a surface if its normal is in the “upper” hemisphere, so if the normal globally points upward (ie., normal.y > 0). For a ceiling, normal.y < 0, so it is not lit.

If you set a negative y for the hemi light direction, it will lit the ceiling, but not the ground anymore:

If you want your hemi light to lit the ground/ceiling at the same time, try a direction like (3,1,0).

2 Likes

Hey, thank you so much for your explanation and demonstration, it makes sense to me now.

I tried your suggestion and it works but it’s hard to get a balance to evenly light the entire room. My workaround was to have two hemi lights one set to 0,1,0 and the other set to 0.-1,0, this seemed to work slightly better. However, it feels to me like there might be a better way to do this…

Here’s my environment without any lights, it’s from Blender with the light maps baked into the textures. In Blender, I’m using an HDRI to create some additional lighting, I believe this is what’s missing in Babylon. Is there a similar method I can use in the Babylon editor?

Or alternatively, does anyone have some suggestions for achieving some nice lighting in this environment?

If you want all the light to be constant check the light’s ground color
https://playground.babylonjs.com/#AJMFJG#1

If you are using PBR materials, you can (should) set an environment map, by doing something like:

scene.environmentTexture = BABYLON.CubeTexture.CreateFromPrefilteredData("textures/environment.env", scene);
2 Likes