Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Obi URP + HDR
#1
Hello,

On URP, if I enable HDR for my camera, then the fluids always render on top of any transparent material (eg a glass window).

Is there any workaround for this?

Also weirdly, the scene camera (editor) properly renders Obi fluids behind transparent objects, even though I suppose it has HDR enabled (since it renders bloom properly)


Attached Files Thumbnail(s)
   
Reply
#2
(25-09-2023, 12:19 PM)Voolg Wrote: Hello,

On URP, if I enable HDR for my camera, then the fluids always render on top of any transparent material (eg a glass window).

Is there any workaround for this?

Also weirdly, the scene camera (editor) properly renders Obi fluids behind transparent objects, even though I suppose it has HDR enabled (since it renders bloom properly)

Hi!

I'm unable to reproduce this, never had a similar report either. What URP version are you using?

In URP, fluids are rendered using a RendererFeature, which injects fluid rendering at a specific point during the render loop using RenderPassEvent. You can open up
Obi/Scripts/Fluid/Rendering/URP/ObiFluidRendererFeature.cs and change the RenderPassEvent for all fluid rendering passes to one of your choice (lines 30-42 in the script), the default is RenderPassEvent.BeforeRenderingTransparents +1.

Note that fluids (and transparent particle systems in general) won't be accurately drawn around other transparent objects, since Unity only allows to sort objects back to front. Proper rendering would require to sort fluid particles and object triangles together which is not possible.

kind regards,
Reply
#3
I am on URP 12.1.10

But changing RenderPassEvent.BeforeRenderingTransparents +1 to +0 or lower seems to fix my issue. So if there's no side effect for doing that, it will do just fineĀ Sonrisa
Thank you again!
Reply