Magnification and Minification

Similar documents
Mipmaps. Lecture 35. Robb T. Koether. Hampden-Sydney College. Wed, Nov 18, 2015

The Graphics Pipeline

The Critical-Path Algorithm

The Traveling Salesman Problem Brute Force Method

The Graphics Pipeline

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

Minimal Spanning Trees

Mipmaps. Lecture 23 Subsection Fri, Oct 30, Hampden-Sydney College. Mipmaps. Robb T. Koether. Discrete Sampling.

The Traveling Salesman Problem Nearest-Neighbor Algorithm

Scheduling and Digraphs

LR Parsing - Conflicts

Recursive Sequences. Lecture 24 Section 5.6. Robb T. Koether. Hampden-Sydney College. Wed, Feb 27, 2013

Rotations and Translations

Shading Triangles. Lecture 37. Robb T. Koether. Hampden-Sydney College. Mon, Nov 30, 2015

The Class Construct Part 1

Applying Textures. Lecture 27. Robb T. Koether. Hampden-Sydney College. Fri, Nov 3, 2017

Scope and Parameter Passing

Friends and Unary Operators

The Decreasing-Time Algorithm

The Pairwise-Comparison Method

while Loops Lecture 13 Sections Robb T. Koether Wed, Sep 26, 2018 Hampden-Sydney College

Shader Programs. Lecture 30 Subsections 2.8.2, Robb T. Koether. Hampden-Sydney College. Wed, Nov 16, 2011

Recursive Linked Lists

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

The Plurality-with-Elimination Method

Stack Applications. Lecture 27 Sections Robb T. Koether. Hampden-Sydney College. Wed, Mar 29, 2017

CT5510: Computer Graphics. Texture Mapping

Sampling Distribution Examples Sections 15.4, 15.5

Solving Recursive Sequences by Iteration

Operators. Lecture 12 Section Robb T. Koether. Hampden-Sydney College. Fri, Feb 9, 2018

Boolean Expressions. Lecture 31 Sections 6.6, 6.7. Robb T. Koether. Hampden-Sydney College. Wed, Apr 8, 2015

Recursive Sequences. Lecture 24 Section 5.6. Robb T. Koether. Hampden-Sydney College. Wed, Feb 26, 2014

Scope and Parameter Passing

Total Orders. Lecture 41 Section 8.5. Robb T. Koether. Hampden-Sydney College. Mon, Apr 8, 2013

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

Recursive Descent Parsers

Pointers. Lecture 2 Sections Robb T. Koether. Hampden-Sydney College. Fri, Jan 18, 2013

Boxplots. Lecture 17 Section Robb T. Koether. Hampden-Sydney College. Wed, Feb 10, 2010

XQuery FLOWR Expressions Lecture 35

Density Curves Sections

Stack Applications. Lecture 25 Sections Robb T. Koether. Hampden-Sydney College. Mon, Mar 30, 2015

Pointers. Lecture 1 Sections Robb T. Koether. Hampden-Sydney College. Wed, Jan 14, 2015

XPath Lecture 34. Robb T. Koether. Hampden-Sydney College. Wed, Apr 11, 2012

List Iterator Implementation

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

The Coefficient of Determination

Displaying Distributions - Quantitative Variables

The CYK Parsing Algorithm

LR Parsing - The Items

Programming Languages

Lecture 19: OpenGL Texture Mapping. CITS3003 Graphics & Animation

The Projection Matrix

Recursion. Lecture 26 Sections , Robb T. Koether. Hampden-Sydney College. Mon, Apr 6, 2015

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

CS 432 Interactive Computer Graphics

The string Class. Lecture 21 Sections 2.9, 3.9, Robb T. Koether. Wed, Oct 17, Hampden-Sydney College

Webpage Navigation. Lecture 27. Robb T. Koether. Hampden-Sydney College. Mon, Apr 2, 2018

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

Discussion 3. PPM loading Texture rendering in OpenGL

GRAFIKA KOMPUTER. ~ M. Ali Fauzi

Stacks and their Applications

The Normal Distribution

Linked Lists. Lecture 16 Sections Robb T. Koether. Hampden-Sydney College. Wed, Feb 22, 2017

Street-Routing Problems

Implementing Linked Lists

The x86 Architecture

Building the Abstract Syntax Trees

Array Lists. Lecture 15. Robb T. Koether. Hampden-Sydney College. Fri, Feb 16, 2018

XML Attributes. Lecture 33. Robb T. Koether. Hampden-Sydney College. Wed, Apr 25, 2018

Regular Expressions. Lecture 10 Sections Robb T. Koether. Hampden-Sydney College. Wed, Sep 14, 2016

The Traveling Salesman Problem Cheapest-Link Algorithm

Pointers. Lecture 2 Sections Robb T. Koether. Hampden-Sydney College. Mon, Jan 20, 2014

XPath. Lecture 36. Robb T. Koether. Wed, Apr 16, Hampden-Sydney College. Robb T. Koether (Hampden-Sydney College) XPath Wed, Apr 16, / 28

Dynamic Allocation of Memory

CS212. OpenGL Texture Mapping and Related

Nondeterministic Programming in C++

Recognition of Tokens

Integer Overflow. Lecture 8 Section 2.5. Robb T. Koether. Hampden-Sydney College. Mon, Jan 27, 2014

Inheritance: The Fundamental Functions

Recursion. Lecture 2 Sections Robb T. Koether. Hampden-Sydney College. Wed, Jan 17, 2018

INF3320 Computer Graphics and Discrete Geometry

The Projection Matrix

Ambient and Diffuse Light

Function Definition Syntax Tree

INF3320 Computer Graphics and Discrete Geometry

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

List Iterators. Lecture 27 Section Robb T. Koether. Hampden-Sydney College. Wed, Apr 8, 2015

Inheritance: The Fundamental Functions

Aggregation. Lecture 7 Section Robb T. Koether. Hampden-Sydney College. Wed, Jan 29, 2014

Basic PHP Lecture 17

Binary Tree Applications

Programming Languages

PHP Queries and HTML Forms Lecture 23

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

List Iterators. Lecture 34 Section Robb T. Koether. Hampden-Sydney College. Wed, Apr 24, 2013

Function Usage. Lecture 15 Sections 6.3, 6.4. Robb T. Koether. Hampden-Sydney College. Mon, Oct 1, 2018

Relational Databases

Abstract Data Types. Lecture 23 Section 7.1. Robb T. Koether. Hampden-Sydney College. Wed, Oct 24, 2012

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

The x86 Instruction Set

Transcription:

Magnification and Minification Lecture 30 Robb T. Koether Hampden-Sydney College Fri, Nov 6, 2015 Robb T. Koether (Hampden-Sydney College) Magnification and Minification Fri, Nov 6, 2015 1 / 17

Outline 1 Applying Textures 2 Magnification 3 Minification 4 Filters 5 Assignment Robb T. Koether (Hampden-Sydney College) Magnification and Minification Fri, Nov 6, 2015 2 / 17

Outline 1 Applying Textures 2 Magnification 3 Minification 4 Filters 5 Assignment Robb T. Koether (Hampden-Sydney College) Magnification and Minification Fri, Nov 6, 2015 3 / 17

Applying Textures When a texture is applied to a primitive, the texels are mapped to the pixels of the rasterized primitive (usually a triangle). There is rarely a one-to-one match, leading to one of two situations. One texel maps to several pixels. Several texels map to one pixel. Robb T. Koether (Hampden-Sydney College) Magnification and Minification Fri, Nov 6, 2015 4 / 17

Applying Textures Definition (Magnification) Magnification is the mapping of one texel to several pixels (because the texel is magnified). Definition (Minification) Minification is the mapping of several texels to one pixel (because the texels are reduced). Robb T. Koether (Hampden-Sydney College) Magnification and Minification Fri, Nov 6, 2015 5 / 17

Applying Textures When mapping texels to pixels, we may choose between Applying the nearest texel to the pixel. Or linear interpolation among the four nearest texels. Interpolation uses a 2-dimensional weighted average of the 4 nearest texels, called bilinear interpolation. Robb T. Koether (Hampden-Sydney College) Magnification and Minification Fri, Nov 6, 2015 6 / 17

Outline 1 Applying Textures 2 Magnification 3 Minification 4 Filters 5 Assignment Robb T. Koether (Hampden-Sydney College) Magnification and Minification Fri, Nov 6, 2015 7 / 17

Magnification of Texels (Nearest) 1 texel mapped to 512 512 pixels Robb T. Koether (Hampden-Sydney College) Magnification and Minification Fri, Nov 6, 2015 8 / 17

Magnification of Texels (Nearest) 1 texel mapped to 256 256 pixels Robb T. Koether (Hampden-Sydney College) Magnification and Minification Fri, Nov 6, 2015 8 / 17

Magnification of Texels (Nearest) 1 texel mapped to 128 128 pixels Robb T. Koether (Hampden-Sydney College) Magnification and Minification Fri, Nov 6, 2015 8 / 17

Magnification of Texels (Nearest) 1 texel mapped to 64 64 pixels Robb T. Koether (Hampden-Sydney College) Magnification and Minification Fri, Nov 6, 2015 8 / 17

Magnification of Texels (Nearest) 1 texel mapped to 32 32 pixels Robb T. Koether (Hampden-Sydney College) Magnification and Minification Fri, Nov 6, 2015 8 / 17

Magnification of Texels (Nearest) 1 texel mapped to 16 16 pixels Robb T. Koether (Hampden-Sydney College) Magnification and Minification Fri, Nov 6, 2015 8 / 17

Magnification of Texels (Nearest) 1 texel mapped to 8 8 pixels Robb T. Koether (Hampden-Sydney College) Magnification and Minification Fri, Nov 6, 2015 8 / 17

Magnification of Texels (Nearest) 1 texel mapped to 4 4 pixels Robb T. Koether (Hampden-Sydney College) Magnification and Minification Fri, Nov 6, 2015 8 / 17

Outline 1 Applying Textures 2 Magnification 3 Minification 4 Filters 5 Assignment Robb T. Koether (Hampden-Sydney College) Magnification and Minification Fri, Nov 6, 2015 9 / 17

Minification of Texels (Nearest) Texels Pixels Minification at a 2 : 1 ratio Robb T. Koether (Hampden-Sydney College) Magnification and Minification Fri, Nov 6, 2015 10 / 17

Minification of Texels (Nearest) Texels Pixels Minification at a 2 : 1 ratio Robb T. Koether (Hampden-Sydney College) Magnification and Minification Fri, Nov 6, 2015 10 / 17

Minification of Texels (Nearest) Texels Pixels Minification at a 2 : 1 ratio Robb T. Koether (Hampden-Sydney College) Magnification and Minification Fri, Nov 6, 2015 10 / 17

Minification of Texels (Nearest) Texels Pixels Minification at a 2 : 1 ratio Robb T. Koether (Hampden-Sydney College) Magnification and Minification Fri, Nov 6, 2015 10 / 17

Minification of Texels (Nearest) Texels Pixels Minification at a 5 : 2 ratio Robb T. Koether (Hampden-Sydney College) Magnification and Minification Fri, Nov 6, 2015 11 / 17

Minification of Texels (Nearest) Texels Pixels Minification at a 5 : 2 ratio Robb T. Koether (Hampden-Sydney College) Magnification and Minification Fri, Nov 6, 2015 11 / 17

Minification of Texels (Nearest) Texels Pixels Minification at a 5 : 2 ratio Robb T. Koether (Hampden-Sydney College) Magnification and Minification Fri, Nov 6, 2015 11 / 17

Minification of Texels (Nearest) Texels Pixels Minification at a 5 : 2 ratio Robb T. Koether (Hampden-Sydney College) Magnification and Minification Fri, Nov 6, 2015 11 / 17

Other Problems 64 Texels 36 Pixels Undesirable effects Robb T. Koether (Hampden-Sydney College) Magnification and Minification Fri, Nov 6, 2015 12 / 17

Other Problems 64 Texels 36 Pixels Undesirable effects Robb T. Koether (Hampden-Sydney College) Magnification and Minification Fri, Nov 6, 2015 12 / 17

Other Problems 64 Texels 36 Pixels Undesirable effects (nearest) Robb T. Koether (Hampden-Sydney College) Magnification and Minification Fri, Nov 6, 2015 12 / 17

Other Problems 64 Texels 36 Pixels Undesirable effects (interpolated) Robb T. Koether (Hampden-Sydney College) Magnification and Minification Fri, Nov 6, 2015 12 / 17

Other Problems Texture Nearest Undesirable effects (nearest) Robb T. Koether (Hampden-Sydney College) Magnification and Minification Fri, Nov 6, 2015 12 / 17

Other Problems Texture Interpolated Undesirable effects (interpolated) Robb T. Koether (Hampden-Sydney College) Magnification and Minification Fri, Nov 6, 2015 12 / 17

Outline 1 Applying Textures 2 Magnification 3 Minification 4 Filters 5 Assignment Robb T. Koether (Hampden-Sydney College) Magnification and Minification Fri, Nov 6, 2015 13 / 17

Filters Filters gltexparameteri(gl_texture_2d, GL_TEXTURE_MAG_FILTER, GL_NEAREST); gltexparameteri(gl_texture_2d, GL_TEXTURE_MIN_FILTER, GL_NEAREST); We can specify filters for magnification and for minification. GL_NEAREST will use the nearest texel. Robb T. Koether (Hampden-Sydney College) Magnification and Minification Fri, Nov 6, 2015 14 / 17

Filters Filters gltexparameteri(gl_texture_2d, GL_TEXTURE_MAG_FILTER, GL_LINEAR); gltexparameteri(gl_texture_2d, GL_TEXTURE_MIN_FILTER, GL_LINEAR); We can specify filters for magnification and for minification. GL_LINEAR will interpolate texels. Robb T. Koether (Hampden-Sydney College) Magnification and Minification Fri, Nov 6, 2015 15 / 17

Outline 1 Applying Textures 2 Magnification 3 Minification 4 Filters 5 Assignment Robb T. Koether (Hampden-Sydney College) Magnification and Minification Fri, Nov 6, 2015 16 / 17

Homework Homework Read pages 259-263: Texture Mapping & Basic Texture Types Read pages 270-277: Texture Formats Robb T. Koether (Hampden-Sydney College) Magnification and Minification Fri, Nov 6, 2015 17 / 17