Upload
yong-gyun-im
View
1.113
Download
1
Embed Size (px)
DESCRIPTION
Citation preview
Chapter 15.
Blueprint Rendering and “Sketchy Drawings”
GPU Gems 2http://cafe.naver.com/shader
임용균 ([email protected])
Introduction
•image-space non-photorealistic rendering▫Blueprint rendering▫Sketchy drawing
Basic Principles
•To preserve images of intermediate ren-derings of the scene’s geometry
•To implement an edge enhancement tech-nique
•To apply depth sprite rendering
Intermediate Rendering Results
• 3D Geometry 를 texture 들에 렌더링하여 2D 데이터로 나타내는 것을 Intermediate Rendering Re-sults 라고 한다 . (G-Buffer)
• scene buffer, normal buffer, z-buffer
• Intermediate Rendering Results 를 한번 생성하고 뒤이은 렌더링 패스들에서 그것들을 이용한다 .
Edge Enhancement• image-space edge enhancement technique• siluette, border, crease edge• normal buffer 와 depth buffer 의 불연속성으로 edge 들을
검출한다 . ▫ 주위 텍셀을 샘플링하여 불연속성을 검사할 수 있다 .
• 검출된 edge 들을 텍스쳐에 렌더링 하여 edge map 을 생성한다 .
Edge Enhancement
Depth Sprite Rendering• depth testing 을 위한 추가적인 z-value 를 제공하는 2D
이미지를 depth sprite 라 한다 .a. z-value 를 포함하고 있는 고해상도 텍스쳐에 렌더링 한다 .b. fragment z-value 를 변경하는 특수화된 fragment
shader 를 적용한다 .c. 일반적인 depth-test 과정 후에 렌더링 한다 .
• depth sprite rendering 은 image-based render-ing 의 가시성을 올바르게 해결한다 .
Blueprint Rendering• 3D geometry 의 visible/non-visible edge 들을
추출한다 .▫ visible edge 는 카메라에 직접적으로 보이는 edge 이다 .▫ non-visible edge 는 3D geometry 에 가려지는 edge
이다 .
• edge 들을 추출하기 위해서 depth-peeling technique과 depth enhancement technique 을 합쳐서 사용했다 .
• visible/non-visible edge 들을 frame buffer 에서 합친다 .
Sketchy Rendering• visually important edges and surface colors• 3D geometry non-uniformly using uncertainty
Sketchy Rendering• intermediate rendering results 를 이용하여 edge 와 sur-
face color 를 표현한다 .• sketch 에 image-space 의 무작위 값을 적용 (uncertainty
value) 하여 이 텍스쳐들이 일정하지 않도록 (non-uniformly) 한다 .
Edges and Color Patches• edge enhancement technique 을 이용하여 edge
map 을 생성한다 .• 3D geometry 의 surface color 를 강조되는 색으로
텍스쳐에 평면적으로 렌더링한다 . (cartoon-like style)▫ 이 텍스쳐를 shade map 이라고 부른다 .
Applying Uncertainty• 프레임과 프레임 사이의 일치성 (coherence) 을 위하여
uncertainty value 를 나타내는 추가적인 텍스쳐가 필요하다 . (perlin noise)
• noise texture 는 offset texture 로 사용되며 edge, shade map 을 교란 (perturbation) 시킨다 .
• uncertainty value 값의 정도를 결정하기 위해 2x2 행렬을 사용한다 .
Applying Uncertainty• sketchiness effect 의 효과를 향상시키기 위해서 edge
map 과 shade map 의 perturbation 정도를 다르게 적용한다 .▫ offs = turbulence(s, t);
▫ offt = turbulence(1 - s, 1 - t);
Adjusting Depth• 특히 uncertainty 가 적용되었을때 original geometry
의 z-values 는 안쪽 지역에 존재 하지 않을 수 있다 . 외부 지역의 original geometry 에 z-values 가 존재하지 않을 수 있다 .▫ 장면의 다른 오브젝트들과 올바르게 상호작용하지 못 한다 .
• edge map perturbation 과 shade map perturba-tion 을 적용한 값중 작은 depth 값 depth map 에 적용한다 .
Variations of Sketchy Rendering
• Roughened Profiles and Color Transitions (a) (b)• Repeated Edges (c)
Controlling Uncertainty• image-space 에서 “ swim” 문제가 나타난다 . (shower-
door effect)• 이 문제를 극복하기 위해서는 ? uncertainty value 를
조절할 필요가 있다 .▫ uncertainty value 를 측정하기 위해 geometric proper-
ties 를 유지한다 .▫ 외부 지역의 uncertainty value 를 적어도 3D geometry
에 가깝게 유지한다 .
Preserving Geometric Properties
• uncertainty value 를 계산하기 위해 surface position, normals, curvature( 뒤틀림 ) 정보를 보존해 놓는다 .a. G-Buffer 에 추가로 geometric properties 를 렌더링
한다 .b. 화면에 정렬된 quad texture 에 기록되며 텍스쳐 좌표 (s,
t) 로 geometric properties 에 접근 가능하다 .c. uncertainty value 를 계산할 때 parameters 로 이용한다 .
• f : (s, t) <- (s', t')• f (s, t) = p(s, t, g(s, t)),
Enlarging the Geometry• mesh 의 각각의 vertex 들을 object space 에서 nor-
mal 방향으로 약간 이동 (shifting) 하면 된다 .▫ 단 surface 들이 모두 연결되어 있어야 하고 공유되는 vertex 들은
interpolated normal 값을 가져야 한다 .
• 3D geometry 를 확장함으로써 안쪽 지역뿐 아니라 바깥쪽 지역도 ( 원본 이미지의 근처 ) geometric properties 를 렌더링 할 수 있다 .▫ 안쪽 지역은 3d geometry 의 경계를 넘어서 스케치 될 수 있고
바깥쪽 지역은 안쪽 지역을 뚫을수 있다 .
Reducing the Shower-door Effect
• texture 에 확장된 3D geometry 의 object-space po-sition 을 렌더링 한다 . -> g(s, t)
• g(s, t) 를 기반으로 p() 를 이용하여 왜곡된 텍스쳐 좌표인 f(s, t) 를 계산할 수 있다 . f(s, t) = p(s, t, g(s, t)) (per-turbation)
• Fedge(s, t) 와 Fshade(s, t) 를 다른 행렬들을 이용하여 계산한다 .
Sketchy Rendering
Conclusion