Upload
kristian-alexander
View
247
Download
5
Embed Size (px)
Citation preview
NON-PHOTOREALISTICRENDERING
- HATCHING & PENCIL DRAWING -
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.
Picture from Wikipedia
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
Implemented Features
Major Issues Contour Tone Curvature
Our Own Features Speed Lines Animation Tests
Major Issues - Contour
Contour shaking Multiple Contour drawing
Picture from “Real-Time Pencil Rendering”
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
Result - Contour
Major Issues - Tone
Discrete multiple level of tones Mipmap for scaling Interpolation at each vertex
Picture from “Real-Time Hatching”
Tone Texture – RenderMonkey SDK
Weight : 0 Weigh : 1 Weight : 2
Weight : 3 Weigh : 4 Weight : 5
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
Result - Tone
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
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
Result - Curvature
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
Result – Speed Line
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.
Result – Flag
Q & A
Any questions?