-
Notifications
You must be signed in to change notification settings - Fork 13
[Note] Program 4.1
Juhwi Eden Kim edited this page Nov 4, 2019
·
3 revisions
- 삼각형 2개 * 6면 * 정점 3개 * 좌표 3개 = 108 개의 vertices를 넘겨줌
- 버퍼를 사용
- init()에서는 보통 한번 설정하는 것을, display()에서는 애니메이팅을 포함한 계속 업데이트되는 것이 들어감
- vertex 쉐이더와 fragment 쉐이더에 보통 같은 유니폼을 설정
- 정점과 관련하여 색깔을 다르게 설정하는 방법 : vertex 쉐이더에서 varyingcolor를 out으로 보냄 -> fragment 쉐이더에서 in으로 받아서 설정
- vertex 쉐이더의 position이 coord와 비슷한 역할을 함
- 기억할 게 너무 많아서 책 참고!