-
-
Notifications
You must be signed in to change notification settings - Fork 127
Description
I'm adding cascaded shadow maps to my own project, and I'd be open to contribute an implementation back to three-d, but I'm not spotting a great way to plug new shadow map backends into the existing lighting system.
Since cascaded shadow maps require changes to both shadow map generation and sampling, we'd need a way to provide replacements for both Light.shader_source()
and Light.generate_shadow_map()
. The most strait forward is to add a ShadowMapper
trait (name needs workshopping), but that would require Light
to become Light<S> where S: ShadowMapper
, which has knock-on effects up and down the API. Or maybe alternately Light
could contain a shadow_mapper: Box<dyn ShadowMapper>
. Or we could make the caller explicitly pass an Option<&ShadowMapper>
into the two functions that require it...
Do you have a preferred approach here? Is adding fancier shadow algorithms a good fit with the goals of three-d?