CS-378: Game Technology Lecture #4: Texture and Other Maps

Slides:



Advertisements
Similar presentations
16.1 Si23_03 SI23 Introduction to Computer Graphics Lecture 16 – Some Special Rendering Effects.
Advertisements

Lecture 8 Transparency, Mirroring
Virtual Realism TEXTURE MAPPING. The Quest for Visual Realism.
Ray tracing. New Concepts The recursive ray tracing algorithm Generating eye rays Non Real-time rendering.
Exploration of bump, parallax, relief and displacement mapping
Graphics Pipeline.
Cs123 INTRODUCTION TO COMPUTER GRAPHICS Andries van Dam © Andries van Dam Texture Mapping Beautification of Surfaces 1/23.
Course Note Credit: Some of slides are extracted from the course notes of prof. Mathieu Desburn (USC) and prof. Han-Wei Shen (Ohio State University). CSC.
COMPUTER GRAPHICS CS 482 – FALL 2014 OCTOBER 6, 2014 TEXTURE MAPPING TEXTURES BUMP MAPPING ENVIRONMENT MAPPING PROCEDURAL TEXTURING.
CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Object-Order vs. Screen-Order Rendering April 24, 2003.
X86 and 3D graphics. Quick Intro to 3D Graphics Glossary: –Vertex – point in 3D space –Triangle – 3 connected vertices –Object – list of triangles that.
CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Texture Mapping.
1 3D –graphics and animation Shading and Surface Characteristics Harri Airaksinen.
Computer Graphics Inf4/MSc Computer Graphics Lecture 11 Texture Mapping.
SET09115 Intro Graphics Programming
University of Illinois at Chicago Electronic Visualization Laboratory (EVL) CS 426 Intro to 3D Computer Graphics © 2003, 2004, 2005 Jason Leigh Electronic.
COMP 175: Computer Graphics March 24, 2015
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.
COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS 1 Shading (Shading) & Smooth Shading Graphics.
Computer Graphics An Introduction. What’s this course all about? 06/10/2015 Lecture 1 2 We will cover… Graphics programming and algorithms Graphics data.
Shading & Texture. Shading Flat Shading The process of assigning colors to pixels. Smooth Shading Gouraud ShadingPhong Shading Shading.
09/09/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Event management Lag Group assignment has happened, like it or not.
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.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
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.
CS-378: Game Technology Lecture #2.2: Clipping and Hidden Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney,
CS-378: Game Technology Lecture #7: More Mapping Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic, Jessica.
Game Programming 06 The Rendering Engine
Computer Graphics 2 Lecture 7: Texture Mapping Benjamin Mora 1 University of Wales Swansea Pr. Min Chen Dr. Benjamin Mora.
Advanced Computer Graphics Shadow Techniques CO2409 Computer Graphics Week 20.
09/16/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Environment mapping Light mapping Project Goals for Stage 1.
A Few Things about Graphics Jian Huang Computer Science University of Tennessee.
CS 325 Introduction to Computer Graphics 03 / 29 / 2010 Instructor: Michael Eckmann.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Lecture 6 Rasterisation, Antialiasing, Texture Mapping,
Local Illumination and Shading
Render methods. Contents Levels of rendering Wireframe Plain shadow Gouraud Phong Comparison Gouraud-Phong.
Introduction to Meshes Lecture 22 Mon, Oct 20, 2003.
Applications and Rendering pipeline
Computer Graphics (Fall 2006) COMS 4160, Lecture 16: Illumination and Shading 1


Texture Mapping.
CS-378: Game Technology Lecture #7: More Mapping Prof. Okan Arikan
Photorealistic Rendering vs. Interactive 3D Graphics
Game Programming (Mapping)
Modeling 101 For the moment assume that all geometry consists of points, lines and faces Line: A segment between two endpoints Face: A planar area bounded.
3D Graphics Rendering PPT By Ricardo Veguilla.
CS451Real-time Rendering Pipeline
Chapter 14 Shading Models.
Real-Time Volume Graphics [06] Local Volume Illumination
(c) 2002 University of Wisconsin
© University of Wisconsin, CS559 Fall 2004
Introduction to Computer Graphics with WebGL
Lighting.
CS-378: Game Technology Lecture #3: Shading Prof. Okan Arikan
UMBC Graphics for Games
Last Time Canonical view pipeline Projection Local Coordinate Space
Introduction to Meshes
Dr. Jim Rowan ITEC 2110 Vector Graphics II
CS5500 Computer Graphics May 29, 2006
Last Time Presentation of your game and idea Environment mapping
Game Programming Algorithms and Techniques
Chapter 14 Shading Models.
Dr. Jim Rowan ITEC 2110 Vector Graphics II
Introduction to Meshes
Presentation transcript:

CS-378: Game Technology Lecture #4: Texture and Other Maps Prof. Okan Arikan University of Texas, Austin V2005-09-1.1

Today Maps Compositing Texture Mapping Bump Mapping Displacement Mapping Shadow Maps Environment Maps Compositing

Surface Detail The real world is complicated We can’t explicitly model all the rich detail So, we come up with some “hacks”...

Texture Mapping The idea is to wrap a “texture” onto a surface To do this we need A texture, usually just an image A parameterization of the surface A mapping from the surface parameterization to the texture coordinates

Barycentric Coordinates can be expressed as where or, alternatively as

Barycentric Coordinates We can use barycentric coordinates to interpolate any quantity (color, texture coordinates, etc) stored at vertices, not just positions.

Bad Idea Simplest (and fastest) approach is to compute texture coordinates for polygon vertices and interpolate in screen space. This gives the image on the right.

Undoing Homogenization Let be the point of some polygon, after projection, but before homogenization The homogenized point is the location of on the screen. Let be a point we wish to shade, we have its barycentric coordinates in screen space:

Undoing Homogenization We know We also know that there exist weights , such that Combining the above we have

Undoing Homogenization This is a linear system in Unfortunately is is non-invertible, so...

Undoing Homogenization we add now its solvable and the solution is: similar formulas exist for and

Bump/Displacement Mapping Texture mapping changes a surface’s reflectance, but that can’t give us a realistic orange For this we can use bump or displacement mapping

Bump Mapping The idea is to perturb the surface normals If the bump map is an array of vectors, just add the bump vectors to the surface normals If the bump map is an array of scalars (desired displacements along the normal direction), then the new normal is

Displacement Mapping Actually perturb the location of the surface, usually along the normal direction, by scalar values given in the displacement map This is usually done by moving the vertices of a polygonal mesh

Bumps vs. Displacements Bumps do not cast shadows or change the silhouette, they do produce specular effects Displacements actually change the geometry Displacement maps only look good on high resolution models Bottom line: bumps are cheaper, displacements look better

Shadow Maps Key insight: If we render the scene from the point of view of the light source, the lit surfaces will be visible and the unlit surfaces will by hidden We render the scene from the point of view of the light source Store the z values in a “depth shadow map”

Shadow Maps For each polygon Render the polygon from the camera Render the polygon from the light Compare the z value from the light with the one in the depth shadow map If they match, the polygon is lit Otherwise it is in shadow

Environment Maps Fake reflections Assumes the environment is very far away Depends on the location of the camera Usually stored in a spherical table or a cube map

Environment Maps Remove the reflective object from the scene Render the scene six times with the eye at the center of the removed object Render the scene, using reflection vectors to index the cube map

Compositing Sometimes scenes are too complex to render all at once Different parts of a scene often do not interact Need a way to render pieces separately and put them back together later

Pre-multiplied Alpha Channel Alpha Channels Alpha channel stores opacity Primary operation is “over” Pre-multiplied alpha allows the use of the same rules for all 4 channels Normal Alpha Channel Pre-multiplied Alpha Channel

Alpha Channel Other Operations

Suggested Reading Fundamentals of Computer Graphics by Pete Shirley Chapters 10, 3.4