bevyengine / bevy

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

Colored glass should cast colored shadows #15403

Open djkato opened 2 months ago

djkato commented 2 months ago

What problem does this solve or what need does it fill?

When using transmission of 0.9 combined with base_color, the light that goes through the glass should color the ground. image Currently it doesn't

What solution would you like?

some sort of bool attribute probably to toggle this feature in the StandardMaterial. Also for slow running environments, maybe just a way to manually color the shadow casted from a mesh.

alice-i-cecile commented 2 months ago

This sort of stained glass effect is really cool; I bet there's literature on how to implement this in PBR.

JMS55 commented 2 months ago

https://wickedengine.net/2018/01/easy-transparent-shadow-maps

I think there's another article I've read that I wanted to reference, but I can't seem to find it. Wicked engine seems to also have a blog post though.

djkato commented 2 months ago

Maybe not PBR but I found that nvidia has a paper on this and also additive shadow blending I think https://research.nvidia.com/publication/2016-02_phenomenological-scattering-model-order-independent-transparency

Also unreal engine and unity support these features. Could take a peek at unreals code.

alice-i-cecile commented 2 months ago

Don't look at Unreal's code please! It's not appropriately licensed.