UnityEngineCharacter Skin Transition Shader2022-11

Implemented with HLSL and ShaderGraph for the URP in Unity
Shader GraphShaderLabURPVertex ShaderFragment Shader
View on GitHub

Implementation

  • Creating alternative textures in Affinity Photo.
  • Using Shader Graph to setup a Lit Shader Graph, to benefit from the Lighting Model to use Metallic, Smoothness and Emission.
  • Create a reusable Sub Graph in Shader Graph, to transition the Main Texture and the Emission Texture.
  • Custom Function node using an HLSL function to transition between two textures, given a threshold position and width.
  • Use HDR to be able to define intensity for the threshold band.
  • Post Processing Bloom effect to pick up the threshold band and generate a Glow effect.
  • Manual Fresnel effect in a custom Unlit Shader using Cg.
  • Fresnel achieved by doing the dot multiplication between the World Normal of the Fragment and the View Dir in World Space.
  • C# Script to pass the position of the Scanner object to the Material holding the Shader, so it can move the threshold up and down.