I have a shaders that distorts space and particles generated with a VF (Visual Effect), the shaders are applied to a plane.
Initially both the plane and the VF were in the "Default" layer, this caused some problems as the distortion effect had no effect on the particles, I did some tests and by inserting the plane in the "UI" layer I managed to apply the effect also on particles.
This leaves me to assume that when they are both on the "Default" level, the VF is rendered later and therefore the shaders calculates the distortion of a space without particles. Tell me if I'm wrong.
Obviously I cannot leave my distortion effect in the UI Layer, as it would conflict with the game's UI and also because it is not correct on an organizational level, so I created a new Layer called "Special Distortion Effect", in which to insert all my space distortion effects, I would like all the objects in the layer to be rendered after the elements in the "Default" layer but before the UI layer so as not to distort the UI elements.
I searched online but couldn't find anything, could you help me?
Layers are not responsible for the rendering order (see uses). Instead you should be adjusting the rendering queue or custom render passes.