- Home /
Question of Discussion. Not Unity Specific.
Water physics when it was in a bottle
Hi I am try to achieve water in bottle effect, but I have failed to do so, because I need to rise or lower water level based on the gravity...give me a hint how to achieve this.
Explanation of what you exactly require might be using some picture or a reference effect you've seen somewhere will be helpful for the people.
Also provide what you have tried till now.
I haven't seen that effect so far.... The thing is consider a water bottle or water tin which is filled with 3/4th of water... What will happen when u bend bottle I want to achieve the same effect....I am not asking about any code, I just want a hint on how to achieve that...
is this 2D like the picture or would it need to be a 3D solution (haha puns) if its in 2D I would suggest just using a texture that is based on world position or orientated to Physics.gravity, in 3D its probably less easy, but you could use a similer work around, if you can avoid doing it with fluid simulations, avoid it, multi variable calculus is tiring.
for "solution" :)
Does this need to be physically accurate? i.e. does the volume of the liquid need to remain constant as the container is tilted, or is it sufficient just to have the surface remain at the same height? A similar question was asked quite recently and I suggested creating a liquid mesh that filled the container, and either using the stencil buffer or a dissolve shader to gradually hide/show different amounts of that mesh starting from the bottom of the container, relative to the world normal.
Follow this Question
Related Questions
Dynamic water Effects 1 Answer
Water & Fabric compute shader 0 Answers
Liquid Particle Physics Rendering 1 Answer
2D Water in Unity 0 Answers
Shader Graph Water Vertex Manipulation, 0 Answers