Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  ObiFluid Rendering Question(s)
#4
(13-03-2022, 08:38 PM)Xanduffy Wrote: Hi Jose! Thanks for the quick response.

Regarding the white outline issue, I think it is a blending issue as I have smoothness at 0, and the effect does get worse the lower I set the thickness cutoff, pushing that to 5 has mostly gotten rid of it, but obviously limits the look of the fluid a lot. Changing around the 'basic blending' settings can get rid of it completely, but seemingly not while achieving the lava look that I have currently using this setup:

If thickness cutoff affects the white outline, then it's definitely the blending background color showing trough.

Particle colors are blended over a white background (this blending is controlled by Particle blend source/destination), then the resulting fluid render target is blended on top of the frame (controlled using Blend source and Blend destination). The blend source/destination values are just your typical blend factors).

The blend factors you're using basically multiply the fluid color by itself, and then add them to the screen's color multiplied by itself - which isn't at all how fluids usually behave. The resulting blend equation is:

finalColor = fluidColor * fluidColor + sceneColor * sceneColor

Compared to the default blending (fluidColor * fluidThickness + sceneColor * (1-fluidThickness)), this makes no use of the alpha channel(transparency/thickness) so the particle blending background will be fully visible, resulting in a white halo/outline.

While you cannot get rid of the outline entirely without throwing alpha into the equation, you can choose its color by modifying FluidRenderingUtils.cs and setting thicknessBufferClear value to the color of your choice.

(13-03-2022, 08:38 PM)Xanduffy Wrote: As for the idea of texture mapping, I had been learning about flow map shaders recently and experimenting with them in the shader graph, which started me thinking about somehow projecting that onto an obifluid surface, which in theory could blend much better with the flow of the particles, at least in somewhat predictable simulations.

Flowmaps are essentially 2D textures where uv coordinates are advected. Projecting a flowmapped texture onto the fluid surface, while possible, will probably result in some funky looking stuff. You could project from the camera, or maybe top-down if your fluid sits on the floor most of the time. There's certainly room for experimentation. However I think the most promising route is still lagrangian advection, which is on my long term to-do list.

Will try to figure out sorting with VFX graph and get back to you shortly!

(13-03-2022, 08:38 PM)Xanduffy Wrote: As it stands though, using particle Z write and very specific colours has at least gotten the point across that it's lava,

If you're planning to use some bloom in your game (be it true HDR tone mapping or fake overexposure) I'd consider using the fluid's color or thickness as emissive. That would make your lava glow, helping sell the "hotness" of it. This does require some shader writing, though.
Reply


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