OGRECave / ogre

scene-oriented, flexible 3D engine (C++, Python, C#, Java)
https://ogrecave.github.io/ogre/
MIT License
3.9k stars 961 forks source link

Port shadow framework to compositors #892

Open paroj opened 5 years ago

paroj commented 5 years ago

We could attach a compositor (called shadow) that renders the scene to a texture using a 'shadow' material scheme, and the materials in the regular passes (or the deferred passes) would be able to address these textures. There is some duplication in Ogre with techniques having 'shadow materials' and having access to 'shadow textures', rather than having techniques that are for the scheme 'shadow' and being able to address textures from the compositor 'shadow.

src: https://forums.ogre3d.org/viewtopic.php?f=13&t=48709&p=334663#p334663
v2-1: https://ogrecave.github.io/ogre-next/api/2.1/compositor.html#CompositorShadowNodes

paroj commented 2 years ago

from https://forums.ogre3d.org/viewtopic.php?t=96659

there is an unresolved issue though: currently you can easily couple a material scheme to a shadow caster material (say both should use HW skinning). Thats why the shadow caster material ref is per technique. If the shadow caster material would be implemented as a material scheme itself, there would be no such coupling.

An ugly fix for that would be one shadow scheme per normal scheme: "High" = "Shadow_High" "Medium" = "Shadow_Medium" "Low" = "Shadow_Low"