Sign in to follow this  
jstroh

How To Make A Surface Look Wet?

Recommended Posts

MJP    19790
Yeah animating a normal map with a super-high specular exponent should get you most of the way towards what you want. Maybe even blend between the regular normal map, and one that's animated reflecting the moving water.

Share this post


Link to post
Share on other sites
jstroh    100
Quote:
Original post by MJP
Yeah animating a normal map with a super-high specular exponent should get you most of the way towards what you want. Maybe even blend between the regular normal map, and one that's animated reflecting the moving water.


Sounds easy enough ;o

Now for a harder problem.

Are there any published techniques for animating liquid flow down a character's texture?

Share this post


Link to post
Share on other sites
Sneftel    1788
Bizarrely enough, there are. See section 5 of this. That's for flat glass surfaces, but extending to other locally flat surfaces should be simple.

Share this post


Link to post
Share on other sites
Drilian    1067
Also note that surfaces generally darken when they're wet (pour water onto concrete, stone, or wood to see what I mean), so turning down the diffuse color a little bit will also add to the effect.

Edit: Specifically, check out this paper on NVidia's Cascades demo. It's D3D10 specific and there's a lot in there that you don't need, but they do have a bit about making things look wet in it.

Share this post


Link to post
Share on other sites
spek    1240
Besides of the super soaker that Numsgil suggested, I make use of a cubeMap. Lots or surfaces already reflect a little bit, but when wet, just increase the reflectivity factor. GTA IV had some nice wet streets with this effect. An environment map that reflects the surrounding world is applied on all surfaces.

If its raining, you could distort that reflection map with noise. You could draw a texture with a few frames that distort the normals used for getting the reflection:

vector.xy += tex2D( rainNoiseMap, texcoords(currentframe) ).xy * factor;
reflection = texCUBE( enviMap, vector );

Vertical walls could have an extra texture that animates drips going down. Increase the reflectivity for these drops somewhat more, and distort the reflection again. Draw a texture with a few drips and let ir roll vertically over the wall.

Just like in reality, some spots get a pool while others remain relative dry. For the horizontal floors pointing upwards, you might want to use a "bumpmap" with a negative offset for the reflectivity. Like in reality, you will first see water in bumps. And when drying up, the bumps will dry-up at last:

environmentReflectivity = saturate( rainDuration - tex2D( bumpMap, texcoords ) ) * materialWetnessFactor;

Street covered with black pixels from that map will be wet first, white pixels at last. The "rainDuration" factor increases slowly and will fill the streets with water. when the raining stops, this factor decreases back to 0 again.

[edit]
Whoops poops, almost forgot. Depending on the absorption of a material, you might want to darken its color.

// Lerp between original color and the absorbed color, based on the
// wetness we calculated earlier
diffuseTextureColor =
lerp( diffuseTextureColor, diffuseTextureColor * materialMaxAbsorptionColor,
environmentReflectivity );

Plastic or metal absorbs nothing, so their color stays the same (absorptionColor = (1,1,1)). Concrete gets a little bit darker/brownish (absorptionColor = (0.9, 0.8, 0.6) ). Sand gets dark brown, etcetera.

Hope that helps,
Rick

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this