I am in the process of upgrading our project from Babylon 6 to 7, but I am having issues with the ceilings of our rooms not casting shadows after upgrading.
I want to be able to see through the ceiling from above, but still have the ceiling cast a shadow. The playground works in Babylon 6 and below but in Babylon 7 there is no shadow cast. Is this related to the breaking changes made in 7.11?
You don’t see the plane in this picture, because of the value of sideOrientation. As a result, the plane will not be rendered in the shadow map and will therefore not generate shadows.
If you change the orientation, the plane will be visible, as well as the shadow:
I have a question to this topic, because i have the same situation as @jarredcm was asking:
is there a solution to have a ceiling where i can see through and this ceiling still cast a shadow?
You could set material.disableColorWrite = true when the camera is above the ceiling, and reset it to false when it is below. This way, the ceiling won’t be rendered to the screen, but the shadow map will still be generated correctly.
I’ve tested with this advice and on first look all was fine.
But: i’ve recognized that all meshes, which are using materials with textures are disappearing below the ceiling when looking from above.
Only meshes with color materials are visible through the ceiling mesh.
This is expected. When you draw the ceiling first, it writes to the zbuffer even though it doesn’t write colors to the screen, so when the floor is drawn next, some parts are obscured by the invisible ceiling because of the zbuffer.
When you draw the floor first, the zbuffer is still empty, so the entire floor will be drawn.