CS 551 / CS 645 Texture Maps. Assignment 2 Let’s talk about ‘working together’ –No sharing code unless specifically allowed (and documented in README)

Slides:



Advertisements
Similar presentations
CS 445 / 645 Introduction to Computer Graphics Lecture 18 Antialiasing Antialiasing.
Advertisements

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.
Komputer Grafik 2 (AK045206) Pemetaan Tekstur 1/35 Pemetaan Tekstur.
David Luebke1/19/99 CS 551/651: Antialiasing David Luebke
Real-Time Rendering TEXTURING Lecture 02 Marina Gavrilova.
Texture Mapping. Typical application: mapping images on geometry 3D geometry (quads mesh) + RGB texture 2D (color-map) =
CS 551 / CS 645 Antialiasing. What is a pixel? A pixel is not… –A box –A disk –A teeny tiny little light A pixel is a point –It has no dimension –It occupies.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Textures II Week 8, Wed.
OpenGL Texture Mapping
OpenGL Texture Mapping Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
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 Inf4/MSc Computer Graphics Lecture 11 Texture Mapping.
CS 445 / 645 Introduction to Computer Graphics Lecture 17 Texture Maps Lecture 17 Texture Maps.
Texture Mapping A way of adding surface details Two ways can achieve the goal:  Surface detail polygons: create extra polygons to model object details.
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 Inf4/MSc Computer Graphics Lecture 9 Antialiasing, Texture Mapping.
Texture Mapping. To add surface details… World of Warcraft, Blizzard Inc. More polygons (slow and hard to handle small details) Less polygons but with.
Next-Generation Consoles Brenden Schubert & Nathaniel Williams With a Special talk by John F. Rhoads on Video Game Ethics.
Computer Graphics Texture Mapping Eriq Muhammad Adams
Introduction to Texture Mapping CSE 470/598 Introduction to Computer Graphics Arizona State University Dianne Hansford.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Computer Graphics Texture Mapping
Texture Mapping + Texture Object = Texture Mapped Object.
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 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)
An Interactive Introduction to OpenGL Programming Ed Angel
UW EXTENSION CERTIFICATE PROGRAM IN GAME DEVELOPMENT 2 ND QUARTER: ADVANCED GRAPHICS Textures.
09/09/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Event management Lag Group assignment has happened, like it or not.
CS 445 / 645 Introduction to Computer Graphics Lecture 19 Texture Maps Lecture 19 Texture Maps.
ECSE-4750 Computer Graphics Fall 2004 Prof. Michael Wozny TA. Abhishek Gattani TA. Stephen
Imaging and Raster Primitives Vicki Shreiner. 2 Jobs Andrew Giles Andrew Giles Chuck Fultz Chuck Fultz SIGGraph - SIGGraph.
Texture Mapping Fall, Textures Describe color variation in interior of 3D polygon  When scan converting a polygon, vary pixel colors according.
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.
CS 480/680 Computer Graphics OpenGL Texture Mapping Dr. Frederick C Harris, Jr. Fall 2011.
1 Texture Mapping. 2 Texture Aliasing MIPmaps Environment Mapping Bump Mapping Displacement Mapping Shadow Maps Solid Textures Antialiasing.
111/17/ :24 UML Solution Involves Selection of Discrete Representation Values.
2 COEN Computer Graphics I Evening’s Goals n Discuss displaying and reading image primitives n Describe texture mapping n Discuss OpenGL modes and.
Texture Mapping May 4, Many slides are borrowed from UNC-CH COMP236 Course (Spring 2003) taught by Leonard McMillan
Texture Mapping. 2 3 Loading Textures void glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border,
CS 445 / 645 Introduction to Computer Graphics Lecture 19 Texture Maps Lecture 19 Texture Maps.
OpenGL Programming Guide : Texture Mapping Yoo jin wook Korea Univ. Computer Graphics Lab.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Lecture 6 Rasterisation, Antialiasing, Texture Mapping,
Computer Graphics Bing-Yu Chen National Taiwan University.
Details of Texture Mapping Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Monday, December 1, 2003.
CSc4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University Texture Mapping.
CS425 © 2003 Ray S. Babcock Pixels and Bitmaps ● OpenGL allows us to work directly with bits and groups of bits, or pixels, which flow down a parallel.
Texture Mapping CEng 477 Introduction to Computer Graphics.
Texturing Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology.
Antialiasing. What is alias? Alias - A false signal in telecommunication links from beats between signal frequency and sampling frequency (from dictionary.com)
Texture Mapping Fall, 2016.
OpenGL Texture Mapping
OpenGL Texture Mapping
Chapters VIII Image Texturing
Interactive Graphics Algorithms Ying Zhu Georgia State University
Introduction to Texture Mapping
3D Game Programming Texture Mapping
OpenGL Texture Mapping
OpenGL Texture Mapping
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실.
3D Game Programming Texture Mapping
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실.
OpenGL Texture Mapping
Presentation transcript:

CS 551 / CS 645 Texture Maps

Assignment 2 Let’s talk about ‘working together’ –No sharing code unless specifically allowed (and documented in README) –Talking about provided start-up code allowed –Talking about generic programming allowed. How does fscanf work? –No helping one another with the graphics-specific programming. Obvious violations in Assignment 2 – me today or tomorrow

Tuesday Assignment 2 returned Midterm returned Assignment 3 part 2 handed out

Review: Area Sampling Shade pixels according to the area covered by thickened line This is unweighted area sampling A rough approximation formulated by dividing each pixel into a finer grid of pixels

Review: Weighted Area Sampling Weighting function, W(x,y) –specifies the contribution of primitive passing through the point (x, y) from pixel center x Intensity W(x,y)

Review: Point Sampling Multiply sample grid by image intensity to obtain a discrete set of points, or samples. Sampling Geometry

Review: Filtering To lower Nyquist rate, remove high frequencies from image: low-pass filter –Only low frequencies remain Sinc function is common filter: –sinc(x) = sin (  x)/  x Spatial Domain Frequency Domain

Review: Bilinear Filter Sometimes called a tent filter Easy to compute –just linearly interpolate between samples Finite extent and no negative values Still has artifacts

Review: Supersampling Techniques Adaptive supersampling –store more points when necesssary Stochastic supersampling –Place sample points at stochastically determined points Eye has harder time detecting aliasing when combined with the noise generated by stochastics

Texture Maps Chapter 9 of Open GL Programming Guide (Red Book) Images applied to polygons to enhance the visual effect of a scene –Rectangular arrays of data Color, luminance, alpha Components of array called texels

Texturing in OpenGL Color mode must be RGBA –A stands for Alpha, or opacity Texture applied to pixels of polygon –Replace mode: texture is painted on top of polygon –Modulate polygon color –Blend a constant color with polygon

glTexImage2D GLenum target –GL_TEXTURE_2D –GL_PROXY_TEXTURE_2D Provides queries for texture resources Proceed with hypothetical texture use (GL won’t apply the texture) After query, call GLGetTexLevelParamter to verify presence of required system components Doesn’t check possibility of multiple texture interference

glTexImage2d GLint level –Used for Level of Detail (LOD) –LOD stores multiple versions of texture that can be used at runtime (set of sizes) –Runtime algorithms select appropriate version of texture Pixel size of polygon used to select best texture Eliminates need for error-prone filtering algorithms

glTexImage2D GLint internalFormat –Describes which of R, G, B, and A are used in internal representation of texels –Provides control over things texture can do High bit depth alpha blending High bit depth intensity mapping General purpose RGB –GL doesn’t guarantee all options are available on given hardware

glTexImage2D GLsizei width GLsizei height –Dimensions of texture image Must be 2 m + 2b (b=0 or 1 depending on border) min, 64 x 64 GLint border –Width of border (1 or 0) Border allows linear blending between overlapping textures Useful when manually tiling textures

glTexImage2D GLenum format –Describe how texture data is stored in input array GL_RGB, GL_RGBA, GL_BLUE… GLenum type –Data size of array components GL_SHORT, GL_BYTE, GL_INT…

glTexImage2D Const GLvoid *texels –Pointer to data describing texture map

glTexImage2D Be aware of tradeoffs between memory usage, color depth, and speed gluScaleImage will alter the size of an image to meet the 2 m size requirement of OpenGL –Scaling performed by linear and box filtering glCopyTexImage2D –Use current frame buffer contents as texture –Copy frame buffer to named texture location

glTexSubImage2D Replace a region of current working texture with a smaller texture SubImage need not adhere to 2 m size limitation This is how you add data from your system’s camera to GL environment glCopyTexSubImage2D –Frame buffer cut and paste possible too

Mipmaps A texture LOD technique Prespecify a series of prefiltered texture maps of decreasing resolutions Requires more texture storage Eliminates shimmering and flashing as objects move

gluBuild2DMipmaps Automatically constructs a family of textures from original texture size down to 1x1

Advanced Mipmaps Runtime mipmap level determination –  = max texture size / max polygon size – = log 2  –If  texture smaller than polygon and magnification filter is used –If  texture is larger than polygon and minification is used (mipmapping)  specifies mipmap level

Advanced Mipmaps You can specify additional mipmap levels on the fly –MIN_LOD may reduce popping –MAX_LOD may reduce over compression You can specify min mipmap level –Useful for mosaicing

Filtering OpenGL tries to pick best mipmap level Question: Which texel corresponds to a particular pixel? GL_NEAREST (Point Sampling) –Pick the texel with center nearest pixel GL_LINEAR (Bilinear Sampling) –Weighted average of 2x2 closest texels GL_LINEAR_MIPMAP_LINEAR –Average texels from two mipmap levels GL_LINEAR_MIPMAP_LINEAR (Trilinear) –Average two averaged texels from two mipmaps

Texture Objects glGenTextures –A way to obtain a reference to a texture object glBindTexture –A way to bind a texture to a texture object Desirable to have all the textures stored as memory resident objects Many GL management functions

Texture Effects Coloring – like a decal Alpha – average polygon color with texture Lighting – change intensity Specular lighting effects –Lighting mode exists which separates polygon base color from specular color –Texturing can be applied to base color only with specular effects added later

Texture Coordinates Every polygon has object coordinates and texture coordinates –Object coordinates describe where polygon vertices are on the screen –Texture coordinates describe texel coordinates of each vertex (usually 0 -> 1) –Texture coordinates are interpolated along vertex-vertex edges glTexCoord{1234}{sifd}(TYPE coords)

Texture Coordinates Cones and cylinders easily mapped to rectangular coordinate spaces without distortion Repeating – texture coordinate > 1.0 Clamped – texture coordinate > 1.0 is clamped Think about relationship between filter mode and repeat/clamp

Automatic Texture-Coordinate Generation glTexGen –Provides control over how texture is placed on polygon –GL_OBJECT_LINEAR Consistent mapping to object’s coordinate system –GL_EYE_LINEAR Mapping is relative to eyepoint –GL_SPHERE_MAP Environment Mapping

Used to model a object that reflects surrounding textures to the eye –Polished sphere reflects walls and ceiling textures –Cyborg in Terminator 2 reflects flaming destruction Texture is distorted fish-eye view of environment Spherical texture mapping creates texture coordinates that correctly index into this texture map

The q-coordinate Remember, texture coordinate interpolation is linear Texture coordinates can contain an optional q-parameter Q scales texture coordinates by dividing each coordinate by q This captures perspective transformations

Multitexturing Pipelining of multiple texture applications to one polygon The results of each texture unit application is passed to the next texture unit, which adds its effects More bookkeeping is required to pull this off

Sony Playstation 2 Seven hours in line at Walmart Total mayhem (two arrested) Fighting over 41 units Debt of Gratitude to: –Vic Ludwig –Brian Salomon –Damian Slonneger

Sony Playstation 2

Playstation 2 Stats 300 MHz 128 bit RISC “Emotion Engine” chip (from Toshiba) 32 MB Rambus memory Standard DVD-ROM (CD-ROM compatible)

Playstation 2 Graphics 150 MHz clock 4 MB video memory 75 Million Polygons Per Second is absolute max 20 Million per second with 48 pixel quads, Z- buffering, alpha blending, and MIP mapping

Playstation 2 Graphics MIP-mapping Bi-linear filtering Surface/Edge Anti-aliasing Texture- correction 32 bit Z-buffering

Playstation 2 Special Features Plays DVDs right out of the box USB, PCMCIA, and “I-Link” I/O ports for modem and other peripherals Backwards compatibility with Playstation 1 games Hard Drive available in 2001