The Grand Theft Auto series has come a long way since the first opus came out back in 1997. About 2 years ago, Rockstar released GTA V. The game was an instant success, selling 11 million units over the first 24 hours and instantly smashing 7 world records.


References:

There is a guy named Adrian who explained about this GTA-V Graphics Study which was really interesting & well explained (but it's not specific for Unity Engine)! To be honest, After reading that blog I can't even sleep without trying something like that in Unity Engine. So, we made one (Just for education purpose!). I don't say it's 100% perfect! But we tried our best to get the similar graphics.

Today we're going to cover Subsurface Scattering (SSS), Player (Wet & Dry), Water Shader. 


Subsurface Scattering (SSS):

We used Custom Surface Lighting Shader which is easy compared to Vertex Fragment Shader (Just my opinion, maybe someone prefer Vertex Fragment Shader). Here some of you prefer Diffuse compared to the final one! but our target is to create similar to GTA-V Graphics.

We blurred the diffuse manually using Photoshop, because blurring image on runtime will cost some performance. And we used this reference https://johnaustin.io/articles/2020/fast-subsurface-scattering-for-the-unity-urp & https://docs.unity3d.com/Manual/SL-SurfaceShaderLighting.html to create the SSS Shader.


Player (Wet & Dry):

 At first we planned to use WorldPos based coordinate and then we realised it not gonna work properly! because while swimming player animation will be like laying on the ground so it will look like unrealistic or kinda glitchy look. So, we decided to use Secondary UV.




We unwrapped the Second UV Map like this, just to help shader to figure out the direction to draw wetness.


We're going to use Vertical Gradient Texture (Black & White) to control the height of wetness like shown in the above image/gif

if(_WetHeight > 0){
half _wetness = step (tex2D(_WetMap, i.uv2_WetMap).r, _WetHeight);
o.Gloss = lerp(o.Gloss, 0.8, _wetness);
o.Specular = lerp(o.Specular, 0.3, _wetness);
o.Albedo = lerp(o.Albedo, o.Albedo * 0.9, _wetness);
}

As result we got something like this!


Then we smoothStep the value to make it smoother


Water level was calculated separately using C# & we make it dry after some cooldown timer.


Water Shader:

We made this using common and simple water shader techniques! Well we already used this technique in our old projects Rysen Dawn & Spider-Man. Reference https://unitywatershader.wordpress.com/2018/05/12/transparency-refraction-and-depth 


That's all for today! If you want see more like this, make sure to subscribe our channel!! And I'm very sorry if my english was bad. I'll try my best to improve it next time.
Thank you.