09/09/03CS679 - Fall 2003 - Copyright Univ. of Wisconsin Last Time Event management Lag Group assignment has happened, like it or not.

Slides:



Advertisements
Similar presentations
Lecture 8 Transparency, Mirroring
Advertisements

Graphics Pipeline.
03/16/2009Dinesh Manocha, COMP770 Texturing Surface’s texture: its look & feel Graphics: a process that takes a surface and modifies its appearance using.
Texture Mapping. Texturing  process that modifies the appearance of each point on a surface using an image or function  any aspect of appearance can.
Week 7 - Monday.  What did we talk about last time?  Specular shading  Aliasing and antialiasing.
Real-Time Rendering TEXTURING Lecture 02 Marina Gavrilova.
Texture Visual detail without geometry. Texture Mapping desire for heightened realism.
Week 7 - Wednesday.  What did we talk about last time?  Transparency  Gamma correction  Started texturing.
Week 9 - Wednesday.  What did we talk about last time?  Fresnel reflection  Snell's Law  Microgeometry effects  Implementing BRDFs  Image based.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Textures II Week 8, Wed.
Advanced Texture and Lighting
Texture Mapping CPSC /24/03 Abhijeet Ghosh.
Computer Graphics (Spring 2008) COMS 4160, Lecture 19: Texture Mapping Many slides from Greg Humphreys, UVA and Rosalee.
(conventional Cartesian reference system)
Skin Rendering GPU Graphics Gary J. Katz University of Pennsylvania CIS 665 Adapted from David Gosselin’s Power Point and article, Real-time skin rendering,
Image-Based Lighting : Computational Photography Alexei Efros, CMU, Fall 2005 © Eirik Holmøyvik …with a lot of slides donated by Paul Debevec.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology Beyond Meshes Spring 2012.
Computer Graphics Inf4/MSc Computer Graphics Lecture 11 Texture Mapping.
09/18/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Bump Mapping Multi-pass algorithms.
9/20/2001CS 638, Fall 2001 Today Finishing Up Reflections More Multi-Pass Algorithms Shadows.
Erdem Alpay Ala Nawaiseh. Why Shadows? Real world has shadows More control of the game’s feel  dramatic effects  spooky effects Without shadows the.
1 Computer Graphics Week13 –Shading Models. Shading Models Flat Shading Model: In this technique, each surface is assumed to have one normal vector (usually.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
CS 638, Fall 2001 Today Light Mapping (Continued) Bump Mapping with Multi-Texturing Multi-Pass Rendering.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
CS 638, Fall 2001 Admin Grad student TAs may have had their accounts disabled –Please check and the lab if there is a problem If you plan on graduating.
Computer Graphics Texture Mapping
11/11/04© University of Wisconsin, CS559 Fall 2004 Last Time Shading Interpolation Texture mapping –Barycentric coordinates for triangles.
1 SIC / CoC / Georgia Tech MAGIC Lab Rossignac Textures and shadows  Generation  Mipmap  Texture coordinates,
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 (cont.) Jian Huang, CS 594, updated in Fall’08.
09/11/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Graphics Pipeline Texturing Overview Cubic Environment Mapping.
Game Programming (Mapping) Spring.
CS 638, Fall 2001 Today Project Stage 0.5 Environment mapping Light Mapping.
CS 638, Fall 2001 Multi-Pass Rendering The pipeline takes one triangle at a time, so only local information, and pre-computed maps, are available Multi-Pass.
CS-378: Game Technology Lecture #4: Texture and Other Maps Prof. Okan Arikan University of Texas, Austin V Lecture #4: Texture and Other Maps.
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
Texture Mapping (cont.) Jian Huang, CS 594, Fall 2003.
Computing & Information Sciences Kansas State University Lecture 10 of 42CIS 636/736: (Introduction to) Computer Graphics CIS 636/736 Computer Graphics.
Image-Based Lighting © Eirik Holmøyvik …with a lot of slides donated by Paul Debevec CS194: Image Manipulation & Computational Photography Alexei Efros,
Computer Graphics 2 Lecture 7: Texture Mapping Benjamin Mora 1 University of Wales Swansea Pr. Min Chen Dr. Benjamin Mora.
CHAPTER 8 Color and Texture Mapping © 2008 Cengage Learning EMEA.
09/16/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Environment mapping Light mapping Project Goals for Stage 1.
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Computing & Information Sciences Kansas State University Lecture 12 of 42CIS 636/736: (Introduction to) Computer Graphics CIS 636/736 Computer Graphics.
11/5/2002 (c) University of Wisconsin, CS 559 Last Time Local Shading –Diffuse term –Specular term –All together –OpenGL brief overview.
CSCE 441: Computer Graphics Ray Tracing
11/24/ :45 Graphics II Shadow Maps Reflections Session 5.
COMPUTER GRAPHICS CS 482 – FALL 2015 SEPTEMBER 29, 2015 RENDERING RASTERIZATION RAY CASTING PROGRAMMABLE SHADERS.
09/25/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Shadows Stage 2 outline.
What are shaders? In the field of computer graphics, a shader is a computer program that runs on the graphics processing unit(GPU) and is used to do shading.
CS 445 / 645: Introductory Computer Graphics Review.
09/23/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Reflections Shadows Part 1 Stage 1 is in.
Module 05 –Bump mapping Module 05 – Bump mapping Module 05 Advanced mapping techniques: Bump mapping.
Greg Humphreys CS445: Intro Graphics University of Virginia, Fall 2003 Texture Mapping Greg Humphreys University of Virginia CS 445, Fall 2003.
Shaders, part 2 alexandri zavodny.
Week 7 - Wednesday CS361.
Week 7 - Monday CS361.
donated by Paul Debevec
© University of Wisconsin, CS559 Spring 2004
Game Programming (Mapping)
Deferred Lighting.
The Graphics Rendering Pipeline
So Far We have assumed that we know: The point The surface normal
© University of Wisconsin, CS559 Fall 2004
CS-378: Game Technology Lecture #4: Texture and Other Maps
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실.
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실.
Presentation transcript:

09/09/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Event management Lag Group assignment has happened, like it or not

09/09/03CS679 - Fall Copyright Univ. of Wisconsin Today Texturing

09/09/03CS679 - Fall Copyright Univ. of Wisconsin Standard Pipeline

09/09/03CS679 - Fall Copyright Univ. of Wisconsin Texture Mapping The problem: Colors, normals, etc. are only specified at vertices. How do we add detail between vertices? Solution: Specify the details in an image (the texture) and specify how to apply the image to the geometry (the map) Works for shading parameters other than color, as we shall see –The basic underlying idea is the mapping

09/09/03CS679 - Fall Copyright Univ. of Wisconsin Basic Mapping The texture lives in a 2D space –Parameterize points in the texture with 2 coordinates: (s,t) Define the mapping from (x,y,z) in world space to (s,t) in texture space With polygons: –Specify (s,t) coordinates at vertices –Interpolate (s,t) for other points based on given vertices

09/09/03CS679 - Fall Copyright Univ. of Wisconsin I assume you recall… Texture sampling (aliasing) is a big problem –Mipmaps and other filtering techniques are the solution The texture value for points that map outside the texture image can be generated in various ways –Repeat, Clamp, … Texture coordinates are specified at vertices and interpolated across triangles Width and height of texture images is constrained (powers of two, sometimes must be square)

09/09/03CS679 - Fall Copyright Univ. of Wisconsin Multitexturing Some effects are easier to implement if multiple textures can be applied –Future lectures: Light maps, bump maps, shadows, … Multitexturing hardware provides a pipeline of texture units, each of which applies a standard texture map operation –Fragments are passed through the pipeline with each step working on the result of the previous stage –Texture parameters are specified independently for each unit, further improving functionality –For example, the first stage applies a color map, the next modifies the illumination to simulate bumps, the third modifies opacity –Not the same as multi-pass rendering - all applied in one pass

09/09/03CS679 - Fall Copyright Univ. of Wisconsin Pixel Shaders Current generation hardware provides pixel shaders A pixel shader operates on a fragment –A single pixel (or sub-pixel) that has already been “lit” It can compute texture coordinates, do general texture look- ups, modify color/depth/opacity, and some other functions More general than multi-texturing and very powerful

09/09/03CS679 - Fall Copyright Univ. of Wisconsin Textures in Games The game engine provides some amount of texture support Artists are supplied with tools to exploit this support –They design the texture images –They specify how to apply the image to the object Commonly, textures are supplied at varying resolutions to support different hardware performance –Note that the texture mapping code does not need to be changed - just load different sized maps at run time Textures are, without doubt, the most important part of a game’s look

09/09/03CS679 - Fall Copyright Univ. of Wisconsin Example Texture Tool

09/09/03CS679 - Fall Copyright Univ. of Wisconsin Packing Textures Problem: The limits on texture width/height make it inefficient to store many textures –For example: long, thin objects Solution: Artists pack the textures for many objects into one image –The texture coordinates for a given object may only index into a small part of the image –Care must be taken at the boundary between sub-images to achieve correct blending –Mipmapping is restricted –Best for objects that will be at known resolution (weapons, for instance)

09/09/03CS679 - Fall Copyright Univ. of Wisconsin Combining Textures

09/09/03CS679 - Fall Copyright Univ. of Wisconsin Texture Matrix Normally, the texture coordinates given at vertices are interpolated and directly used to index the texture The texture matrix applies a homogeneous transform to the texture coordinates before indexing the texture What use is this?

09/09/03CS679 - Fall Copyright Univ. of Wisconsin Animating Texture (method 1) Loading a texture onto the graphics card is very expensive But once there, the texture matrix can be used to “transform” the texture –For example, changing the translation can select different parts of the texture If the texture matrix is changed from frame to frame, the texture will appear to move on the object This is particularly useful for things like flame, or swirling vortices, or pulsing entrances, …

09/09/03CS679 - Fall Copyright Univ. of Wisconsin Demo

09/09/03CS679 - Fall Copyright Univ. of Wisconsin Projective Texturing The texture should appear to be projected onto the scene, as if from a slide projector Solution: –Equate texture coordinates with world coordinates –Think about it from the projector’s point of view: wherever a world point appears in the projector’s view, it should pick up the texture –Use a texture matrix equivalent to the projection matrix for the projector – maps world points into texture image points Details available in many places Problems? What else could you do with it?

09/09/03CS679 - Fall Copyright Univ. of Wisconsin What’s in a Texture? The graphics hardware doesn’t know what is in a texture –It applies a set of operations using values it finds in the texture, the existing value of the fragment (pixel), and maybe another color –The programmer gets to decide what the operations are, within some set of choices provided by the hardware –Examples: the texture may contain scalar “luminance” information, which simply multiplies the fragment color. What use is this? the texture might contain “alpha” data that multiplies the fragment’s alpha channel but leaves the fragment color alone. What use is this? –Future lectures will look at creative interpretations of textures – it’s a burgeoning area

09/09/03CS679 - Fall Copyright Univ. of Wisconsin Environment Mapping Environment mapping produces reflections on shiny objects Texture is transferred in the direction of the reflected ray from the environment map onto the object Reflected ray: R=2(N·V)N-V What is in the map? Object Viewer Reflected ray Environment Map

09/09/03CS679 - Fall Copyright Univ. of Wisconsin Approximations Made The map should contain a view of the world with the point of interest on the object as the eye –We can’t store a separate map for each point, so one map is used with the eye at the center of the object –Introduces distortions in the reflection, but the eye doesn’t notice –Distortions are minimized for a small object in a large room The object will not reflect itself The mapping can be computed at each pixel, or only at the vertices

09/09/03CS679 - Fall Copyright Univ. of Wisconsin Environment Maps The environment map may take one of several forms: –Cubic mapping –Spherical mapping (two variants) –Parabolic mapping Describes the shape of the surface on which the map “resides” Determines how the map is generated and how it is indexed What are some of the issues in choosing the map?

09/09/03CS679 - Fall Copyright Univ. of Wisconsin Example

09/09/03CS679 - Fall Copyright Univ. of Wisconsin Cubic Mapping The map resides on the surfaces of a cube around the object –Typically, align the faces of the cube with the coordinate axes To generate the map: –For each face of the cube, render the world from the center of the object with the cube face as the image plane Rendering can be arbitrarily complex (it’s off-line) –Or, take 6 photos of a real environment with a camera in the object’s position Actually, take many more photos from different places the object might be Warp them to approximate map for all intermediate points Remember The Abyss and Terminator 2?

09/09/03CS679 - Fall Copyright Univ. of Wisconsin Cubic Map Example

09/09/03CS679 - Fall Copyright Univ. of Wisconsin Indexing Cubic Maps Assume you have R and the cube’s faces are aligned with the coordinate axes, and have texture coordinates in [0,1]x[0,1] –How do you decide which face to use? –How do you decide which texture coordinates to use? What is the problem using cubic maps when texture coordinates are only computed at vertices?

09/09/03CS679 - Fall Copyright Univ. of Wisconsin Todo By Monday, Sept 15: Goals for stage 1 By Monday, Sept 22: Lock in Stage 1