A stylized shader pipeline that integrating stylization into physically based rendering.
Listing some shader functionalities
Modifying the Projection Matrix in the vertex shader to translate the Perspective Projection to Orthographic Projection on specific materials based on a threshold. so the perspective removed object will be able to fit in normal perspective environment. Nice to have on anime/stylized rendering.
Standard: Inverted Fresnel with offset based on the light direction
Screen Space: screen space depth offset based on the view space light direction.
Bands based ramp
Mihoyo Anime CG Rendering Layered Ramp Texture
Cel Shading
Blinn Phong Specular with smoothstep, correctly remapped with roughness and metallic parameter
Direct Lighting:
[2018] Call Of Duty: WWII Multi Scattering Diffuse BRDF
GGX Normal Distribution Function
Smith GGX Visibility Term
Charlie Normal Distribution Function
Ashikhmin Visibility Term
Energy-Conserving Wrapped Cosine Lobe Diffuse
Two Layer KajiyaKay Strand Specular
Tangent Map
Isotropic Environment Mapping: Unity built-in approximation on UE split sum DFG LUT
Anisotropic Environment Mapping: using anisotropic modified normal as reflection vector
Cloth Environment Mapping: split sum DFG LUT for cloth
Refraction/Reflection
Custom CubeMap/ SphericalMap
Toony Interpolation
Modified Iridescence BSDF
Reference: https://belcour.github.io/blog/research/publication/2017/05/01/brdf-thin-film.html
Modified clearcoat BSDF
Screen Space Hair Shadow(Render Feature):
Use RenderFeature to generate the RT of a hair depth Pass (use Layer Mask to determine whether it is a hair part), and then use a uv pair in the lighting Pass to make an offset value according to the lighting direction It samples and compares it with the character's current depth, and the difference is the shadow of the hair.
Hand painted shadow with view space light direction UV offset :
Using UV offset to achieve hair shadows that change according to the direction of the light is also a better solution, but it is much better in performance than screen space hair shadows.
Unity exposed SkinnedMeshRenderer.GetVertexBuffer() API since Unity 2021.2.0, so that it is possible to get skinned VBO, and then use ByteAddressBuffer to pass it to Shader (because DX11 only allows Raw to pass VBO/IBO) by using DrawProcedural() in RenderFeature to achieve Skinned GPU Instancing.
Created by Collaborator
Modified SSS from GDCVault: Approximating Translucency for a Fast, Cheap and Convincing Subsurface Scattering Look
Modifications:
-
Add a custom surface depth param into the back lit calculation,
-
Add some modified Fresnel like equation on both front and back lit.
-
Parallax Refraction
Modified Matcap calculation to reduce to stretch at the viewing edge area
- View Space FOV applied constant width outline
- light space outline
- Bayer 4x4
- Bayer 8x8
- Custom Dither Texture
Some General Parallax Mapping Techniques: Used in Eye, Gem, Bump Materials
A general Shader GUI Framework in Unity, written in order to write minimal code and keep it flexible and easy to use. The combination of Unity Material Property Drawer API and additional regex based shader file analyzation.
Using FBX SDK to modify fbx file to bake the smoothed normal into the vertex color or UV Channels for fixing outline breaking issue
Based on URP RenderFeature, A buffer swapped postprocessing framework. Be able to insert custom post processing in custom render event.
Generating shader based on the features used. It will strip all shader variants and replace with constant value.
A simple tool created in maya for batching furshell creation process
Shell Generation Process:
- Duplicating Selected Mesh based on the assigned layer amount.
- Vertex Painting on each Mesh based on the current layer index.
- Combine these duplicated meshes, and cleanup history and scene.
- Find the Root joint and bind it to the mesh skin through skin cluster.
- Copy the skin weight from the source skin cluster to the combined skin cluster.
- Delete source mesh