난반사 (Diffuse)
LightVector = normalize(Light.Position - Object.Position)
Diffuse = saturate(dot(LightVector, Normal)
정반사 (Specular)
LightVector = normalize(Object.Position - Light.Position)
Reflection = reflect(LightVector. Normal)
CameraVector = normalize(Camera.Positon - Object.Position)
Specular = pow(saturate(dot(Reflection, CameraVector)), SpecularPower);
주변광 (Ambient)
Diffuse + Specular + Ambient
'개발 > Graphics, Shader' 카테고리의 다른 글
Unity Matcap Shader (0) | 2021.01.20 |
---|---|
초간단 흑백쉐이더 (GrayScale) (0) | 2020.10.25 |
노말맵이 파란이유 (0) | 2020.09.17 |
공간 변환 (0) | 2020.08.03 |
정점 셰이더(Vertex Shader), 래스터라이저(Rasterizer) , 픽셀 셰이더(Pixel Shader) (0) | 2020.07.27 |