The task is simple – add some kind of detail (PBR) in the rain. So this we have from the start.
Add a special option for materials to get wet (wood, asphalt and other rough surfaces become darker when it’s raining)
Change the ground shader, underfoot the same bare ground.
Slate in the rain becomes wet and darker but obviously not shine as a metal.
float4 position_with_offset = float4( view_space_position + normal * 1.3f, 1.0f ); float4 projected_position = mul( view_to_shadow, position_with_offset ); float rain_mask = saturate( read_rain_mask( projected_position ) ); // rain mask, where rain effect visible float roughness = gb.roughness; float fresnel = gb.fresnel; float metalness = saturate( ( dot( fresnel, 0.33 ) * 1000 - 500 ) ); float porosity = saturate( ( roughness - 0.5) / 0.1 ); float factor = lerp( 0.1, 1, metalness * porosity ); float3 to_eye = -view_space_position; diffuse_result *= lerp ( 0.85, ( factor * 5 ), rain_mask );
Add some details and dof. Perhaps that’s it.
Looks better and this is well.
In-game result with tone mapping.