Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  ObiFluid Rendering Question(s)
#2
Hi Xanduffy!

(12-03-2022, 11:18 PM)Xanduffy Wrote: Firstly, how can I change the rendering order so that fluid appears behind particles from a VFX graph?

Fluid is rendered after all opaque objects, right before transparent rendering begins. Also, depth testing agains whatever is in the depth buffer at that point.

Never used VFX Graph, but the sensible thing to assume is that most of what it draws is transparent stuff. So it *should* appear on top of fluids. Will test it myself tomorrow morning and report back.

(12-03-2022, 11:18 PM)Xanduffy Wrote: Secondly, how can I get rid of this white edge colour where the fluid contacts the ground? It is only visible in the game view(pic below), but my experimenting with the fluid renderer settings hasn't revealed the cause, this was the least obvious I could make it.

I guess this is the fresnel rim? reducing "smoothness" in the fluid renderer should reduce its intensity. But it could also be the particle blending background, which is pure white by default. Does this go away if you use multiplicative blending for the fluid? (using the source/dest blend modes in the fluid renderer)

(12-03-2022, 11:18 PM)Xanduffy Wrote: As a final bonus question, are there any example shaders that allow some sort of projected texture mapping onto obi fluid, or is that a dumb question? 

The thing with textured fluids is that the naive approach (which is indeed projecting a texture on top of them) looks terrible, because the fluid is moving and the texture is not. So the end result looks like a comic book cutout pattern thing, which might only be good for NPR stuff.

The usual way to circumvent this is to advect textures. Advecting a texture means "moving" it along the fluid's velocity field, so that if the fluid stretches/flows, the texture does too. Sadly this generally stretches/distorts the texture beyond recognition, and the workaround available (advect two offsetted versions of the texture, and lerp between them) results in noticeable pulsating artifacts. Better approaches exist, such as lagrangian advection (give each particle a "billboard" with a piece of the texture and blend them together) but it still generally looks pretty "poppy".

The takeaway point is that there's no good looking, performant, widely known way of doing this. Depending on your exact use case you might be able to hack something that looks good enough for your particular case. Can you share a bit more details about the results that you're after?
Reply


Messages In This Thread
ObiFluid Rendering Question(s) - by Xanduffy - 12-03-2022, 11:18 PM
RE: ObiFluid Rendering Question(s) - by josemendez - 13-03-2022, 06:33 PM
RE: ObiFluid Rendering Question(s) - by Xanduffy - 13-03-2022, 08:38 PM