1 / 8

컴퓨터 그래픽스 특론

컴퓨터 그래픽스 특론. Cartoon Effect 201097104 장 혁. Cartoon Effect. Normal, 조명 , 만화화법 묘사를 설명하는 GPU 효과 . 극단적인 색상 팔레트 감소로 rendering 하는 것을 통해 실행 . 색상은 표면 위치에 도착하는 직접 조명의 강도에 따라 선택. Vertex Shader. Varying 부분은 Fragment Shader 로 normal 을 보내기 위해 사용되었다 .

Download Presentation

컴퓨터 그래픽스 특론

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 컴퓨터 그래픽스 특론 Cartoon Effect 201097104 장 혁

  2. Cartoon Effect • Normal, 조명, 만화화법 묘사를 설명하는 GPU 효과. • 극단적인 색상 팔레트 감소로 rendering 하는 것을 통해 실행. • 색상은 표면 위치에 도착하는 직접 조명의 강도에 따라 선택.

  3. Vertex Shader • Varying 부분은 Fragment Shader로 normal을 보내기 위해 사용되었다. • Normalize 부분은 해당 Matrix로 vertex normal을 곱해서 변환 값을 할당한다. • 위치가 화면 공간으로 변환되는 부분인 기존에 사용되었던 gl_Position부분을 PDF에서 주어진대로 내장함수를 적용하였다.(같은 의미이므로 기존에 사용했던 것을 사용해도 무방함.)

  4. Fragment Shader • Ld : Light Direction (빛의 방향), Ity : Intensity (빛의 강도 값) • Varying 부분은 Vertex Shader에서 보내진 normal 값을 받아 들인다. • 빛의 위치는 내장 함수인 gl_LightSource[0].position 으로 가져와 빛의 방향을 계산하는데 사용한다. 광원이 여럿일 경우 기본 배열대신 for문을 이용한 배열을 사용한다. • Intensity 값은 0~1 값이기 때문에 float 형태로 받고 ld 값과 normal 값을 이용해 내적으로 계산한다. • Intensity 값은 네 단계로 나누어 각각의 밝기를 나타낸다.

  5. Main (1) • 이번 Cartoon Effect 에서는 Geometry 부분을 통과하지 않고 Vertex에서 곧바로 Fragment로 넘어갔기 때문에 initGLSL함수에서 Geometry 부분을 주석처리 하였다.

  6. Main (2) • initGLSL함수에서 정의한 glUseProgram을 사용하는 것인 TRUE로 바꿔주었다.

  7. Result • 결과화면으로 빛의 위치에 따라 빛의 강도가 네 단계로 표현되는 것을 볼 수 있다.

  8. 감사합니다.

More Related