Hi!
I want to add support for dynamic shadows in my application. For example, short-living fireballs (point light), which cast shadows. I need to choose what objects may cast and receive shadows, so I need to use PointLightShadowRenderer
. Because there are many point lights, and they appear and disappear frequently, I need to add and remove multiple instances of PointLightShadowRenderer
in the viewport. I also use FilterPostProcessor
.
Problem is that FilterPostProcessor
should always be after shadow renderers, and viewport does not allow to add a scene processor in the beginning of processors array. The only approach I see is removing and readding FilterPostProcessor
after every new PointLightShadowRenderer
, and it looks very ugly. Removing FilterPostProcessor
will invoke its cleanup()
and it does different things with framebuffers. It also cleans up all the filters!
There is also no option to disable some scene processors temporarily, like it is implemented with filters in the FilterPostProcessor
. As I will have a limitation to maximum number of dynamic shadows, I would create all the PointLightShadowRenderer
instances, add them to viewport, and would disable/enable them, when needed.
Is there any efficient solution to add new shadow renderers without removing fpp?
Thank you!