Weathering Shader

Been having more fun with HLSL recently! Off the back of my alpha erosion shader, I wanted to use a similar technique to repilicate some weathering I saw on objects in the Napels National Archaeological Museum.


I started off by shifting the alpha erosion technique into an albedo blend. I added the erosion function to the albedo and then multiplied it by the albedo.

I then created a vertex function to push out all the verts within the eroded area along their normal. This gave me the raised blue surface. This could definitely look a lot more elegant but I think its not bad for a first try!

void vert(inout appdata_full v) { 
//Weathering float4 wm = tex2Dlod(_AlphaMask, float4(v.texcoord.xy, 0, 0)); 
float4 w = tex2Dlod(_Weather_Texture, float4(v.texcoord.xy, 0, 0)); 
wm = weathering_effect(wm, _Erosion); += lerp(0, v.normal * (_Erosion*.1), wm);

The last thing I added was AO for the raised area in order to look like it was giving us detail soft shadows. To do this, I used the erosion function again, but pushed the erosion amount so there were more dark areas. I then added this to an inverted version of the original erosion, to leave us with a line that fades out on both sides.


I added .2 to this so it wasn’t super dark, and got the small shadow that you see below.




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s