# Part 15 | 커스텀 라이트 2

## 01 퐁(Phong)블린 / 퐁(Blinn-Phong) 반사 이론

Simple Lit = Diffuse Lambert + Ambient Color + Specular

가장 유명하고 전통적인 스페큘러 표현 방식은 퐁 반사(Phong Reflection)이다.\
이 공식의 기본 원리는 '**내가 보는 방향으로부터 반사된 방향에 조명이 있으면 그 부분의 하이라이트가 가장 높다**'이다.

스페큘러는 거울 반사를 의미한다.\
하이라이트는 '강한 조명을' 거울반사한 것을 의미한다.\
과거 컴퓨터의 연산 능력이 높지 않았을 땐 광원에 의한 스페큘러만 적당히 계산해주었다.

퐁 공식 : 노말 방향을 기준으로 조명 벡터를 반사하는 반사 벡터 R과 시선 벡터 V의 내적으로 스페큘러 표현 (반사벡터 계산이 옛날 기준으로 무거움) 블린-퐁 공식 : 시선 벡터와 조명 벡터의 중간 값인 하프벡터 H를 구하고, 이를 노말 벡터 N과 내적

## 02 퐁 반사(Phong Reflection) 만들기

![](https://velog.velcdn.com/images/biomatrix117/post/14c4748a-ab08-420f-8b32-9522adb9a0f1/image.png)

**Phong Specular 구현**

* directional light의 방향 벡터와 normal vector의 반사 벡터를 구하고 negate로 뒤집는다
* view direction과 dot product하고 saturate한다
* power 노드로 스페큘러의 넓이를 줄인다
* 마지막에 directional light의 color와 곱해준다

> **View Direction과 View Vector의 차이?**\
> View Direction : 길이가 1로 Normalize되어 있는지\
> View Vector : 길이가 Normalize되어 있지 않은, 순수하게 카메라와 버텍스와의 거리를 가지고 있는 노드

![](https://velog.velcdn.com/images/biomatrix117/post/215fefb6-667d-4341-8a66-c4a40a5c4589/image.png)

Lambert Light와 더해주면 정반사임이 확연히 드러난다.

## 03 블린 퐁 반사(Blinn-Phong Reflection) 만들기

![](https://velog.velcdn.com/images/biomatrix117/post/994b9444-26ad-4593-a37e-22eeef6cab4d/image.png)

**Blinn-Phong Specular 구현**

* 시선 방향 벡터와 빛 방향 벡터를 더한 후 Normalize하면 Half Vector가 된다
* Half Vector를 Normal Vector와 내적하고 saturate한 후 power로 크기를 줄이고 Color를 곱해주고 Lambert 더해주면 된다


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://lazyartisan.gitbook.io/note/main-page/books/urp/part-15-or-2.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
