# how to turn (or solidify) water or fuild into solid material (Renderring Effect)

i want to implement an effect like this. for example, let's assume the clay are made of particles. liquids of clay flows for a while, then it becomes dry and rest.finally those particles becomes only one polygon, "dry clay". so i ask your disciplined gamedev guys, if you were me, how did you somehow implement this? BTW, this effect was a bit like mobile game , call "where's my water".

EDIT: sorry for my bad english. i've try to describe this question more detailed.. btw, a solution comes into my mind is use convex-hull-algorithm to outline the "dry clay", then triangulating the only one polygon into mesh, and using shader does smooth transition to implement fluid(or something else ) to simulate drying process for a while.

• You could try to organize the question better. I tried to answer,not sure if it helps. Also, try to use the right tags, those suggest its a rendering problem, and while it partially is, physics and particle simulation are more adequate. – Grimshaw Dec 8 '14 at 2:39

Personally, I would pass the array of liquid, free flowing particles into an array of inter connected, rigidly attached particles.

Basically, I am saying to take the hint of your physics code, that let's you know when a particle's rigid body went to sleep by having its velocity reach or approach 0 for enough time. Use this information to weld particles together as they stack by themselves.

Now, depending on your processing power available, you could: 1) Use a joint to attach touching particles, making them stick to each other up until a point where all particles are together, making the fluid not so fluid anymore. 2) Just remove the particle from the simulation, counting it as solid forever. As more particles go to "sleep", you continuously build a mesh to render instead of the particles. In the end you have no more particles but only a mesh / texture with the static fluid representation.

Depending on whether the solid can go back to a fluid, you'll have to keep the particle information alive, otherwise you can optimize by losing unnecessary data.

I am not 100% sure if I understood the question as a whole, but still, while I tried to explain how to solidify independent particles as far as physics would go, on the rendering side I would suggest to:

1) If using all particle information, do some kind of volume splatting (I think I got the name right? ), by rendering all particles as some kind of blob into a render texture. Then, you blur and grow a bit these hard edges particles so they overlap each other, and finally apply a filter that detects where there is color above a threshold, count it as a pixel inside the fluid, otherwise exclude it. This gives you a nice smooth shape for the fluid with no empty space in the middle, usually. You can then color it in different ways, but that depends on the material and your game graphical style. Then just render your fluid texture to the main level, and apply clipping if you need to make hard borders for the fluid, as to fit inside a container etc. Please someone correct me if I said something wrong here.

2) Otherwise just render the generated mesh, with or without similar technique as above.

Please provide more information in the question if other people also find it a bit vague. Hope this helps.