CS335 Graphics and Multimedia. Slides adopted from OpenGL Tutorial

Similar documents
CSC Graphics Programming. Budditha Hettige Department of Statistics and Computer Science

Computer Graphics. Bing-Yu Chen National Taiwan University

CS212. OpenGL Texture Mapping and Related

Most device that are used to produce images are. dots (pixels) to display the image. This includes CRT monitors, LCDs, laser and dot-matrix

OpenGL Texture Mapping. Objectives Introduce the OpenGL texture functions and options

Imaging and Raster Primitives

Objectives. Texture Mapping and NURBS Week 7. The Limits of Geometric Modeling. Modeling an Orange. Three Types of Mapping. Modeling an Orange (2)

Computer Graphics. Three-Dimensional Graphics VI. Guoying Zhao 1 / 73

Lecture 5. Scan Conversion Textures hw2

GRAFIKA KOMPUTER. ~ M. Ali Fauzi

Lecture 19: OpenGL Texture Mapping. CITS3003 Graphics & Animation

Texture Mapping. CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science

Graphics. Texture Mapping 고려대학교컴퓨터그래픽스연구실.

Lecture 07: Buffers and Textures

Texture Mapping and Special Effects

Texture Mapping CSCI 4229/5229 Computer Graphics Fall 2016

Texture Mapping. Mike Bailey.

CS452/552; EE465/505. Texture Mapping in WebGL

Buffers. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

CS 432 Interactive Computer Graphics

Texture Mapping and Sampling

CISC 3620 Lecture 7 Lighting and shading. Topics: Exam results Buffers Texture mapping intro Texture mapping basics WebGL texture mapping

Introduction to OpenGL. Prof. Dr.-Ing. Lars Linsen

Grafica Computazionale

Lecture 22 Sections 8.8, 8.9, Wed, Oct 28, 2009

Chapter 6 Texture Mapping

Computational Strategies

-=Catmull's Texturing=1974. Part I of Texturing

INF3320 Computer Graphics and Discrete Geometry

ก ก ก.

INF3320 Computer Graphics and Discrete Geometry

Texturas. Objectives. ! Introduce Mapping Methods. ! Consider two basic strategies. Computação Gráfica

Overview. Goals. MipMapping. P5 MipMap Texturing. What are MipMaps. MipMapping in OpenGL. Generating MipMaps Filtering.

Computer Graphics Texture Mapping

CSE 167: Introduction to Computer Graphics Lecture #8: Textures. Jürgen P. Schulze, Ph.D. University of California, San Diego Spring Quarter 2016

CSE 167: Introduction to Computer Graphics Lecture #9: Textures. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2013

Texturing. Slides done bytomas Akenine-Möller and Ulf Assarsson Department of Computer Engineering Chalmers University of Technology

Chapter 9 Texture Mapping An Overview and an Example Steps in Texture Mapping A Sample Program Specifying the Texture Texture Proxy Replacing All or

CS179: GPU Programming

Workshop 3D capture, modelling and augmented reality Capture 3D, modélisation et réalité augmentée

CSE 167: Lecture 11: Textures 2. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011

CS4621/5621 Fall Basics of OpenGL/GLSL Textures Basics

Today. Texture mapping in OpenGL. Texture mapping. Basic shaders for texturing. Today. Computergrafik

Texturing. Slides done by Tomas Akenine-Möller and Ulf Assarsson Department of Computer Engineering Chalmers University of Technology

General Purpose computation on GPUs. Liangjun Zhang 2/23/2005

Textures. Texture Mapping. Bitmap Textures. Basic Texture Techniques

Cap. 3 Textures. Mestrado em Engenharia Informática (6931) 1º ano, 1º semestre

CMSC 425: Lecture 12 Texture Mapping Thursday, Mar 14, 2013

9.Texture Mapping. Chapter 9. Chapter Objectives

三維繪圖程式設計 3D Graphics Programming Design 第七章基礎材質張貼技術嘉大資工系盧天麒

CSE 167: Introduction to Computer Graphics Lecture #6: Lights. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2014

+ = Texturing: Glue n-dimensional images onto geometrical objects. Texturing. Texture magnification. Texture coordinates. Bilinear interpolation

CSE 167: Introduction to Computer Graphics Lecture #7: Textures. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2018

Lighting and Texturing

OpenGL. Jimmy Johansson Norrköping Visualization and Interaction Studio Linköping University

Texture mapping. Computer Graphics CSE 167 Lecture 9

Computer Graphics Texture Mapping

EE 4702 GPU Programming

CSE 167: Introduction to Computer Graphics Lecture #8: Textures. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2017

Lecture 5 3D graphics part 3

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

Fog example. Fog is atmospheric effect. Better realism, helps determine distances

Texture Mapping. Texture Mapping. Map textures to surfaces. Trompe L Oeil ( Deceive the Eye ) The texture. Texture map

Review of Tuesday. ECS 175 Chapter 3: Object Representation

Graphics Processing Units (GPUs) V1.2 (January 2010) Outline. High-Level Pipeline. 1. GPU Pipeline:

An Interactive Introduction to OpenGL Programming. An Interactive Introduction to OpenGL Programming. SIGGRAPH New Orleans 1

Textures. Texture coordinates. Introduce one more component to geometry

Dynamic Texturing. Mark Harris NVIDIA Corporation

CS 130 Final. Fall 2015

CS GPU and GPGPU Programming Lecture 11: GPU Texturing 1. Markus Hadwiger, KAUST

CS 354R: Computer Game Technology

Computer Graphics

GPU Memory Model Overview

3D Rasterization II COS 426

Assignment #5: Scalar Field Visualization 3D: Direct Volume Rendering

Discrete Techniques. 11 th Week, Define a buffer by its spatial resolution (n m) and its depth (or precision) k, the number of

PROFESSIONAL. WebGL Programming DEVELOPING 3D GRAPHICS FOR THE WEB. Andreas Anyuru WILEY. John Wiley & Sons, Ltd.

Graphics Processing Units (GPUs) V2.2 (January 2013) Jan Kautz, Anthony Steed, Tim Weyrich

Case 1:17-cv SLR Document 1-3 Filed 01/23/17 Page 1 of 33 PageID #: 60 EXHIBIT C

Graphics Processing Unit Architecture (GPU Arch)

Steiner- Wallner- Podaras

ERKELEY DAVIS IRVINE LOS ANGELES RIVERSIDE SAN DIEGO SAN FRANCISCO EECS 104. Fundamentals of Computer Graphics. OpenGL

TEXTURE MAPPING. DVA338 Computer Graphics Thomas Larsson, Afshin Ameri

MULTI-PASS VS SINGLE-PASS CUBEMAP

Mattan Erez. The University of Texas at Austin

Computer Graphics - Week 7

Chapter IV Fragment Processing and Output Merging. 3D Graphics for Game Programming

Programming Graphics Hardware

Module 13C: Using The 3D Graphics APIs OpenGL ES

E.Order of Operations

4 Introduction to OpenGL Programming. Chapter 4. Introduction to OpenGL Programming. Department of Computer Science and Engineering 4-1

CS GPU and GPGPU Programming Lecture 16+17: GPU Texturing 1+2. Markus Hadwiger, KAUST

CS130 : Computer Graphics. Tamar Shinar Computer Science & Engineering UC Riverside

Texturing Theory. Overview. All it takes is for the rendered image to look right. -Jim Blinn 11/10/2018

Texture Mapping. Computer Graphics, 2015 Lecture 9. Johan Nysjö Centre for Image analysis Uppsala University

Page 6 PROCESSOR PROCESSOR FRAGMENT FRAGMENT. texy[1] texx. texy[1] texx. texy[0] texy[0]

Rasterization Overview

Magnification and Minification


The Application Stage. The Game Loop, Resource Management and Renderer Design

Transcription:

CS335 Graphics and Multimedia Slides adopted from OpenGL Tutorial

Texture Poly. Per Vertex Mapping CPU DL Texture Raster Frag FB Pixel Apply a 1D, 2D, or 3D image to geometric primitives Uses of Texturing simulating materials reducing geometric complexity image warping reflections 2

Texture Mapping y z x geometry screen t image 3 s

Texture Mapping and the OpenGL Pipeline Images and geometry flow through separate pipelines that join at the rasterizer complex textures do not affect geometric complexity vertices geometry pipeline rasterizer image pixel pipeline 4

Texture Example The texture (below) is a 256 x 256 image that has been mapped to a rectangular polygon which is viewed in perspective 5

Applying Textures I Three steps specify texture read or generate image assign to texture assign texture coordinates to vertices specify texture parameters wrapping, filtering 6

Applying Textures II specify textures in texture objects set texture filter set texture function set texture wrap mode set optional perspective correction hint bind texture object enable texturing supply texture coordinates for vertex coordinates can also be generated 7

Texture Objects Like display lists for texture images one image per texture object may be shared by several graphics contexts Generate texture names glgentextures( n, *texids ); 8

Texture Objects (cont.) Create texture objects with texture data and state glbindtexture( target, id ); Bind textures before using glbindtexture( target, id ); 9

Specify Texture Poly. Per Vertex Image CPU DL Texture Raster Frag FB Pixel Define a texture image from an array of texels in CPU memory glteximage2d( target, level, components, w, h, border, format, type, *texels ); dimensions of image must be powers of 2 No limitation with newer cards and drivers Texel colors are processed by pixel pipeline pixel scales, biases and lookups can be done 10

Converting A Texture Image If dimensions of image are not power of 2 gluscaleimage( format, w_in, h_in, type_in, *data_in, w_out, h_out, type_out, *data_out ); *_in is for source image *_out is for destination image Image interpolated and filtered during scaling 11

Specifying a Texture: Other Methods Use frame buffer as source of texture image uses current buffer as source image glcopyteximage2d(...) glcopyteximage1d(...) Modify part of a defined texture gltexsubimage2d(...) gltexsubimage1d(...) Do both with glcopytexsubimage2d(...), etc. 12

Mapping a Poly. Per Vertex Texture CPU Based on parametric texture coordinates gltexcoord*() specified at each vertex DL Pixel Texture Raster Frag FB t 0, 1 Texture Space a 1, 1 Object Space (s, t) = (0.2, 0.8) A b 0, 0 1, 0 c s (0.4, 0.2) B C (0.8, 0.4) 13

Tutorial: Texture 15

Texture Application Methods Filter Modes minification or magnification special mipmap minification filters Wrap Modes clamping or repeating Texture Functions how to mix primitive s color with texture s color blend, modulate or replace texels 16

Filter Modes Example: gltexparameteri( target, type, mode ); Texture Magnification Polygon Texture Minification Polygon 17

Mipmapped Textures Mipmap allows for prefiltered texture maps of decreasing resolutions Lessens interpolation errors for smaller textured objects Declare mipmap level during texture definition glteximage*d( GL_TEXTURE_*D, level, ) GLU mipmap builder routines glubuild*dmipmaps( ) OpenGL 1.2 introduces advanced LOD controls 18

Wrapping Mode Example: gltexparameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP ) gltexparameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT ) t texture s GL_REPEAT wrapping GL_CLAMP wrapping 19

Texture Functions Controls how texture is applied gltexenv{fi}[v]( GL_TEXTURE_ENV, prop, param ) GL_TEXTURE_ENV_MODE modes GL_MODULATE GL_BLEND GL_REPLACE Set blend color with GL_TEXTURE_ENV_COLOR 20

Perspective Correction Hint Texture coordinate and color interpolation either linearly in screen space or using depth/perspective values (slower) Noticeable for polygons on edge glhint( GL_PERSPECTIVE_CORRECTION_HINT, hint ) where hint is one of GL_DONT_CARE GL_NICEST GL_FASTEST 21