filament icon indicating copy to clipboard operation
filament copied to clipboard

Add support for shadow-casting point lights

Open jwwalker opened this issue 3 years ago • 2 comments

Describe the solution you'd like

I'd like to be able to make a point light cast shadows.

Describe alternatives you've considered

I've considered trying to simulate it with a number of spot lights, but didn't get too far. For one thing it runs up against Filament's low number of shadow-casting spot lights. Also, this approach would be easier with "light channels", mentioned as a possible future feature in #3839 . But surely it would be more efficient if the functionality were built in.

Remarks

As I understand it, Filament uses shadow maps for spot light and directional light shadows, which involves rendering a depth map for the scene from the point of view of the light. The obvious way to generalize this for a point light would be to render a cube map. However one could instead render through faces of a tetrahedron. The math would be uglier, but it would be 4 renders instead of 6.

jwwalker avatar Jun 16 '21 20:06 jwwalker

This is something I'd like to add, but won't be a priority right now. I do plan on increasing the cap on shadow-casting spot lights.

bejado avatar Jun 17 '21 17:06 bejado

Second this request.

TheOriginalBytePlayer avatar Jul 08 '21 21:07 TheOriginalBytePlayer

See PR #6152

romainguy avatar Oct 06 '22 22:10 romainguy