How to Create Water in Reverse?

Home Forums AR Sandbox Forum How to Create Water in Reverse?

Tagged: , , ,

This topic contains 6 replies, has 5 voices, and was last updated by  mkaszuba 6 months, 3 weeks ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #102912

    jcadwell
    Participant

    Oliver or anyone else in the forum,

    I’d like to reverse the flow of water, to mimic oil migration which flows upwards. Is it possible to do so?

    And then, can we change the color of water to be black? I know we can then change the viscosity and flow rate, which would add to this effect.

    We would essentially simulate oil migration by generating an “oil cloud” at the low level basins, and watch the path of oil migrate to the highest peaks of elevations.

    Please advise, if this is doable.

    Thanks for your assistance.

    • This topic was modified 1 year, 5 months ago by  jcadwell.
    #102914

    Oliver Kreylos
    Moderator

    Changing the color is easy — it’s assigned in Shaders/SurfaceAddWaterColor.fs, and there are several threads about editing that shader for different effects here on the forum.

    To change the flow direction, you’d have to turn the gravity vector upside down. That should be easy, as g is defined as a member of the WaterTable2 class and only initialized in the constructors, and you could replace g=9.81f; with g=-9.81f;, but I can’t guarantee that there are no implicit assumptions about g being +9.81 elsewhere in the water simulation code.

    #102918

    jcadwell
    Participant

    Oliver,

    Thanks for the quick response. I’ll surely test it out and post any results.

    #103138

    nathanb
    Participant

    Did you ever have success with reversing the water flow direction (i.e., simulating a buoyant fluid)?

    #103142

    nathanb
    Participant

    So, from my own attempt it seems there is an implicit assumption that the gravitational term is non-negative, and values ≤ 0 produce a static fluid. Rather than try to address this limitation in the water simulation code, it seems a simpler workaround would be to invert the bathymetry before the calculation of the spatial gradients, fluid fluxes, etc. and then re-invert the resulting fluid texture grid back into normal depth space before the transformation to projector space.

    Optimistically I would like to think this could all be accomplished with the inclusion of two minus signs. Unfortunately, my MATLAB background has left me ill-prepared, and I’m having some trouble parsing the code.

    Any suggestions from anyone (or counterpoints as to why this wouldn’t work)?

    #103583

    robhull
    Participant

    jcadwell: Did it work and if so what was the part of the c code that had to be edited?

    #108343

    mkaszuba
    Participant

    Just wondering Nathanb, did you have any success in getting your flow direction reversed?

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.

Comments are closed.