GAM666 – Introduction To Game Programming ● Textures are simply 2D images which are spread over the triangles of a 3D shape ● Each vertex has texture coordinates.

Slides:



Advertisements
Similar presentations
Texture Mapping. Texturing  process that modifies the appearance of each point on a surface using an image or function  any aspect of appearance can.
Advertisements

GAM666 – Introduction To Game Programming ● As of DirectX 8, DirectDraw (2D) and Direct3D (3D) have been combined into DirectX Graphics (still often called.
Lecture 6: 3D Rendering Pipeline (III) Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering Georgia Institute of Technology.
Real-Time Rendering TEXTURING Lecture 02 Marina Gavrilova.
Week 7 - Wednesday.  What did we talk about last time?  Transparency  Gamma correction  Started texturing.
3D Graphics for Game Programming (J. Han) Chapter VIII Image Texturing.
Graphics Presented by Shuang Li. 2 Overview  Fundamentals  High-Level Organization  Rendering Primitives  Textures  Lighting  The Hardware Rendering.
OpenGL Texture Mapping
Graphics Systems I-Chen Lin’s CG slides, Doug James’s CG slides Angel, Interactive Computer Graphics, Chap 1 Introduction to Graphics Pipeline.
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.
Textures – Magnification and Minification Lecture 30 Mon, Nov 17, 2003.
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.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
3D Computer Graphics: Textures. Textures: texels Texture is a way of assigning a diffuse color to a pixel – can be with 1, 2 or 3D- can use maps, interpolation.
CGMB 314 Intro to Computer Graphics Fill Area Primitives.
Module Code: CU0001NI Technical Information on Digital Images Week -2.
Computer Graphics Texture Mapping Eriq Muhammad Adams
CSE 381 – Advanced Game Programming Basic 3D Graphics
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
3D API By Clayton Azzopardi (Group 10). Introduction Android uses the OpenGL ES 1.0 API Android uses the OpenGL ES 1.0 API Open Graphics Library for Embedded.
Computer Graphics Ben-Gurion University of the Negev Fall 2012.
Buffers Textures and more Rendering Paul Taylor & Barry La Trobe University 2009.
Computer Science 101 Images in Web Pages. Image Files Two common formats, GIF and JPEG GIF images are more flexible for use as icons JPEG images are sharper.
JRN 440 Adv. Online Journalism Resizing and resampling Monday, 2/6/12.
3D Graphics for Game Programming Chapter IV Fragment Processing and Output Merging.
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.
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
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.
A pixel is not a little square & A voxel is not a little cube Chung ji hye.
Game Programming 06 The Rendering Engine
11 Making a Sprite Session 4.2. Session Overview  Describe the principle of a game sprite, and see how to create a sprite in an XNA game  Learn more.
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.
CS418 Computer Graphics John C. Hart
UW EXTENSION CERTIFICATE PROGRAM IN GAME DEVELOPMENT 2 ND QUARTER: ADVANCED GRAPHICS 2D Rendering.
Texture Mapping CAP4730: Computational Structures in Computer Graphics.
Lecture 6 Rasterisation, Antialiasing, Texture Mapping,
Objective: Students will know the screen parts, tools, and menus of the Fireworks program. Students will be able to create a new document, create basic.
CS 325 Introduction to Computer Graphics 04 / 12 / 2010 Instructor: Michael Eckmann.
File Texture Mapping Pasting images on primitives.
Graphics Graphics Korea University 1 Jang Sumi Texture Mapping Environment Mapping Stencil Buffer.
CSc4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University Texture Mapping.
Build your own 2D Game Engine and Create Great Web Games using HTML5, JavaScript, and WebGL. Sung, Pavleas, Arnez, and Pace, Chapter 5 Examples 1.
Texturing Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology.
Textures, Sprites, and Fonts
Week 7 - Wednesday CS361.
Texture Mapping cgvr.korea.ac.kr.
Graphical Output Graphical Text.
OpenGL Texture Mapping
Images Presentation Name Course Name Unit # – Lesson #.# – Lesson Name
Basic Graphics Drawing Shapes 1.
OpenGL Texture Mapping
Chapters VIII Image Texturing
File Texture Mapping Pasting images on primitives.
Interactive Graphics Algorithms Ying Zhu Georgia State University
Introduction to Texture Mapping
Lecture 13 Clipping & Scan Conversion
3D Game Programming Texture Mapping
Images Presentation Name Course Name Unit # – Lesson #.# – Lesson Name
Textures Lecture 11 Wed, Oct 5, 2005.
OpenGL Texture Mapping
OpenGL Texture Mapping
03 | Creating, Texturing and Moving Objects
3D Game Programming Texture Mapping
OpenGL Texture Mapping
Presentation transcript:

GAM666 – Introduction To Game Programming ● Textures are simply 2D images which are spread over the triangles of a 3D shape ● Each vertex has texture coordinates associated with it, giving 2D coordinates of the point on the image to be pinned to that vertex ● Regardless of the size of the image, (0,0) is the top left corner and (1,1) is the bottom right ● Typically, texture coordinates are called (u,v) so they don't get confused with the x, y and z of the 3D world itself, and the pixels of the image are called texels so they don't get confused with pixels on the screen Texturing 3D Shapes

GAM666 – Introduction To Game Programming ● If coordinates outside the range 0.0 to 1.0 are given, most hardware is capable of wrapping the texture around ● Many video cards have restrictions on the size of the images involved ● The most typical limitation is that each dimension must be a power of 2, e.g. 128X512 ● For this reason, texture artists almost always create textures that have dimensions which are a power of 2, and often are square Texturing 3D Shapes

GAM666 – Introduction To Game Programming To include a set of texture coordinates in the vertex structure, ● in the SetFVF call specify the bits: ● D3DFVF_TEX1, to say there will be one set of texture coordinates, and ● D3DFVF_TEXCOORDSIZE2(0) to say that the first (0) set of texture coordinates has 2 elements per pixel ● Include two floats (for the u and v coordinates) in the appropriate place in the vertex structure ● Other settings allow for multitexturing and more sophisticated texturing operations Texturing 3D Shapes

GAM666 – Introduction To Game Programming ● LPDIRECT3DTEXTURE9 points to a texture ● The function D3DXCreateTextureFromFile() will load a texture from file, and understands many popular file formats ● To rasterize a 3D shape using the texture, call the Direct3D device function SetTexture() before drawing the primitive (Call SetTexture() with a null pointer to stop texturing) ● The color for each pixel is a combination of the material, lighting and texel colours Texturing 3D Shapes

GAM666 – Introduction To Game Programming The Direct3D device function SetSamplerState() lets you control various aspects of how the texture is applied. For example, ● D3DSAMP_ADDRESSU and D3DSAMP_ADDRESSV let you change how texture wrapping is done along each texture dimension ● D3DSAMP_MINFILTER and D3DSAMP_MAGFILTER let you change how the texture is shrunk and magnified Texturing 3D Shapes

GAM666 – Introduction To Game Programming ● The default minification and magnification filters are D3DTEXF_POINT, which uses the nearest texel to determine the colour of a pixel, but can look blocky (point filtering) ● D3DTEXF_LINEAR averages the nearest 2x2 block of texels, and will look smoother, though also fuzzy (bilinear filtering) ● D3DTEXF_ANISOTROPIC is similar, but also compensates for the angle of the texture relative to the screen, at a performance penalty (anisotropic filtering) Texturing 3D Shapes