20-09-2018, 09:21 AM
(This post was last modified: 20-09-2018, 09:21 AM by josemendez.)
(19-09-2018, 10:04 PM)rosedev Wrote: Hello,
I'm working on a 2D game and using ObiSimpleFluidRenderer to render the fluid.
By default the fluid is rendered after all renderers in the scene. Is it possible to make it render BEFORE all renderers?
I tried to change this line in the OnPreRender() method:
Code:currentCam.AddCommandBuffer (CameraEvent.BeforeImageEffectsOpaque, renderFluid);
to
but it did not work.Code:currentCam.AddCommandBuffer (CameraEvent.BeforeForwardOpaque, renderFluid);
Thanks for your answer.
Changing the moment at which the command buffer is added to the pipeline will have no effect if the shader is using the depth buffer to perform ztesting. You should modify SimpleFluid.shader to disable depth testing and/or change its render queue. See:
https://docs.unity3d.com/560/Documentati...Depth.html
https://docs.unity3d.com/Manual/SL-SubShaderTags.html