Cel shading By jared brock
Overview Project Description What I must implement What I would like to implement Technique: Cel-Shading What is cel-shading? Requirements for Cel-shading Generate Lighting Map Calculate Light intensity Draw the outline Demo Questions References
Project Description Render a model in 3D Implement multiple material shaders Use the shaders on the different pieces of the model Include cel-shading
Project description What I must do Implement multiple material shaders (steel, wood, leather, and plastic) Implement cel-shading Be able to use shaders on specific pieces of the model Be able to switch between multiple shaders What I would like to do Include multiple models Add a GUI for switching between shaders
Cel Shading What is cel-shading? - A type of shading that is used to mimic the style of a comic book or a cartoon
Requirements for cel shading Generate a Lighting Map Calculate Light Intensity Draw Outlines
Generating a Lighting Map A lighting map is a 1d grayscale texture Basically a strip of 16 colors Can modify the values to create different effects Texture is used as a lookup table
Calculating Light intensity N dot L Value is used as an index into the lookup table This works because N dot L returns the cosine of the angle between them Negative values are mapped to 0
Drawing the outline A cel shaded model is not truly cel shaded if the outline is not drawn
Drawing the outline Here are two possible methods for drawing the outline Use 2D Image Processing Render scene to screen sized color texture Render depth and world space surface normal to textures Apply an edge-detection filter to depth and normal textures to generate edge texture Combine edge texture with color texture Use Built-in OpenGL functions Render in wireframe mode Only draw back facing polygons Change the line width Render again normally
Demo
Questions?
references [1] S. Hamlaoui, “Cel-Shading,” http://www.gamedev.net/page/resources/_/technical/graphics-programming- and-theory/cel-shading-r1438 (current Jul 13 2001) [2] K. Khanyants, “Cel-Shading Explained Visually,” http://www.konlabs.com/articles_data/cel_shading/index.htm (current 2002) [3] J. Mahsman, “Fragment Shaders: Toon Shading,” http://www.cse.unr.edu/~mahsman/courses/cs791a/ Pictures came from http://media.giantbomb.com/uploads/0/8168/962251-dragon_ball_z_budokai_3.829418_super.jpg http://screenshots.en.sftcdn.net/en/scrn/315000/315790/borderlands-16-700x393.jpg http://www.rpgfan.com/reviews/zelda_windwaker/ww-2b.jpg