Currently, we have this order for the steps related to RTT gathering:
public static readonly STEP_GATHERRENDERTARGETS_SHADOWGENERATOR = 0;
public static readonly STEP_GATHERRENDERTARGETS_GEOMETRYBUFFERRENDERER = 1;
public static readonly STEP_GATHERRENDERTARGETS_DEPTHRENDERER = 2;
public static readonly STEP_GATHERRENDERTARGETS_POSTPROCESSRENDERPIPELINEMANAGER = 3;
Any reason why SHADOWGENERATOR
is before DEPTHRENDERER
? I would need my depth renderer to be generated before the shadow generators
I guess my question is more: is it possible to inject my depth renderer in the RTT list anywhere I want (like in the first position)?
I could do in scene.onBeforeRenderObservable
something like:
(scene as any)._renderTargets.push(myrtt)
because at this point _renderTargets
is still empty, but it’s quite ugly (_renderTargets
is private)…
I think I can’t use scene.customRenderTargets
because the list of active meshes used for the rendering will be the one from the previous frame as _evaluateActiveMeshes()
is called later in the scene rendering process…