Texture and other Mappings

Similar documents
Shading. Flat shading Gouraud shading Phong shading

Announcements. Written Assignment 2 is out see the web page. Computer Graphics

Texture Mapping and Sampling

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

Texture mapping. Computer Graphics CSE 167 Lecture 9

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

Shading/Texturing. Dr. Scott Schaefer

CT5510: Computer Graphics. Texture Mapping

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

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

Texture Mapping II. Light maps Environment Maps Projective Textures Bump Maps Displacement Maps Solid Textures Mipmaps Shadows 1. 7.

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

INF3320 Computer Graphics and Discrete Geometry

Texture Mapping 1/34

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

CS 431/636 Advanced Rendering Techniques

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

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

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

Surface Rendering. Surface Rendering

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

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

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

Computer Graphics 7 - Texture mapping, bump mapping and antialiasing

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

Texture Mapping 1/34

Texture Mapping. Mike Bailey.

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

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

Computer Graphics. - Texturing Methods -

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

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

Reading. 12. Texture Mapping. Texture mapping. Non-parametric texture mapping. Required. w Watt, intro to Chapter 8 and intros to 8.1, 8.4, 8.6, 8.8.

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

CS 432 Interactive Computer Graphics

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

Lecture 07: Buffers and Textures

Textures. Texture coordinates. Introduce one more component to geometry

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

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

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

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

CS212. OpenGL Texture Mapping and Related

Overview. Hierarchy. Level of detail hierarchy Texture maps Procedural shading and texturing Texture synthesis and noise.

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

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

Computer Graphics Texture Mapping

CSE528 Computer Graphics: Theory, Algorithms, and Applications

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

GRAFIKA KOMPUTER. ~ M. Ali Fauzi

3D Rasterization II COS 426

Lecture 19: OpenGL Texture Mapping. CITS3003 Graphics & Animation

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

Texture Mapping. Brian Curless CSE 457 Spring 2015

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

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

Texture Mapping. Reading. Implementing texture mapping. Texture mapping. Daniel Leventhal Adapted from Brian Curless CSE 457 Autumn 2011.

Reading. Texture Mapping. Non-parametric texture mapping. Texture mapping. Required. Angel, 8.6, 8.7, 8.9, 8.10,

CS 5600 Spring

CPSC / Texture Mapping

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

Texturing. Texture Mapping. Texture Mapping. Have seen: colour can be assigned to ver7ces But: don t want to represent all this detail with geometry

Reading. Texture Mapping. Non-parametric texture mapping. Texture mapping. Required. Angel, 8.6, 8.7, 8.9, Recommended

Motivation. towards more realism. + Texture Mapping Texture Mapping

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

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

Texture Mapping. Brian Curless CSE 457 Spring 2016

Computer Graphics Texture Mapping

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

CIS 536/636 Introduction to Computer Graphics. Kansas State University. CIS 536/636 Introduction to Computer Graphics

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

CS 130 Final. Fall 2015

INF3320 Computer Graphics and Discrete Geometry

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

Computer Graphics. Lecture 8 Antialiasing, Texture Mapping

Grafica Computazionale

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

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

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

Programming Graphics Hardware

ECS 175 COMPUTER GRAPHICS. Ken Joy.! Winter 2014

Texture Mapping and Special Effects

Textures. Texture Mapping. Bitmap Textures. Basic Texture Techniques

Computer Graphics

Recollection. Models Pixels. Model transformation Viewport transformation Clipping Rasterization Texturing + Lights & shadows

SUMMARY. CS380: Introduction to Computer Graphics Texture Mapping Chapter 15. Min H. Kim KAIST School of Computing 18/05/03.

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

Topics and things to know about them:

Computer Graphics (CS 543) Lecture 7b: Intro to lighting, Shading and Materials + Phong Lighting Model

TEXTURE MAPPING. DVA338 Computer Graphics Thomas Larsson, Afshin Ameri

CS 4620 Program 3: Pipeline

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

Texture Mapping CSCI 4229/5229 Computer Graphics Fall 2016

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

Lecture 5 3D graphics part 3

CS 5625 Lec 2: Shading Models

w Foley, Section16.1 Reading

Computergraphics Exercise 15/ Shading & Texturing

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

Illumination Models & Shading

Transcription:

Texture and other Mappings Texture Mapping Bump Mapping Displacement Mapping Environment Mapping Example: Checkerboard Particularly severe problems in regular textures 1

The Beginnings of a Solution: Mipmapping Pre-calculate how the texture should look at various distances, then use the appropriate texture at each distance. This is called mipmapping. Mip multum in parvo or many things in a small place Each mipmap (each image below) represents a level of resolution. Powers of 2 make things much easier. The Beginnings of a Solution Problem: Clear divisions between different depth levels Mipmapping alone is unsatisfactory. 2

Another Component: Filtering Anisotropic filtering Basic filtering methods assume that a pixel on-screen maps to a square (isotropic) region of the texture For surfaces tilted away from the viewer, this is not the case! Image courtesy of nvidia Figure 5. Anisotropic footprints are very common. Bilinear Filtering ID Software 3

Trilinear Filtering ID Software Anisotropic Filtering ID Software 4

Side-by-Side Comparison nvidia Or design the mapping by hand 5

www.uvmapper.com Demo: uvmapper Uses for Texture Mapping Use texture to affect a variety of parameters surface color (Catmull 1974) - color (radiance) of each point on surface surface reflectance - reflectance coefficients k d, k s, or n shiny normal vector - bump mapping (Blinn 1978) geometry - displacement mapping transparency - transparency mapping (clouds) (Gardener 1985) light source radiance - environment mapping (Blinn 1978) 6

Radiance vs. Reflectance Mapping + = Sphere w/ Uniform Diffuse coefficient Radiance Map Sphere w/ Radiance Map Texture specifies (isotropic) radiance for each point on surface + = Sphere w/ Uniform Diffuse coefficient Reflectance (k d ) Map Sphere w/ Reflectance Map Texture specifies diffuse color (k d coefficients) for each point on surface - three coefficients, one each for R, G, and B radiance channels Bump Mapping: A Dirty Trick Which spots bulge out, and which are indented? Answer: None! This is a flat image. The human visual system is hard-coded to expect light from above In CG, we can perturb the normal vector without having to make any actual change to the shape. 7

Bump Mapping Basic texture mapping paints on to a smooth surface How do you make a surface look rough? Option 1: model the surface with many small polygons Option 2: perturb the normal vectors before the shading calculation Real Bump Fake Bump Flat Plane + = Sphere w/diffuse Texture Map Bump Map Sphere w/diffuse Texture + Bump Map Bump Mapping We can perturb the normal vector without having to make any actual change to the shape. This illusion can be seen through how? Original model (5M) Simplified (500) Simple model with bump map 8

Bump Mapping Greg Turk Another Bump Mapping Example + = Bump Map Cylinder w/diffuse Texture Map 9

Displacement Mapping Use texture map to displace each point on the surface Texture value gives amount to move in direction normal to surface How is this different from bump mapping? Environment Mapping Specular reflections that mirror the environment 10

Environment Mapping Specular reflections that mirror the environment Cube is a natural intermediate object for a room eye Environment Mapping: Cube Maps 11

Basics of Texture Mapping in OpenGL Glubyte my_texels[512][512][3]; Gluint texid; glgentextures(1, &texid); glbindtexture(gl_texture_2d, texid); glteximage2d(gl_texture_2d, 0, GL_RGB, 512, 512, 0, GL_RGB,GL_UNSIGNED_BYTE, my_texels); /* level, components, w, h, border, format, type, tarray */ /* assign texture coordinates */ glenable(gl_texture_2d); glbegin(gl_quad); gltexcoord2f(0.0, 0.0); glvertex3f(x1,y1,z1); gltexcoord2f(1.0, 0.0); glvertex3f(x2,y2,z2); gltexcoord2f(1.0,1.0); glvertex3f(x3,y3,z3); gltexcoord2f(0.0,1.0); glvertex3f(x4,y4,z4); glend(); gldisable(gl_texture_2d); Grungy details we ve ignored Specify s or t out of range? Use GL_TEXTURE_WRAP in gltexparameter because many textures are carefully designed to repeat Aliasing? Mapping doesn t send you to the center of a texel. Can average nearest 2x2 texels using GL_LINEAR Mipmapping: use textures of varying resolutions. 64x64 becomes 32x32,16x16,8x8,4x4,2x2 and 1x1 arrays with glubuild2dmipmaps 12

Texture Generation Photographs Drawings Procedural methods (2D or 3D) Associate each x,y,z value directly with an s,t,r value in the texture block (sculpting in marble and granite) Procedural Methods Reaction-Diffusion Greg Turk, Siggraph 91 13

Solid Textures Have a 3-D array of texture values (e.g., a block of marble) Use a function [xyz] -> [RGB] to map colors to points in space Such a 3D map is called a solid texture map In practice the map is often defined procedurally No need to store an entire 3D array of colors Just define a function to generate a color for each 3D point The most interesting solid textures are random ones a great marble algorithm has now become cliché Evaluate the texture coordinates in object coordinates - otherwise moving the object changes its texture! From: An Image Synthesizer by Ken Perlin, SIGGRAPH '85 14