Wet pavement or floor

I am trying to set a wet pavement material for my car based game.
It should reflect the car not like a mirror but as asphalt under the rain. I already sent the question to Unity Answers but got few answers. Maybe there is a shader around… Any suggestion from here?

Hmm… yeah, you’ll need a special shader if you want realism!

What if you only reflect the lights, though? On rainy days you can really see the car’s headlights reflected on the street! Yet cars are not seen reflected unless it’s too wet!
Put a noisy normal map so the lights get distorted slightly… and also give the specular channel some randomness… as if the water is displayed in poodles!


Material above is the default bumped specular…with noise as bump map, and a random specular channel so it looks like it has puddles

To get the best affect, your going to want to look into what a specular map is, used with a normal map, will get you there. As for shaders, theres a few shader packs on the asset store - chickens can get a look like you want, but doesn’t accept a specular map, just uses unity’s built in alpha grayscale system, advanced surface shaders does accept a specular input, letting you dial in what you’d be looking for more accurately, you might also want to check out hard surface shaders, as I suspect you could get a very good wet look with those too. I know I recently used it to fake some water :smile:

Hey,
if you don’t just have a wet street but real wholes filled with water, hard surface shaders is probably the best choice, as it supports Screen Space Reflections which would probably be the perfect solution for this case.
If the only issue preventing you from buying my package is a separate specularity map, just let my know. I can add that pretty quickly.
BUT you might not get the look you want out of a simple specular shader, not even a reflective one. (Can’t really say anything about Hard Surface Shaders, but i’m just assuming he uses Blinn-Phong, as they run on quite a low number of instructions. If i’m wrong, please correct me). Because as you can even see in the picture dogzerx posted, wet streets behave different than other surfaces when it comes to specularity.
I could give u the link to the Unreal Engine Samaritan Presentation, but sadly, this is the only topic that they simply don’t say anything about (at least not in the three different pdf version i have. Maybe there’s a fourth one) :smile:

Clip from Burnout 2: Point of Impact. Specular mapped and only headlights are reflected(saves big on resources and as stated above, you really don’t see the cars reflection.)

In this case its important to have the water spray off the wheels and the sound effect for driving on wet pavement. That is what will trick the mind into thinking the road is wet. Also don’t forget to make things a little more slippery when traveling with some speed. All of those together will make the pavement believably wet.

Ok, I am near to get what I wanted.
I am using the standard bumped specular shader with the normal map generated from the asphalt texure.
Light are with a low y (0.3) and ignore the car. On top of them I added other two lights.
only a last question @dogzerx: how you get the "random specular channel "? Should I edit the shader?:frowning:

Build a very low poly model and use that in the reflections. If you place the pivot correctly, you can just flip the low poly version upside down and render that in the wet parts. You might want to tag certain objects as reflected and only render those tagged to reduce the objects rendered in reflections.

This can also work for rear-view mirrors.

To do that you need a 32 bit image for the color map, or should I say image with transparency. The transparency channel is used as the specular channel. (TGA supports 32 bit)

On the asphalt color map, you should add a new channel. Within photoshop: go to the channel tab (where red green and blue channels are found), and create a 4th channel (as you do when creating a new layer).

On that newly created channel, put something that looks like puddles on a road, anything random should work (white is maximum specular, and black is no specular).

Save in a 32 bit format, TGA works perfectly!

*Same thing is done for materials with reflection, reflection and specular share the same channel! And materials with transparency also rely on the transparency channel to gather the transparency amount.

looks good, but the road seems too bumpy, at least for the roads I have seen here in the US. I would level off the max bump height to make the road look worn down a bit. That asphalt looks like it needs a steam roller to flatten it out a bit. Also, it seems a bit too grey on my monitor. I would darken the color a bit. But that’s based on the roads I have seen and I realize the whole world isn’t like the fraction I have seen of it. Other than these minor things it looks fantastic.

Also a small detail your number plate texture is mapped the wrong way round. The opel sign is too btw.

something about that asphalt isn’t working for me.
it’s possibly that the bumps are shiny on one side where as what a road is wet, it’s the water that reflects and the water is flat.

I think the bump is too sharp, makes it look dry instead of wet. Where water is the bump should be smoother! That bump should be ever so subtle, the slightest bump will distort the specular noticeably, only a tad bit is enough!

Nearly done (at least for my level)

The puddles ruin the scene IMO. Make them darker and more transparent. :wink:

I agree. The puddles ruin your amazing asphalt.

Also, the headlights have too strong of a flare effect and illuminate too much under the vehicle. Assuming they are spot lights (which they should probably be for the best effect), they should have their distance and angle adjusted. This will enable a more cone shaped reflection on the pavement. I know you are more concerned about the asphalt, but its just a tip to make the lights look more real.

Looking at your screen shot makes me want to go play some Burnout 2, my favorite racing game.

You’ve nailed it with that asphalt, I’m really digging it!

For the mesh puddles, I agree completely with carking1996! darker and reflective!

@dogzerx: it would be nice you could share the material used in your picture with 10 lights…

Thats what puddles look like! You might not know since you live in sunny italy :stuck_out_tongue:

That is how bad road looks like.

That’s what all roads in England look like. I was talking about the puddle not the road haha