GM(Graphics Masters) CSE 이동형 CSE 최태준 CSE 신재훈
A type of NPR(Non-photorealistic rendering ) Describes object using parallel or cross lines Contour, tone, and curvature are represented by those lines. Density of lines and their overlaps are major factors to consider in implementing hatching.
Picture from Wikipedia
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
Major Issues Contour Tone Curvature Our Own Features Speed Lines Animation Tests
Contour shaking Multiple Contour drawing Picture from “Real-Time Pencil Rendering”
Detection Contour 1. Select two faces 2. Check angle between two faces using Normal Vector 3. If angle < 150 then If two faces share same edge then Assign Contour - Additional Check Routine : Suggestive contours for conveying shape Draw Contour 1. Draw additional two lines 2. Edge’s Vertex(x,y,z) => Line’s Vertex(x+r, y+r, z+r) 3. r = ~
Discrete multiple level of tones Mipmap for scaling Interpolation at each vertex Picture from “Real-Time Hatching”
Weight : 0 Weigh : 1 Weight : 2 Weight : 3 Weigh : 4 Weight : 5
For each Face For each Vertex 1) v = Normalize(VertexCoord – LightCoord) 2) n = VertexNormalVector 3) result = (v.DotProduct(n) + 1.0f) * 3.0f 4) 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%
Rotate textures for voluminousness 3-way Blending Each Vertex Per Face - Compute principal direction Use GNU Triangulated Surface Library( * From “Real-Time Pencil Rendering” paper
For each Face For each Vertex 1) Get Principal Directions of Vertex 2) angle = arctan(y / x) x : x of principal directions y : y of principal directions 3) Rotate texture by angle 4) Texture Mapping
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
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.
Any questions?