본 내용은 <그래픽스 새싹코스 - 홍정모> 강의를 토대로 작성하였습니다. honglab에서 강의를 구매하실 수 있습니다.
Phong reflection model
- 조명이 빛을 반사해서 우리 눈에 어떻게 보이는 지에 대한 모델
- 물체가 조명을 받았을 때 Ambient + Diffuse + Specular로 표현

Diffuse
어떤 표면의 normal vector →n과 조명을 향하는 벡터인 →l이 있을 경우
빛을 받는 강도는 두 벡터의 각도와 관련이 있다
각도가 작으면 작을수록 빛을 많이 받고 크면 클수록 적게 받음각도가 0일 때 가장 값이 크다 → cos를 사용한다

구현 예시
const vec3 dirToLight= glm::normalize(light.pos - hit.point);
const float diff = glm::max(glm::dot(hit.normal,dirToLight),0.0f);

Specular
반짝거리는 느낌을 살릴 때 사용
반짝거린다 = 표면이 매끈하다
아주 매끈한 표면을 가정함




참고
Phong reflection model - Wikipedia
Phong reflection model - Wikipedia
From Wikipedia, the free encyclopedia Shading algorithm in computer graphics The Phong reflection model (also called Phong illumination or Phong lighting) is an empirical model of the local illumination of points on a surface designed by the computer graph
en.wikipedia.org
'그래픽스ㆍDirectX' 카테고리의 다른 글
[DirectX] 3차원 구 그리기(구, 직선 충돌) (0) | 2023.08.29 |
---|---|
[그래픽스 새싹코스] Separable Gaussian blur (0) | 2022.09.19 |
Ray Casting, Ray Tracing, Real-Time Ray Tracing (0) | 2022.06.06 |
[KUOCW] 13. 캐릭터 애니메이션 - 2. 본 스페이스에서 캐릭터 스페이스로 (0) | 2022.06.05 |
[KUOCW] 13. 캐릭터 애니메이션 - 1. 관절체 애니메이션 (0) | 2022.06.04 |
댓글