CS 354R: Computer Game Technology

Similar documents
Introduction to 3D Graphics

CS 130 Final. Fall 2015

CHAPTER 1 Graphics Systems and Models 3

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

INF3320 Computer Graphics and Discrete Geometry

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

Texture mapping. Computer Graphics CSE 167 Lecture 9

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

Pipeline Operations. CS 4620 Lecture 14

Computer Graphics (CS 543) Lecture 10: Soft Shadows (Maps and Volumes), Normal and Bump Mapping

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

Lecture 2. Shaders, GLSL and GPGPU

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

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

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

Textures. Texture coordinates. Introduce one more component to geometry

Real-Time Shadows. Last Time? Textures can Alias. Schedule. Questions? Quiz 1: Tuesday October 26 th, in class (1 week from today!

CS 431/636 Advanced Rendering Techniques

Computer graphics 2: Graduate seminar in computational aesthetics

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

Computer Graphics. Lecture 9 Environment mapping, Mirroring

Department of Computer Engineering 3D Graphics in Games and Movies

Programming Graphics Hardware

Rasterization Overview

CMSC427 Advanced shading getting global illumination by local methods. Credit: slides Prof. Zwicker

Getting fancy with texture mapping (Part 2) CS559 Spring Apr 2017

Real - Time Rendering. Graphics pipeline. Michal Červeňanský Juraj Starinský

lecture 18 - ray tracing - environment mapping - refraction

Pipeline Operations. CS 4620 Lecture 10

Rasterization and Graphics Hardware. Not just about fancy 3D! Rendering/Rasterization. The simplest case: Points. When do we care?

Image-Based Lighting. Inserting Synthetic Objects

3D graphics, raster and colors CS312 Fall 2010

Last Time. Why are Shadows Important? Today. Graphics Pipeline. Clipping. Rasterization. Why are Shadows Important?

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

Shading Shades. Frank Jargstorff. June 1, Abstract

Real-Time Shadows. Last Time? Today. Why are Shadows Important? Shadows as a Depth Cue. For Intuition about Scene Lighting

Game Architecture. 2/19/16: Rasterization

CSE528 Computer Graphics: Theory, Algorithms, and Applications

Last Time. Reading for Today: Graphics Pipeline. Clipping. Rasterization

Computergrafik. Matthias Zwicker. Herbst 2010

AGDC Per-Pixel Shading. Sim Dietrich

Graphics Hardware. Instructor Stephen J. Guy

For Intuition about Scene Lighting. Today. Limitations of Planar Shadows. Cast Shadows on Planar Surfaces. Shadow/View Duality.

3D Programming. 3D Programming Concepts. Outline. 3D Concepts. 3D Concepts -- Coordinate Systems. 3D Concepts Displaying 3D Models

CS GPU and GPGPU Programming Lecture 2: Introduction; GPU Architecture 1. Markus Hadwiger, KAUST

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

Introduction to Visualization and Computer Graphics

CS 4620 Program 3: Pipeline

CS451Real-time Rendering Pipeline

Evolution of GPUs Chris Seitz

CS 464 Review. Review of Computer Graphics for Final Exam

CPSC / Texture Mapping


The Rasterization Pipeline

Image-Based Lighting. Eirik Holmøyvik. with a lot of slides donated by Paul Debevec

Advanced Lighting Techniques Due: Monday November 2 at 10pm

Spring 2009 Prof. Hyesoon Kim

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

Image-Based Lighting

Bringing Hollywood to Real Time. Abe Wiley 3D Artist 3-D Application Research Group

Building scalable 3D applications. Ville Miettinen Hybrid Graphics

Shadows in the graphics pipeline

Graphics Performance Optimisation. John Spitzer Director of European Developer Technology

Shaders (some slides taken from David M. course)

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

CS 381 Computer Graphics, Fall 2008 Midterm Exam Solutions. The Midterm Exam was given in class on Thursday, October 23, 2008.

TSBK03 Screen-Space Ambient Occlusion

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

Computer Graphics Introduction. Taku Komura

Computer Graphics Texture Mapping

Models and Architectures

The Graphics Pipeline

Shadow Techniques. Sim Dietrich NVIDIA Corporation

Dual-Paraboloid Shadow Mapping. A paper by Stefan Brabec, Thomas Annen, Hans-Peter Seidel Presented By Patrick Wouterse, Selmar Kok

LEVEL 1 ANIMATION ACADEMY2010

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

Tutorial on GPU Programming #2. Joong-Youn Lee Supercomputing Center, KISTI

Deferred Rendering Due: Wednesday November 15 at 10pm

Chapter 7 - Light, Materials, Appearance

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

CS 381 Computer Graphics, Fall 2012 Midterm Exam Solutions. The Midterm Exam was given in class on Tuesday, October 16, 2012.

Texture Mapping and Sampling

CS4620/5620: Lecture 14 Pipeline

Introduction to Computer Graphics with WebGL

Shadow Algorithms. CSE 781 Winter Han-Wei Shen

Interactive Computer Graphics A TOP-DOWN APPROACH WITH SHADER-BASED OPENGL

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

Computer Graphics. Lecture 8 Antialiasing, Texture Mapping

Introduction to Shaders.

Surface Graphics. 200 polys 1,000 polys 15,000 polys. an empty foot. - a mesh of spline patches:

Shaders. Slide credit to Prof. Zwicker

C P S C 314 S H A D E R S, O P E N G L, & J S RENDERING PIPELINE. Mikhail Bessmeltsev

Models and Architectures. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

Real-Time Universal Capture Facial Animation with GPU Skin Rendering

3D Rasterization II COS 426

Soft shadows. Steve Marschner Cornell University CS 569 Spring 2008, 21 February

Lecture 17: Shading in OpenGL. CITS3003 Graphics & Animation

CS230 : Computer Graphics Lecture 4. Tamar Shinar Computer Science & Engineering UC Riverside

Module Contact: Dr Stephen Laycock, CMP Copyright of the University of East Anglia Version 1

3D Rendering Pipeline

Transcription:

CS 354R: Computer Game Technology Texture and Environment Maps Fall 2018

Texture Mapping Problem: colors, normals, etc. are only specified at vertices How do we add detail between vertices without incurring penalty for higher poly count? Solution: Specify details in an image (the texture) and specify how to apply the image to the geometry (the map) Works for shading parameters other than color 2

Basic Mapping Textures live in a 2D space Parameterize points in the texture with 2 coordinates: (s, t) Define the mapping from (x, y, z) in world space to (s, t) in texture space For polygons: Specify (s, t) coordinates at vertices Interpolate (s, t) for other points 3

Basic Texturing Concepts and Terms Vertices are coordinates that define geometry Texture coordinates specified at vertices and interpolated across triangles Texture values for points mapping outside the texture image can be generated in various ways: REPEAT, CLAMP, etc Width and height of texture images is often constrained Powers of two Sometimes required to be a square Fragments are single pixels (or sub-pixels) that must be lit and rasterized 4

Aliasing Artifacts Texture sampling (aliasing) creates visual artifacts Mipmaps and other filtering techniques are the solution 5

Multitexturing Multitexturing hardware provides pipeline of texture units to work on fragments Apply multiple textures to a primitive in the same pass Example 1. Apply color map 2. Modify illumination to simulate bumps 3. Modify opacity Note that this is not the same as a multi-pass rendering done in a single pass! 6

Pixel Shaders Pixel shaders operate on fragments in parallel (Vertex shaders operate on vertices in parallel) Can compute texture coordinates, do general texture lookups, modify color/depth/opacity, and some other functions More general than multi-texturing and very powerful Shader languages include GLSL, HLSL and Cg We won t go into shading for this course, but here is a basic tutorial: http://www.lighthouse3d.com/tutorials/glsl-tutorial/ 7

Textures in Games Modern game engines provide a lot of texture support Automatic texture atlasing High level of control for importing and editing Varying resolutions to support hardware performance Artist tools often included for texture management Design texture images Specify how to apply to object Profiling to maintain good memory and performance bounds 8

Texture Atlasing A packed set of textures (or sprites) 2D Example: a sprite sheet 9

3D Example: Texture Tool 10

Packing Textures Problem: Limits on texture width/height make it inefficient to store many, high-quality textures Solution: Artists pack the textures for many objects into one image The texture coordinates for a given object may only index into a small part of the image Care must be taken at sub-image boundary to achieve correct blending Mipmapping is restricted Best for objects that are at a known resolution 11

Combining Textures 12

A Larger Example 13

Animating Texture The texture matrix can transform the texture in memory Less expensive than loading multiple textures onto the graphics card Allows texture to slide, rotate, and stretch/shrink over surface If the texture matrix is changed from frame to frame, the texture will appear to move on the object Useful for things like flame, swirling vortices, or pulsing entrances 14

Projective Texturing The texture can be projected onto the scene as if from a slide projector Equate texture coordinates with world coordinates Wherever a world point appears in the projector s view, it picks up the texture at that point Useful for other texture projections such as shadow mapping Original paper: [http://www.nvidia.com/object/ Projective_Texture_Mapping.html] 15

What Do Textures Represent? The graphics hardware doesn t know what is in a texture It applies a set of operations using values it finds in the texture, the existing value of the fragment (pixel), and maybe another color The programmer decides what these operations are Examples: Scalar luminance data (multiplies the fragment color) Alpha data (multiplies the fragment s alpha channel) Vector data (modifies the surface normals) Depth data (determines distance from light source for shadow mapping) 16

Textures In Digital Art Assets designed for modern graphics pipeline Low-poly, high-texture Multiple maps for multiple effects Example: https:// www.artstation.com/ artwork/2yvkb (Arnab Roy, Maya) 17

Question How can we capture reflection in a local shading model that doesn t consider neighboring objects? 18

Environment Mapping Environment mapping produces reflections on shiny objects Texture is transferred in the direction of the reflected ray from the environment map onto the object Environment Map Viewer Reflected ray Object 19

Environment Mapping cont d Reflected ray: R = I - 2(N I)N (NVidia CG Tutorial) 20

Example 21

Mapping Approximations We can t store a separate map for each point, so one map is used with the eye at the center of the object Introduces distortions in the reflection Distortions minimized for a small object in a large room Object will not reflect itself Mapping can be computed at each pixel or only at the vertices 22

Types of Environment Maps Environment map may take one of several forms: Cubic mapping Spherical mapping (two variants) Parabolic mapping Describes the shape of the surface on which the map resides Determines how the map is generated and how it is indexed Issues in choosing a map: Memory Computation Accuracy 23

Cube Mapping The map resides on the surfaces of a cube around the object Typically align the faces of the cube with the coordinate axes Can make map rendering arbitrarily complex as its possible to do off-line For each face of the cube either: Render the world from the center of the object with the cube face as the image plane Or take 6 photos of a real environment with a camera in the object s position 24

Cube Map Example 25