Author Topic: Adding a water vortex effect  (Read 37 times)

Marcus

  • Guest
Adding a water vortex effect
« on: June 04, 2021, 01:31:06 AM »
Hi,

I m looking into adding a water vortex effect, similar to what you would expect when stirring a liquid,
and I am trying to see how to implement that within Liquid Volume Pro.
At first, I was thinking about a vertex displacement in LVLiquidPassBase.cginc to add the vortex by moving
the vertexes down in a vortex shape according to their real position.

While this works to change the liquid height at the edge of the container, it wont change the height within the liquid container itself,
since this one is calculated as a line at the container-edge-height from one side of the container to the other,
see image where I manipulated the vertex positions to be lowered on the entire left side of the container.


I was hoping someone here could point me in the right direction of how to manipulate the liquid height at a given point within the container,
like lowering the liquid at some point in the middle while it stays high at the edge.

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 7103
    • View Profile
Re: Adding a water vortex effect
« Reply #1 on: June 07, 2021, 09:48:09 AM »
As you have discovered, changing vertices positions won't work. The shader uses raymaching to compute the liquid color at a single pixel in the fragment shader. There's no vertex displacement or usage here as a single cube with 8 vertices can render animated liquids inside it.
You could explore a particle system approach which could be superimposed to the liquid effect so it depicts some vortex animations, like bubbles flowing in the vortex or something like that.