20
NON-PHOTOREALISTIC RENDERING - HATCHING & PENCIL DRAWING - GM(Graphics Masters) CSE 20011266 이이이 CSE 20021139 이이이 CSE 20061174 이이이

GM(Graphics Masters) CSE 20011266 이동형 CSE 20021139 최태준 CSE 20061174 신재훈

Embed Size (px)

Citation preview

Page 1: GM(Graphics Masters) CSE 20011266 이동형 CSE 20021139 최태준 CSE 20061174 신재훈

NON-PHOTOREALISTICRENDERING

- HATCHING & PENCIL DRAWING -

GM(Graphics Masters)CSE 20011266 이동형CSE 20021139 최태준CSE 20061174 신재훈

Page 2: GM(Graphics Masters) CSE 20011266 이동형 CSE 20021139 최태준 CSE 20061174 신재훈

What is hatching?

A type of NPR(Non-photorealistic rendering)

Describes object using parallel or cross lines Contour , tone, and curvature are repre-

sented by those lines.

Density of lines and their overlaps are majorfactors to consider in implementing hatching.

Page 4: GM(Graphics Masters) CSE 20011266 이동형 CSE 20021139 최태준 CSE 20061174 신재훈

Develop Environment

OpenGL Visual Studio 2005 C++ Other Resources

OBJ files Jpeg decoder : CxImage Library GTS Library(GNU Triangulated Surface Library) Tone Texture : RenderMonkey SDK OBJ2GTS : Selfmade App For Converting

Page 5: GM(Graphics Masters) CSE 20011266 이동형 CSE 20021139 최태준 CSE 20061174 신재훈

Implemented Features

Major Issues Contour Tone Curvature

Our Own Features Speed Lines Animation Tests

Page 6: GM(Graphics Masters) CSE 20011266 이동형 CSE 20021139 최태준 CSE 20061174 신재훈

Major Issues - Contour

Contour shaking Multiple Contour drawing

Picture from “Real-Time Pencil Rendering”

Page 7: GM(Graphics Masters) CSE 20011266 이동형 CSE 20021139 최태준 CSE 20061174 신재훈

Implemented Contour

Detection Contour1. Select two faces2. Check angle between two faces using Normal

Vector3. If angle < 150 then • If two faces share same edge then• Assign Contour

- Additional Check Routine : Suggestive contours for convey-ing shape

Draw Contour1. Draw additional two lines2. Edge’s Vertex(x,y,z) => Line’s Vertex(x+r,

y+r, z+r)3. r = -0.002 ~ +0.002

Page 8: GM(Graphics Masters) CSE 20011266 이동형 CSE 20021139 최태준 CSE 20061174 신재훈

Result - Contour

Page 9: GM(Graphics Masters) CSE 20011266 이동형 CSE 20021139 최태준 CSE 20061174 신재훈

Major Issues - Tone

Discrete multiple level of tones Mipmap for scaling Interpolation at each vertex

Picture from “Real-Time Hatching”

Page 10: GM(Graphics Masters) CSE 20011266 이동형 CSE 20021139 최태준 CSE 20061174 신재훈

Tone Texture – RenderMonkey SDK

Weight : 0 Weigh : 1 Weight : 2

Weight : 3 Weigh : 4 Weight : 5

Page 11: GM(Graphics Masters) CSE 20011266 이동형 CSE 20021139 최태준 CSE 20061174 신재훈

For each FaceFor each Vertex

1) v = Normalize(VertexCoord – LightCoord)2) n = VertexNormalVector3) result = (v.DotProduct(n) + 1.0f) * 3.0f4) weighting(result) • Weight => 0.0 ~ 6.0

5) Blend Texture Image - MultiTexture• If weight is 3.4 => weight 3 : 60%, weight 4 :

40%• If weight is 5.5 => weight 5 : 50%, weight 5 :

50%

Implemented - Tone

Page 12: GM(Graphics Masters) CSE 20011266 이동형 CSE 20021139 최태준 CSE 20061174 신재훈

Result - Tone

Page 13: GM(Graphics Masters) CSE 20011266 이동형 CSE 20021139 최태준 CSE 20061174 신재훈

Issue - Curvature

Rotate textures for voluminousness 3-way Blending• Each Vertex Per Face - Compute principal di-

rection Use GNU Triangulated Surface Library(

http://gts.sourceforge.net/)

* From “Real-Time Pencil Rendering” paper

Page 14: GM(Graphics Masters) CSE 20011266 이동형 CSE 20021139 최태준 CSE 20061174 신재훈

For each FaceFor each Vertex

1) Get Principal Directions of Vertex2) angle = arctan(y / x)

x : x of principal directionsy : y of principal directions

3) Rotate texture by angle4) Texture Mapping

Implemented - Curvature

Page 15: GM(Graphics Masters) CSE 20011266 이동형 CSE 20021139 최태준 CSE 20061174 신재훈

Result - Curvature

Page 16: GM(Graphics Masters) CSE 20011266 이동형 CSE 20021139 최태준 CSE 20061174 신재훈

Our own Features – Speed Line

To express speed effectively in hatching, we used extra lines.

The faster object moves, the longer lines are drawn.

Speed line is expressed with gradation to express gradual speed change

Page 17: GM(Graphics Masters) CSE 20011266 이동형 CSE 20021139 최태준 CSE 20061174 신재훈

Result – Speed Line

Page 18: GM(Graphics Masters) CSE 20011266 이동형 CSE 20021139 최태준 CSE 20061174 신재훈

Our own Features – Flag

Flag animation is rendered to show that hatching can well render dynamic scenes.

Flag is set by basic rectangular lattice.

Flag animation is done as z value changes along sin function.

Like water animation.

Page 19: GM(Graphics Masters) CSE 20011266 이동형 CSE 20021139 최태준 CSE 20061174 신재훈

Result – Flag

Page 20: GM(Graphics Masters) CSE 20011266 이동형 CSE 20021139 최태준 CSE 20061174 신재훈

Q & A

Any questions?