Shadow Map is creating dark spots on meshes

I started transitioning from voxel to shadow map and one thing that caught my attention was that my meshes now had dark spots on them.

Shadow Map


Voxel


Does anyone know why this is happening and how I could possibly fix this? Or is this completely normal and I have nothing to worry about?

2 Likes

When using shadow map, do the shadows on the mesh respond when you move the sun?

1 Like

They sure do. Some of the dark spots will disappear when the time is changed and some still move a bit.

Then it seems to me that this is purposeful, but obv I’m not a Roblox engineer.

Do you have a file of the foilage by any chance?

The model file or the raw obj file?

Edit:
I’ll send a direct message with the files.

This is just a guess, but maybe the tree might be casting shadows on itself? Like this:

The blue spot is in shadow since the leaves (green) are blocking the sunlight (orange). This is just a rough guess however.

5 Likes

This has been a bug before Future is Bright was a project. Shadows from dynamic lighting are casted based on the mesh’s collision model, not the actual graphic model. The shadows can be fixed by setting the mesh’s collision fidelity to “Box” (“Hull” also works to some extent).

This is a really annoying bug, and I hope ROBLOX gets around to fixing it.

2 Likes

Sunlight doesn’t use the Voxel grid for direct sunlight in ShadowMap, only for indirect ambient sky lighting, so this would only apply to artificial lights or sunlight in Voxel lighting.

2 Likes

I think it may have been hard to see in the images, but some dark spots were also on the areas with direct sunlight.

Changing the Collision fidelity didn’t do anything…

Edit:
I was able to find something to sorta fix the issue, I’ll post an update later.

Sorry for not coming to you earlier. These shadows should not be present. Scaling it up makes it worse. There is nothing wrong with the mesh itself, and this should definitely be treated as a bug.

3 Likes