# Part 09 | 버텍스 컬러를 이용해 봅시다

## 01 버텍스 컬러를 적용해 봅시다

버텍스 컬러를 적용하는 법

* 3ds Max 같은 3D DCC(Digital Contents Creation) 툴에서 그려오는 것
* 엔진 자체 기능을 이용해서 그리는 것 (유니티에는 Polybrush라는 패키지가 있다)

Package Manager에서 Polybrush 인스톨 > Tool > Polybrush > Polybrush Window > 가운데 삼각형 버튼 누르고 그리면

아무것도 보이지 않는다. 버텍스 컬러는 '기본적으로 출력되지 않기' 때문이다. 셰이더를 만들어서 버텍스 컬러를 보이게 만들어주어야 한다.

![](https://velog.velcdn.com/images/biomatrix117/post/509d6ef4-198f-4bc7-abc5-b61edf8c48b4/image.png)

Shader Graph를 만들어서 적용시킨 뒤에 Fragment에 Vertex Color를 연결시켜주면 버텍스 컬러가 출력된다.

## 02 버텍스 컬러를 이용한 작업을 해 봅시다

다른 텍스처와 곱하거나 더해서 응용할 수 있다.

이것을 잘 이용하면, 라이트맵을 베이크 할 수 없는 상황에서 엠비언트 오클루젼(Ambient Occlusion)처럼 이용하거나 저렴한 라이트맵처럼 이용할 수 있을 것.

Ambient Occlusion : 구석진 부분에 생기는 아주 어두운 음영

## 03 버텍스 컬러를 마스킹 기능으로 사용해 봅시다

버텍스 컬러는 일반적인 컬러와 동일하게 RGBA로 구성되어 있다. 하지만 버텍스 컬러는 일반적인 텍스쳐가 가지고 있어야 하는 UV와 아무 상관이 없기 때문에, 응용해서 사용할 곳이 많다. (UV가 바뀌어도 버텍스 컬러는 바뀌지 않는다)

![](https://velog.velcdn.com/images/biomatrix117/post/d9de9009-8306-467b-86ad-952102c4cf24/image.png)

Lerp 함수의 특성상 검은색 즉, 0인 부분은 A가 나오고 흰색 1인 부분은 B가 출력되어 버텍스 컬러의 R 채널에 따라 첫 번째 텍스쳐와 두 번째 텍스쳐가 섞여서 출력된다.

![](https://velog.velcdn.com/images/biomatrix117/post/2ce2b464-7470-4ff4-a665-a0d12d13b7b6/image.png)

Lerp를 여러 번 해주면 멀티 텍스쳐링도 가능하다.


---

# 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-09-or.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.
