Looking for recommendations: Rain on glass

I know that there are plenty of water threads here, but none of them (I’ve searched) gives any hints on how to make water behave properly on obstacle surfaces. I’ve also never seen a blender-made water simulation that looks realistic in this aspect (usually the liquid flows freely on the surface, or doesn’t flow at all [no slip vs partial slip])

So I’d ask you guys for recommendations on how to make a simulation that can make water behave like water when sliding on a surface, and leve behind small drops of itself, or unusual shaped trails… something like this reference photo:

I’ve already tested several combinations of partial slip and no-slip on the surface of obstacles as well as the domain. None of them results in something close to the above image.

PS: I’m looking for an animated scene, so the water really needs to “flow”. I know I could render a static image that would look similar to that reference using meshes, but that is not the point.

EDIT: here’s a video reference of what I’d like to achieve:


Have you tried Dynamic Paint?

The real problem here is not just simulating the water, but also the surface it flows on. Water forms the trails and droplets mentioned as it flows over glass because of the minute imperfections in and/or dirt & debris on the surface, and the contamination of the surface by substances that affect the flow, such as oils. Even small amounts of these factors can have a significant effect on the resulting flow. And each & every drop will need to be simulated according to all these conditions. So unless you can find a full-tilt physical materials simulation application, and a massive machine to run it on for a few weeks, you’ll have to fake it.

The Dynamic Paint suggestion is a good one, as it can make use of particles as brushes and the resulting “paint trails” can be used to modulate the surface of a mesh, as demonstrated in a number of video tutorials. But there won’t be any out-of-the-box solutions, and you can expect to spend a fair amount of time developing the look you want. And it will be stylized rather than physically accurate. “Physically accurate” can be very expensive in terms of computation requirements.

EDIT: Also look into fluid particles as a means of getting closer to your final look.

Thanks for the ideas.
I agree that the droplets, trails and stuff are the result of imperfections, but the imperfection path could be simulated.

I’ve tried a simple displace deform on a glass material with water IOR, after that used a more sharp image of the water drops to mask the rest of the glass, this is the result so far:

It’s cycles of course. I’ve made the b&w drop quickly just to see how it would look. It may look good with a more detailed map, but yes, I’ve tried Dynamic Paint to create that b&w map, but it doesnt do it right… it must have the exact tonal decay and greyish color.
On top of that Cycles can’t use Image Sequences as textures. And when I select the focal point of the camera on the drops, and blur everything else, Cycles also blur the backdrop image reflections on the water…
But I’m getting there! Thanks

The constant width of the trails is not very naturalistic, but otherwise that’s a good start imo. Some things to consider for further testing that might help randomize the trails some:

Make your Dynamic Paint Brush from a lot of small particles that clump together. I’ve used Metaballs as Object particles for this effect (though on a larger scale) and it works OK, though they are touchy critters :wink: Maybe in combination with fluid particles and some mocked-up surface imperfections you’ll get a step closer to a convincing result?

Yeah I know, like I said the trail was just a visual test. The use of metaballs is a great idea!! I’ll test it!
It sounds like a great challenge on Blender, to use metaballs, particles and dynamic paint at once, as a way of simulating this. If it works it will be fantastic!

Good thing is, I’ve managed to make something better using Blender Internal, instead of Cycles, this means that now I could use an image sequence to make an animation.
This is the result:

I’ve come up with this idea after looking a tutorial for Cinema4D… the guy makes a set of mesh drops, uses them as particles on a surface, then renders a ZDepth map of those drops. I’ve used his map in the above image (you must turn on the Displace option on the texture tab), and as you can see it looks great. Now I’ll see if I can render a sequence of ZDepth images on Blender, using metaballs and dynamic paint, and maybe the result will look similar!

That latest image is looking very nice indeed! One thing, very much a fine detail but important to be fully convincing, is that while the positions of the individual droplets look random, their distribution across the pane does not, it’s too uniform in terms of the spacing between droplets. Not sure how that can be adjusted but doing so would be more natural-looking I think.

That is some seriously hard stuff to simulate, nature at it’s most irregular… If a client asked me to emulate that I’d either use a fluid sim like RealFlow or Naiad or - more likely - manually create a 2-colour template in HD video, convert it to BW and use it as a displacement map… I love the ‘hands on’ workarounds, hehe… ;D

The guy who made that z-depth map didn’t put a higher random size value to his particles, that’s why they look so similar.

Good news… I’ve managed to bake a z-depth map using a particle system with metaballs as particles!!! At first I thought my Blender crashed when trying to render, but it didn’t.
Using the map as displacement texture, this is the result:

Good thing about this is the fact that particles now join when close to each other, just like water droplets.
Now I must see if I can animate the particles down the glass, while some of them leave a trail (using dynamic paint)

You should be able to, as I have done so, though with significantly different visual goals in mind, so I can’t give you specific steps. In my setup, a large spray of metaball particles hit a plane set up as a colliding barrier, stick to it (no rebound to speak of), and slide down the face of the plane. They even drip off a bit before they vanish due to lifetime expiration. I haven’t made any attempt to get the effect physically natural-looking, but I think that’d just be a matter of experimenting with various parameters in the particle system and its collision.

Very cool. Lets face it, everything is possible, it’s just a question about finding the right workaround… :slight_smile:

While I like the metaball result, it is still not exactly what I’m going for here.
It looks nice, but too perfect… almost like drops that fell in a glass table for example, because the drops are not distorted downwards, which is the effect gravity have on water on a vertical surface. It reminds me of bubbles too, like, empty spaces instead of liquid spaces.

I’ll definitelly play some more with it, animate it like I said… but it would be good it there was some way of distorting the metaballs so it look like they are being affected by gravity. Other thing I must figure out is some way of influence the particles path so that they look like they are dripping, but not straight down the surface… some way of faking the imperfect path caused by the imperfect surface.

Yeah, I’ve been doing some testing also, found the same probs with the droplets being too perfect. Dynamic Paint seems to have some probs with its trails as well, in terms of matching particle size, and achieving some irregularity, but that’s still under testing.

The affect of gravity on raindrops is only the first consideration, because it’s surface tension and adherence that give the droplets their distinctive shape. This is a physical material property that isn’t a part of metaballs or other particle-type methods. There are fluid sim parameters that allow some adjustment, but that opens up a whole new can of physics-worms.

Because of the complexity of the factors that determine the look you’re trying to imitate, I think you’ll have to accept some compromises, at least as far as Blender’s physics capabilities are concerned, and do your best faking it. Depending on context, a significant amount of stylization should be perfectly acceptable.

Yeah the water trail is something that I could not match yet either.

I didn’t want to necro this thread, but since it’s mine, and I have updates on it, it may be useful for someone interested in achieving the same result.

With the upcoming Blender cycles support to normal maps, I managed to make an animated (still rough) water trail down the glass:

It has a lot of problems (obviously), and don’t think for a moment that it is the final result. It was a first kinda “succesful” test using dynamic paint without having to use loads of geometry to make the water have volume.

And here’s a rough test on a diffuse surface:
(this time I used a larger resolution and more samples on the render)

Regards, Ark

Good progress! The details of the physics still keep things stylized but the trailing and the refractive effects look very good so far.

They did this very convincingly in the game Heavy Rain. If I recall correctly speaking to one of the artists, what they did was set up a pane of glass against a green background and sprayed a red liquid on the glass slightly more viscous than normal water. They recorded the whole thing, sped it up in post, and converted it to a series of B/W images/normal maps that they could use in engine. Honestly, that’s probably easier than trying to do it by hand, even for a hobbyist.

I had to double check it, but yeah, I actually suggested that on the first page of this thread, a practical solution… :smiley: