Computer Graphics. Lecture 8 Antialiasing, Texture Mapping

Similar documents
Computer Graphics 7 - Texture mapping, bump mapping and antialiasing

Texture mapping. Computer Graphics CSE 167 Lecture 9

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

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

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

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

CSE528 Computer Graphics: Theory, Algorithms, and Applications

3D Rasterization II COS 426

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

TEXTURE MAPPING. DVA338 Computer Graphics Thomas Larsson, Afshin Ameri

CS 130 Final. Fall 2015

Rendering. Converting a 3D scene to a 2D image. Camera. Light. Rendering. View Plane

Texture Mapping and Sampling

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

+ = To Do. Texture Mapping. Adding Visual Detail. Parameterization. Option: Varieties of projections. Computer Graphics. geometry

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

Sampling, Aliasing, & Mipmaps

+ = To Do. Adding Visual Detail. Texture Mapping. Parameterization. Option: Varieties of projections. Foundations of Computer Graphics (Fall 2012)

CS 431/636 Advanced Rendering Techniques

CS 354R: Computer Game Technology

Computer Graphics. Texture Filtering & Sampling Theory. Hendrik Lensch. Computer Graphics WS07/08 Texturing

Computer Graphics. Lecture 14 Bump-mapping, Global Illumination (1)

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

2D rendering takes a photo of the 2D scene with a virtual camera that selects an axis aligned rectangle from the scene. The photograph is placed into

Sampling, Aliasing, & Mipmaps

Perspective Projection and Texture Mapping

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

Lets assume each object has a defined colour. Hence our illumination model is looks unrealistic.

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

CSCI 420 Computer Graphics Lecture 14. Rasterization. Scan Conversion Antialiasing [Angel Ch. 6] Jernej Barbic University of Southern California

CS 428: Fall Introduction to. Texture mapping and filtering. Andrew Nealen, Rutgers, /18/2010 1

Computer Graphics. Shadows

Fall CSCI 420: Computer Graphics. 7.1 Rasterization. Hao Li.

Rasterization. Rasterization (scan conversion) Digital Differential Analyzer (DDA) Rasterizing a line. Digital Differential Analyzer (DDA)

Computer Graphics 10 - Shadows

Rendering Grass Terrains in Real-Time with Dynamic Lighting. Kévin Boulanger, Sumanta Pattanaik, Kadi Bouatouch August 1st 2006

INF3320 Computer Graphics and Discrete Geometry

INF3320 Computer Graphics and Discrete Geometry

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

CS4620/5620: Lecture 14 Pipeline

Texture Mapping 1/34

CT5510: Computer Graphics. Texture Mapping

Point-Based Rendering

Pipeline Operations. CS 4620 Lecture 10

CS 450: COMPUTER GRAPHICS TEXTURE MAPPING SPRING 2015 DR. MICHAEL J. REALE

CS559: Computer Graphics. Lecture 12: Antialiasing & Visibility Li Zhang Spring 2008

Texture-Mapping Tricks. How Bad Does it Look? We've Seen this Sort of Thing Before. Sampling Texture Maps

Review of Tuesday. ECS 175 Chapter 3: Object Representation

Sampling, Aliasing, & Mipmaps

Textures. Texture coordinates. Introduce one more component to geometry

CS 498 VR. Lecture 19-4/9/18. go.illinois.edu/vrlect19

You can select polygons that use per-poly UVs by choosing the Select by Polymap command ( View > Selection > Maps > Select by Polygon Map).

Filtering theory: Battling Aliasing with Antialiasing. Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology

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

Filtering theory: Battling Aliasing with Antialiasing. Department of Computer Engineering Chalmers University of Technology

Topic 12: Texture Mapping. Motivation Sources of texture Texture coordinates Bump mapping, mip-mapping & env mapping

Theoretically Perfect Sensor

COMP371 COMPUTER GRAPHICS

Topic 11: Texture Mapping 11/13/2017. Texture sources: Solid textures. Texture sources: Synthesized

28 SAMPLING. ALIASING AND ANTI-ALIASING

Reading. 18. Projections and Z-buffers. Required: Watt, Section , 6.3, 6.6 (esp. intro and subsections 1, 4, and 8 10), Further reading:

Real-Time Graphics Architecture. Kurt Akeley Pat Hanrahan. Texture

Pipeline Operations. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 11

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


Topic 11: Texture Mapping 10/21/2015. Photographs. Solid textures. Procedural

CS 4620 Midterm, March 21, 2017

Texture Mapping 1/34

Einführung in Visual Computing

Computer Graphics. - Texturing Methods -

Theoretically Perfect Sensor

Barycentric Coordinates and Parameterization

Textures and normals in ray tracing

8/5/2012. Introduction. Transparency. Anti-Aliasing. Applications. Conclusions. Introduction

Programming Graphics Hardware

CSE 167: Lecture #5: Rasterization. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012

Pipeline Operations. CS 4620 Lecture 14

Hidden surface removal. Computer Graphics

Announcements. Written Assignment 2 out (due March 8) Computer Graphics

Texture and other Mappings

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

The Traditional Graphics Pipeline

Magnification and Minification

CPSC / Texture Mapping

Some Tutorial about the Project. Computer Graphics

Ptex: Per-face Texture Mapping for Production Rendering

The Traditional Graphics Pipeline

Computer Graphics Lecture 11

Texture. Texture Mapping. Texture Mapping. CS 475 / CS 675 Computer Graphics. Lecture 11 : Texture

CS 475 / CS 675 Computer Graphics. Lecture 11 : Texture

Introduction Rasterization Z-buffering Shading. Graphics 2012/2013, 4th quarter. Lecture 09: graphics pipeline (rasterization and shading)

Fast Texture Based Form Factor Calculations for Radiosity using Graphics Hardware

Homework #2. Shading, Ray Tracing, and Texture Mapping

Computer Graphics - Week 7

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

Lecture 07: Buffers and Textures

The Rasterizer Stage. Texturing, Lighting, Testing and Blending

Einführung in Visual Computing

Transcription:

Computer Graphics Lecture 8 Antialiasing, Texture Mapping

Today Texture mapping Antialiasing Antialiasing-textures

Texture Mapping : Why needed? Adding details using high resolution polygon meshes is costly Not very suitable for real-time applications by Rami Ali Al-ashqar

Texture mapping. Method of improving surface appearance by mapping images onto the surface Done at the rasterization stage

Principles of Texture Mapping For each triangle in the model, establish a corresponding region in the texture image Image has much higher resolution than mesh During the rasterization, color the surface by that of the texture UV coordinates: the 2D coordinates of the texture map

Interpolating the uv coordinates To compute the UV inside the triangle, interpolate those at the vertices Done at the rasterization stage Use barycentric coordinates u= α u + β u2 + γ u3 v = α v + β v2 + γ v3 1 1

1.What is the color of the 3 vertices of the triangle? 2.How will the textured triangle look like?

How to Produce a UV Mapping? Use common mappings Orthogonal, cylindrical, spherical Capturing the real data Obtain the color as well as the 3D shape Manually specify the correspondence Using graphical tools Using automatic segmentation, unfolding

Common Texture Coordinate Mappings Orthogonal Cylindrical Spherical

Capture Real Data Capture the depth as well as the color http://www.3dface.org/media/imag es.html

Manually specifying the mapping There are good tools to map the texture to the surface, for example, Directly painting on 3D geometry Manually align unfolded data on the image

Unfolding the geometry Segmenting the body into a set of charts Unfolded onto a 2D plane Packing: The charts are gathered in texture space The artist can then draw the texture on a 2D plane Creating a UV map on Maya Levy et al. SIGGRAPH 2002 http://www.youtube.com/w atch?v=hqkdadeutfc

Problems with Linear Interpolation of UV Coordinates Linear interpolation in screen space: texture source what we get what we want

Why Does it Happen? Uniform steps on the image plane does not correspond to uniform steps in the original 3D scene

Solution : Hyperbolic Interpolation (u,v) cannot be linearly interpolated, but 1/w and (u/w, v/w) can Compute (u,v) by dividing the interpolated (u/w, v/w) by the interpolated 1/w w is the last component after the canonical view transformation A w is computed for every 3D vertex

Texture Mapping Examples Linear interpolation vs. Hyperbolic interpolation Two triangles per square

Questions 1. In what case hyperbolic interpolation is needed? 2. Then, how can we solve the problem without using hyperbolic interpolation?

Texture Mapping & Illumination Texture mapping can be used to alter some or all of the constants in the illumination equation: Use the texture color as the diffuse color more natural appearance

Today Texture mapping Antialiasing Antialiasing textures

Anti-aliasing Aliasing: distortion artifacts produced when representing a high-resolution signal at a lower resolution. Anti-aliasing : techniques to remove aliasing Aliased polygons (jagged edges) Anti-aliased polygons

Why Does Aliasing Happen? Sampling frequency is too low with respect to the signal frequency In the example below, the pixel size is too large compared to the original scene

Nyquist Limit The signal frequency (fsignal) should be no greater than half the sample frequency (fsample) fsignal < 0.5 fsample In the top, fsignal = 0.8 fsample -> cannot reconstruct the original signal In the bottom fsignal =0.5 fsample -> the original signal can be reconstructed by slightly increasing the sampling rate

Wagon-wheel Effect (temporal aliasing)

Anti-aliasing by Subsampling 1. 2. 3. Each pixel is subdivided (sub-sampled) into n regions Obtain the color at each subpixel Compute the average color

Different Sampling Schemes

Stochastic Sampling A scene can be produced of objects that are arbitrarily small A regular pattern of sampling will exhibit some sort of aliasing By irregular sampling, the higher frequencies appear in the image as noise rather than aliases Humans are more sensitive to aliases than noise

Stochastic Sampling One approach to solve this is to randomly sample over the pixels Jittering : subdivide into n regions of equal size and randomly sample inside each region Compute the colour at the sample and average Can precompute a table and recycle it or simply jitter on the fly

Comparison

Accumulation Buffer (A-Buffer) Use a buffer that has the same resolution as the original image To obtain a 2x2 sampling of a scene, 4 images are made by shifting the frame buffer horizontally/vertically for half a pixel The results are accumulated and the final results are obtained by averaging We can recycle the vertex attributes Pixel center Subsampled point

Today Texture mapping Antialiasing Antialiasing textures

Aliasing of textures Happens when the camera is zoomed too much into the textured surface (magnification) Several texels (pixels of the texture) covering a pixel s cell (minification)

Texture Magnification Zooming too much into a surface with a texture One texel covering many pixels

Bilinear Interpolation Mapping the pixel centre to the uv coordinates Computing the pixel colour by interpolating the surrounding texel values

Bilinear Interpolation - 2 For (pu, pv), compute its (u,v) coordinates by barycentric coordinates u = pu (int)pu, v = pv - (int)pv xl = pu, xr = pu +1, yb = pv, yt = pv +1, (pu, pv) : the pixel centre mapped into the texture space b(pu,pv) : the colour at point pu, pv t(x,y) : the texel colour at (x,y) u = pu (int)pu, v = pv - (int)pv

Texture Minification Many texels covering a pixel s cell Results in aliasing (remember Nyquist limit) The artifacts are even more noticeable when the surface moves

Texture Minification (2) We can do subsampling as before But actually we know the texture pattern in advance Mipmapping

MIP map Multum In Parvo = Many things in a small place Produce a texture of multiple resolutions Switch the resolution according to the number of texels in one pixel Select a level that the ratio of the texture and the pixel is 1:1

Selecting the resolution in Mipmap Map the pixel corners to the texture space Find the resolution that roughly covers the mapped quadrilateral Apply a bilinear interpolation in that resolution, Or find the two surrounding resolutions and apply a trilinear interpolation (also along the resolution axis)

Texture Minification Multiple textures in a single pixel Solution: Nearest neighbour Bilinear blending Mipmapping

Summary 1. Texture mapping a. Different ways to synthesize the texture maps b. Hyperbolic interpolation 2. Antialiasing a. Nyquest limit b. Subsampling c. texture maps i. magnification : bilinear interpolation ii. minification : mipmapping

Reading List Shirley et al. Chapter 11. Akenine-Moller Chapter 5.6, 6.2 http://books.google.co.uk/books?id=v1k1v9ra1fo C&pg=PA418&dq=real-time+rendering+texture+ma pping&hl=ja&sa=x&ei=erdxutcbbsja0qwazyh oaw&redir_esc=y#v=onepage&q=real-time%20ren dering%20texture%20mapping&f=false