bevyengine / bevy

A refreshingly simple data-driven game engine built in Rust
https://bevyengine.org
Apache License 2.0
36.44k stars 3.6k forks source link

Maximize useful directional light cascade shadow map texels #16076

Open JMS55 opened 1 month ago

JMS55 commented 1 month ago

https://www.sebastiansylvan.com/post/improving-shadow-map-utilization-for-cascaded-shadow-maps


Also note that we're currently using an infinitely far away near plane https://github.com/bevyengine/bevy/blob/9274bfed277725e8987f8755931dc4d83e5fa08f/crates/bevy_pbr/src/render/light.rs#L1309-L1311

which is a bad idea because it destroys depth buffer precision.

Although, this might only be for culling, and not rendering? Needs more investigation.

superdump commented 1 month ago

The infinite near plane is just for culling. But I think also culling against the near plane is skipped.