CPSC 591/691 Lab Assignment: Attribute-Based Texture Mapping Based on the paper: X-Toon: An extended toon shader Barla et al, NPAR ‘06 PDF + video here:

Slides:



Advertisements
Similar presentations
Hofstra University1 Texture Motivation: to model realistic objects need surface detail: wood grain, stone roughness, scratches that affect shininess, grass,
Advertisements

Graphics Pipeline.
Projective Texture Mapping
1 Understanding of OpenGL TA: Dong Hyun Jeong Instructor : Dr. Kalpathi Subramanian Texture Mapping.
OpenGL Texture Mapping
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Textures II Week 8, Wed.
MAT 594CM S2010Fundamentals of Spatial ComputingAngus Forbes Overview Today: - Make sure everyone is set up with an OpenGL environment - OpenGL basics:
Hofstra University1 Texture Motivation: to model realistic objects need surface detail: wood grain, stone roughness, scratches that affect shininess, grass,
CSC345: Advanced Graphics & Virtual Environments
OpenGL Texture Mapping
OpenGL Texture Mapping Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
ADDITIONAL TIPS Multi-texture Slides. Here is a link Workflow: /**************In texture parameter set up******/ call glActiveTextureARB(/*pick texture.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Models and Architectures Ed Angel Professor of Computer Science, Electrical and Computer.
OpenGL Texture Mapping April 16, Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Basic Stragegy Three steps to applying a texture.
CS 4731: Computer Graphics Lecture 17: Texturing Emmanuel Agu.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Texture Mapping A way of adding surface details Two ways can achieve the goal:  Surface detail polygons: create extra polygons to model object details.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
Programmable Pipelines. Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
Texture Mapping. To add surface details… World of Warcraft, Blizzard Inc. More polygons (slow and hard to handle small details) Less polygons but with.
Computer Graphics Texture Mapping Eriq Muhammad Adams
Programmable Pipelines. 2 Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
2IV60 Computer Graphics set 10: Texture mapping Jack van Wijk TU/e.
Fundamentals of Computer Graphics Part 9 Discrete Techniques prof.ing.Václav Skala, CSc. University of West Bohemia Plzeň, Czech Republic ©2002 Prepared.
1 SIC / CoC / Georgia Tech MAGIC Lab Rossignac Textures and shadows  Generation  Mipmap  Texture coordinates,
Lecture 8: Texture Mapping 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 718,  ex 2271
Texture Mapping. Scope Buffers Buffers Various of graphics image Various of graphics image Texture mapping Texture mapping.
Texture Mapping. Example Mappings Mapping Techniques Consider the problem of rendering a sphere in the examples The geometry is very simple - a sphere.
Texture Mapping Course: Computer Graphics Presented by Fan Chen
Computer Graphics Ben-Gurion University of the Negev Fall 2012.
Mapping method Texture Mapping Environmental mapping (sphere mapping) (cube mapping)
Shading & Texture. Shading Flat Shading The process of assigning colors to pixels. Smooth Shading Gouraud ShadingPhong Shading Shading.
ECSE-4750 Computer Graphics Fall 2004 Prof. Michael Wozny TA. Abhishek Gattani TA. Stephen
Graphics Systems and OpenGL. Business of Generating Images Images are made up of pixels.
CSC 461: Lecture 3 1 CSC461 Lecture 3: Models and Architectures  Objectives –Learn the basic design of a graphics system –Introduce pipeline architecture.
CS380 LAB IV OpenGL Jonghyeob Lee Reference1. [OpenGL course slides by Rasmus Stenholt] Reference2. [
Texture Mapping. 2 Motivation A typical modern graphics card can handle 10s of millions of polygons a second. How many individual blades of grass are.
OpenGL Texture Mapping. 2 Objectives Introduce the OpenGL texture functions and options.
Texture Mapping Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
CS 480/680 Computer Graphics OpenGL Texture Mapping Dr. Frederick C Harris, Jr. Fall 2011.
1Computer Graphics Lecture 4 - Models and Architectures John Shearer Culture Lab – space 2
Representation. Objectives Introduce concepts such as dimension and basis Introduce coordinate systems for representing vectors spaces and frames for.
Texture Mapping Drawing Pictures on Polygons. Texture Mapping.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
TEXTURES & OTHER GOODIES Computer Graphics. glTexCoord2f(...); + =
Computer Science Term 1, 2006 Tutorial 2 Assignment 3 – The Virtual World.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
TEXTURE CSE 410. Add Texture to Polygon glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D,texid); // here texid corresponds a bitmap image. glNormal3f(1.0,0.0,0.0);
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
RENDERING Introduction to Shading models – Flat and Smooth shading – Adding texture to faces – Adding shadows of objects – Building a camera in a program.
11/5/2002 (c) University of Wisconsin, CS 559 Last Time Local Shading –Diffuse term –Specular term –All together –OpenGL brief overview.
Details of Texture Mapping Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Monday, December 1, 2003.
X-Toon: An Extended Toon Shader Pascal Barla, Joelle Thollot ARTIS GRAVIR/IMAGE INRIA Lee Markosian University of Michigan.
MP3.. Start at the very beginning. Almost. Either start from nothing yourself, or use the empty template for this MP. Run through the provided files are.
Texture Mapping CEng 477 Introduction to Computer Graphics.
Madhulika (18010), Assistant Professor, LPU.
© University of Wisconsin, CS559 Spring 2004
OpenGL Texture Mapping
Models and Architectures
texturing a parametric surface
OpenGL Texture Mapping
Computer Graphics, Lee Byung-Gook, Dongseo Univ.
Assignment 3b Q&A.
© University of Wisconsin, CS559 Fall 2004
3D Game Programming Texture Mapping
OpenGL Texture Mapping
OpenGL Texture Mapping
Programming Textures Lecture 15 Fri, Sep 28, 2007.
OpenGL Texture Mapping
Presentation transcript:

CPSC 591/691 Lab Assignment: Attribute-Based Texture Mapping Based on the paper: X-Toon: An extended toon shader Barla et al, NPAR ‘06 PDF + video here: plus lectures on view-dependent mapping

Mapping a Texture Based on parametric texture coordinates glTexCoord*() specified at each vertex s t 1, 1 0, 1 0, 01, 0 (s, t) = (0.2, 0.8) (0.4, 0.2) (0.8, 0.4) A BC a b c Texture SpaceObject Space

s t 1, ( s A, t A ) = ? A B C a Texture Space N. L Object Space Lambertian (diffuse) shading (view-independent) Attribute-based Texture Mapping ( s C, t C ) = ? ( s B, t B ) = ? D Tone detail (view-dependent)

s t 1, s A = N A. L A B C a Texture Space N. L Object Space The horizontal axis (0 <= s <= 1) corresponds to tone – the texture coordinate along that axis is derived from a standard Lambertian shading computation: N. L, where N is the unit surface normal and L is the unit light direction. s B = N B. L s C = N C. L (s-axis)  Lambertian (Diffuse) Shading (view-independent)

s t 1, t A = D (z A, N A, …) A B C a Texture Space D Object Space The vertical axis (0 <= t <= 1) corresponds to tone detail: each value t along this axis (labelled D for detail) corresponds to a view-dependent attribute. t C = D (z C, N C, …) t B = D (z B, N B, …) (t-axis)  Tone Detail (view-dependent)

s t 1, t A = D (N A, V, r) A B C a D t C = D (N C, V, r) t B = D (N B, V, r) Orientation-based attribute mapping n and v are the unit normal and view vector, respectively, and r >= 0 is a user-defined parameter that controls the magnitude of the effect. (t-axis)  Tone Detail (view-dependent)

Orientation-based attribute mapping Near-silhouette abstraction and backlighting

Orientation-based attribute mapping Plastic and metal highlights

s t 1, t A = D (z A, z min, r) A B C a D Depth-based attribute mapping z is the computed depth of a vertex relative to the eye; Two user-specified parameters: zmin, the distance at which the detail starts decreasing, and r >1, the scale factor that defines the coarsest detail (greatest abstraction) at distance zmax = rzmin. t C = D (z C, z min, r) t B = D (z B, z min, r) (t-axis)  Tone Detail (view-dependent)

Depth-based attribute mapping Toon shading

Depth-based attribute mapping Aerial Perspective

User Interface Load 3D models Load textures Move camera and light source Tone detail effects: – Select particular effect (use correct textures and tone detail D function) 1.Orientation-based: Near-silhouette abstraction and backlighting 2.Orientation-based: Plastic and metal highlights 3.Depth-based: Toon shading 4.Depth-based: Aerial Perspective – Control specific parameters (tone detail D function): Orientation-based: user control of parameter r Depth-based: user control of parameters zmin and r

Textures (1): Orientation-based Effects Near-silhouette abstraction and backlighting (fig. 10) Plastic and metal highlights (fig. 11)

Textures (2) : Depth-based Effects Toon (quantized) shading (fig. 7) Aerial perspective (fig. 9)

Models Sphere (great for testing/validating all mapping effects) Bodies, Mechanical Parts Heads Terrains

Loading Bitmap Texture extern int LoadBitmap(char *filename); texture.h/cpp at texture_load_exec.zip from Then you can load the texture bytes to texture memory by: my_model.id_texture=LoadBitmap("texture-name.bmp"); tutorial3.cpp at texture_load_exec.zip See example at

Loading Bitmap Texture GLubyte *teximage; int teximageWidth, teximageHeight; void Init(){... teximage = TextureLoadBitmap(“test.bmp”, &teximageWidth, &teximageHeight); } void display() {... glEnable(GL_TEXTURE); glTexImage2D(GL_TEXTURE_2D, 0, 3, teximageWidth, teximageHeight, 0, GL_RGB, GL_UNSIGNED_BYTE, teximage); /* assign texture to object */ glDisable(GL_TEXTURE); }

Steps in Texture Mapping glPixelStorei(GL_UNPACK_ALIGNMENT, 1); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S,GL_REPEAT); glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); teximage = TextureLoadBitmap(“test.bmp”, &teximageWidth, &teximageHeight); Init() Step 1: Indicate how the texture is applied Step 2: Load bitmap texture

Steps in Texture Mapping Step 3: Enable texture mapping glEnable(GL_TEXTURE_2D); glTexImage2D(GL_TEXTURE_2D, 0, 3, teximageWidth, teximageHeight, 0, GL_RGB, GL_UNSIGNED_BYTE, teximage); glBegin(GL_POLYGON); glTexCoord2f(sA, tA); glVertex3fv(vexA); glTexCoord2f(sB, tB); glVertex3fv(vexB); glTexCoord2f(sC, tC); glVertex3fv(vexC); glEnd(); glDisable(GL_TEXTURE_2D); Step 5: Draw the scene, supply texture & geometric coordinates Display() Step 4: Specify the texture