Lighting Model Shader

Unity Shaderlab/HLSL/CG

This is an art-directable lighting model that combines the necessary light source in a traditional standardized lighting model, which also adds features that allow artists to pick the environment light and direct light colors.

Direct Light: Lambert + Phong + Unity shadow

Ambient Light: Ambient Occlusion + 3 Different Ambient Light

bandicam 2022-05-16 15-52-20-273
bandicam 2022-05-16 17-49-25-667
bandicam 2022-05-16 17-46-29-047
bandicam 2022-05-16 17-40-26-395
bandicam 2022-05-16 17-42-57-538
bandicam 2022-05-16 17-39-17-914

Different Results

Direct Light Section
  1. BaseColor
  2. Light Color
  3. Specular Power
  4. Shadow (Unity Default Shadow)
Ambient Light Section
  1. Environment Light Intensity
  2. Environment Top Color
  3. Environment Middle Color
  4. Environment Bottom Color
  5. Ambient Light Occlusion (AO map)
+
捕获.PNG

Vertex & Fragment Shader

bandicam 2022-05-16 18-04-58-037.jpg
bandicam 2022-05-16 18-05-28-424.jpg

Updated Ver: Adding Ambient Cube Map and Fresnel

New Added Section
  1. Fresnel (n dot v)
  2. Cubemap (Cubemap texture sampling + Cubemap Mip according to glossiness)
  3. Emission Color and Intensity
  4. Texture Sampling

Properties Panel and Updated Codes

bandicam 2022-05-20 22-02-56-871.jpg
bandicam 2022-05-20 22-01-04-347.jpg
bandicam 2022-05-20 22-02-06-657.jpg