Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug / Crash  Obi Fluid 7 Transparent Fluid has no color
#11
(06-01-2025, 08:39 PM)hariedo Wrote: If I don't have the ObiFluidRendererFeature set up properly, then I will get no fluids rendering at all. Since I said I get fluids but they're lacking turbidity, you can skip repeating the advice to set that part up.

Rendering the fluid's mesh is done by ObiFluidSurfaceMesher (as the name implies, it builds a mesh for the surface of the fluid), so it's not possible to get no rendering at all by not having a ObiFluidRendererFeature.

By not having a properly set up ObiFluidRendererFeature fluid *will* get rendered, but it will look exactly like in your screenshot because turbidity and thickness effects won't work as I explained in my last post:

Quote:Specifically, make sure you've added a ObiFluidRendererFeature rendering feature (step #3 in the manual page linked above) and that you've assigned the fluid pass(es) you're using to it. Otherwise refraction/thickness/turbidity will have no effect on transparent fluids.

That's why I feel like I must repeat the same advice, even if I risk sounding like a broken record.


(06-01-2025, 08:39 PM)hariedo Wrote: I mis-spoke.  Not only am I using the stock blueprints, but I am ALSO using the stock ObiFluidRenderingPass (named FluidPassTransparent) but am adjusting its settings.  After all, that's the only place where settings like Turbidity and Diffuse Color show up in the interface, so I must be using it.

My guess is that you haven't added the ObiFluidRenderingPass to your ObiFluidRendererFeature. Even if you use stock assets, this step is necessary for the URP renderer (which is not a part of Obi, so you cannot use a stock one!) to provide the necessary buffers for transparent fluids to work as explained in the manual, see the bit circled in yellow:

[Image: xqOMC3P.png]

(06-01-2025, 08:39 PM)hariedo Wrote: From the Burst Transparent shader graph, it looks like you only use the alpha value of Turbidity, not its color.  If this was your design intent, it is pretty confusing from a user perspective.  That said, you can see from my settings of ~0.5 alpha turbidity and bright green diffuse color, my fluid should not be water. 

Not sure what you mean, in the ShaderGraph shader you can clearly see its RGB channels are being used. Turbidity is a color as illustrated in the manual:

[Image: kHWFdZu.png]


(06-01-2025, 08:39 PM)hariedo Wrote: I have tried this with the ObiFluidRendererFeature at the top of the stack, and at the bottom of the stack, and alone in the stack, so it's not a matter of ordering the rendering features.

Ordering has no effect at all indeed. However if you just add the ObiFluidRendererFeature but forget setting it up by providing one or more passes, thickness, turbidity and other transmittance-related effects won't work for those passes.

let me know if you need further help,

kind regards
Reply
#12
(07-01-2025, 09:43 AM)josemendez Wrote: That's why I feel like I must repeat the same advice, even if I risk sounding like a broken record.

My guess is that you haven't added the ObiFluidRenderingPass to your ObiFluidRendererFeature. Even if you use stock assets, this step is necessary for the URP renderer (which is not a part of Obi, so you cannot use a stock one!) to provide the necessary buffers for transparent fluids to work as explained in the manual, see the bit circled in yellow:

[Image: xqOMC3P.png]

Apologies for sounding uncivil above. This setup is kinda ridiculous, to be honest. Add feature. Add pass so that PART of the feature works. But we got there.

I dunno, having some part of the Feature spit out an error if there are zero passes might help. Having some part of the Mesher spit out an error if there's no Feature might help. Having a "helpful tip" of "hey, if you get clear water" in the manual might help. Replacing my brain might help.
Reply
#13
(08-01-2025, 12:21 AM)hariedo Wrote: Apologies for sounding uncivil above. 

No problem, we all do when under pressure or when frustrated. Hope you got it to work the way you needed.

(08-01-2025, 12:21 AM)hariedo Wrote: This setup is kinda ridiculous, to be honest.  Add feature.  Add pass so that PART of the feature works.  But we got there.

Not just part of it, the entire renderer feature won't work if you don't set it up. It's the same thing with most renderer features in Unity, like RenderObjects or FullScreenPass for instance: they require you to set up object layers, add references to materials, etc. Just adding a feature is no guarantee it will work as desired or at all. Same thing with components. To be honest I'm not sure how this can be improved upon as it's a fundamental workflow in Unity.

(08-01-2025, 12:21 AM)hariedo Wrote: I dunno, having some part of the Feature spit out an error if there are zero passes might help. 

Thanks for the suggestion! we will look into adding this in the next update. A potential problem is that you might not get to see the error if you don't unfold the renderer feature inspector, and logging to the console might be a bit spammy. Will need to think about how to best bring attention to this without getting in the way.

(08-01-2025, 12:21 AM)hariedo Wrote: Having some part of the Mesher spit out an error if there's no Feature might help. 

You might not want to use the Feature, for instance when using opaque fluids or certain custom shaders that do not require transmittance buffers. Or when using multiple renderers for different levels of quality. So spitting an error in case you don't have a Feature wouldn't be right as you might not want to have one depending on what you're doing.

(08-01-2025, 12:21 AM)hariedo Wrote: Having a "helpful tip" of "hey, if you get clear water" in the manual might help. 

The manual does warn you that transparent fluids won't render properly if you forget adding the pass to the feature. This is mentioned multiple times throughout it, and the first mention you encounter is a warning box in step #1:

[Image: iCgXyaS.png]

It's explained again in step #3, together with a screenshot highlighting exactly where you should add the pass(es) in the interface.

(08-01-2025, 12:21 AM)hariedo Wrote: Replacing my brain might help.

Probably no need to go that far, heard about brain transplants being expensive Guiño.

let me know if you need further help,

kind regards
Reply
#14
I'm also having this issue but I do have passes in the Obi Render feature for URP.
It's still colorless. My version is missing Refraction Down sample, is that related?


Unity 2021.3 & 6.0 & 6.2
obi 7.1
URP 12.1
Reply
#15
(07-10-2025, 07:25 PM)deatheragenator Wrote: I'm also having this issue but I do have passes in the Obi Render feature for URP.

Hi!

This may be obvious, but make sure the pass you're added to your ObiRendererFeature is the same one being used by the ObiFluidSurfaceMesher in your scene.


(07-10-2025, 07:25 PM)deatheragenator Wrote: It's still colorless.

Make sure the pass' thickness parameter is large enough for absorption to be visible. Values between 3 and 10 are usually enough. See: https://obi.virtualmethodstudio.com/manu...ering.html

(07-10-2025, 07:25 PM)deatheragenator Wrote: My version is missing Refraction Down sample, is that related?

This is only available in BiRP (built-in render pipeline),  since URP already has its own refraction downsampling control (called "Opaque downsampling" in the URP pipeline asset). 

kind regards,
Reply
#16
The following settings are correct.
The Renderer Feature is using the same pass as the scene.
This is also the URP Asset and Renderer data listed in graphics settings.

Thickness is 8.

As listed in these pictures.


Attached Files Thumbnail(s)
       
Reply
#17
(08-10-2025, 07:13 PM)deatheragenator Wrote: The following settings are correct.
The Renderer Feature is using the same pass as the scene.
This is also the URP Asset and Renderer data listed in graphics settings.

Thickness is 8.

As listed in these pictures.

Are your project’s quality settings making use of the URP high fidelity renderer that’s setup with the fluid renderer? (Don’t know if this is what you mean by graphics settings?)
Reply
#18
(08-10-2025, 08:29 PM)josemendez Wrote: Are your project’s quality settings making use of the URP high fidelity renderer that’s setup with the fluid renderer? (Don’t know if this is what you mean by graphics settings?)
Yes the graphics and quality settings are both pointing to the URP asset.


Attached Files Thumbnail(s)
   
Reply
#19
Hi,

Turn out this is a bug in URP 12.1 (I've been unable to reproduce it more recent Unity/URP versions).

Good news is that it can be worked around, replace \Obi\Resources\ObiMaterials\URP\Fluid\AccumulateTransmissionURP.shader with the one I'm attaching, that should solve the problem.

Now I'll explain what the problem is. The bug in particular is this one, which for some reason has been marked as "won't fix" by Unity. Looks like they tried on 2022.3, possibly with a newer URP version so they were unable to reproduce it:
https://issuetracker.unity3d.com/issues/...tom-shader

It's consistently reproducible on 12.1 though. Using Unity's Frame Debugger I could see that in the URP 12.1 project, _BlitScaleBias has a value of 0,0,0,0, when it should be 1,1,0,0:
[Image: xtjgRGG.png]


Testing on newer URP versions however, _BlitScaleBias always has a value of 1,1,0,0, and the fluid's color buffer is rendered correctly:
[Image: AVmuEbN.png]

URP uses_BlitScaleBias to calculate the UV coordinates during full screen passes performed by the Blitter.BlitCameraTexture function. The calculation goes like this:

float2 DynamicScalingApplyScaleBias(float2 xy)
{
    return _BlitScaleBias.zw + xy * _BlitScaleBias.xy;
}

When URP fails to set _BlitScaleBias it has a value of all zeroes, so the UVs returned by this function are also 0. As a result the fluid screen pass samples only the bottom-left pixel of the screen, which in the fluid's case is white when there's no fluid being rendered at the bottom-left corner of the screen. As a result, fluid has no color because URP reports the screen as having no fluid, which is incorrect.

The patched shader file attached to this email entirely skips URP's internal uv calculation and performs its own correct calculation. This should yield correct results.

let me know if I can be of further help,

kind regards,


Attached Files
.shader   AccumulateTransmissionURP.shader (Size: 1.69 KB / Downloads: 5)
Reply
#20
Thank you very much! This did fix the issue. The extra time you put into the explanation was appreciated.
Reply