RenderFeature inject during transparencies

I have a RenderFeature that renders a semi-transparent distorted cloud like substance that we want to blend into the scene. It works by rendering opaque shapes and particles to a specific buffer (including their depth) that provides enough information to sample during the cloud’s RenderFeature so that I can blit a transparent effect with depth comparisons into the scene and, for the most part, it works. We have it set to draw “After Rendering Transparents” so that it will encapsulate transparent effects occurring from within and behind the cloud.

So the output worked as hoped, but some time after I noticed an oversight… that being particles. Our other transparencies surfaces are working fine both behind and in front of the cloud effect as they are writing to the depth buffer, but that’s not true for particles. We also make use of both shuriken and VFX graph particles and both suffer the same issue.

I can fix this to a degree, but it’s hacky… modifying the soft particle behavior in the shader code to compare both scene depth and the depth of the cloud. But I also require the built in “Render Objects” render feature to draw the particles after transparencies have been completed, which means I have to render the particles twice because even if I block this layer in the camera mask, the particles won’t draw at all… I guess the particle system isn’t being updated because it is deemed unimportant due to not being drawn in the conventional way.

I also tried setting the particle material render queues to “overlay” to no avail.

So a couple of questions really:

  • Is there a more conventional way to draw particles after transparencies once the cloud RenderFeature is done?
  • Is it possible to inject a RenderFeature into a specific RenderQueue?