Texture Mapping. Texture Coord Generation. gltexgen. gltexgen (cont d) Reference Plane. Map a 2D Texture onto an Object. Consider a Cylinder

Similar documents
Computer Applications in Textile Engineering. Computer Applications in Textile Engineering

Image Processing and Computer Graphics. Rendering Pipeline. Matthias Teschner. Computer Science Department University of Freiburg

INTRODUCTION TO RENDERING TECHNIQUES

OpenGL Performance Tuning

GUI GRAPHICS AND USER INTERFACES. Welcome to GUI! Mechanics. Mihail Gaianu 26/02/2014 1

Monash University Clayton s School of Information Technology CSE3313 Computer Graphics Sample Exam Questions 2007

Workstation Applications for Windows. NVIDIA MAXtreme User s Guide

Introduction to Computer Graphics

Shader Model 3.0. Ashu Rege. NVIDIA Developer Technology Group

Course Overview. CSCI 480 Computer Graphics Lecture 1. Administrative Issues Modeling Animation Rendering OpenGL Programming [Angel Ch.

Computer Animation: Art, Science and Criticism

Software Virtual Textures

Hi everyone, my name is Michał Iwanicki. I m an engine programmer at Naughty Dog and this talk is entitled: Lighting technology of The Last of Us,

High Dynamic Range and other Fun Shader Tricks. Simon Green

GPUs Under the Hood. Prof. Aaron Lanterman School of Electrical and Computer Engineering Georgia Institute of Technology

Interactive Level-Set Deformation On the GPU

How To Make A Texture Map Work Better On A Computer Graphics Card (Or Mac)

Computer Graphics Global Illumination (2): Monte-Carlo Ray Tracing and Photon Mapping. Lecture 15 Taku Komura

Quick Tutorial. Overview. The NVIDIA Software Improvement Program. Creating an Effect

Deferred Shading & Screen Space Effects

Using Photorealistic RenderMan for High-Quality Direct Volume Rendering

Cork Education and Training Board. Programme Module for. 3 Dimensional Computer Graphics. Leading to. Level 5 FETAC

Optimization for DirectX9 Graphics. Ashu Rege

Modern Graphics Engine Design. Sim Dietrich NVIDIA Corporation

Dhiren Bhatia Carnegie Mellon University

CSE 167: Lecture 13: Bézier Curves. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011

COMP175: Computer Graphics. Lecture 1 Introduction and Display Technologies

The Evolution of Computer Graphics. SVP, Content & Technology, NVIDIA

GPU Shading and Rendering: Introduction & Graphics Hardware

NVPRO-PIPELINE A RESEARCH RENDERING PIPELINE MARKUS TAVENRATH MATAVENRATH@NVIDIA.COM SENIOR DEVELOPER TECHNOLOGY ENGINEER, NVIDIA

We can display an object on a monitor screen in three different computer-model forms: Wireframe model Surface Model Solid model

Recent Advances and Future Trends in Graphics Hardware. Michael Doggett Architect November 23, 2005

REAL-TIME IMAGE BASED LIGHTING FOR OUTDOOR AUGMENTED REALITY UNDER DYNAMICALLY CHANGING ILLUMINATION CONDITIONS

Interactive visualization of multi-dimensional data in R using OpenGL

Lighting & Rendering in Maya: Lights and Shadows

Curves and Surfaces. Goals. How do we draw surfaces? How do we specify a surface? How do we approximate a surface?

Lezione 4: Grafica 3D*(II)

Image Synthesis. Transparency. computer graphics & visualization

Path Tracing. Michael Doggett Department of Computer Science Lund university Michael Doggett

3D Computer Games History and Technology

Lecture Notes, CEng 477

Computer Graphics CS 543 Lecture 12 (Part 1) Curves. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

Computer Graphics. Introduction. Computer graphics. What is computer graphics? Yung-Yu Chuang

Volumes of Revolution

An introduction to Global Illumination. Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology

CUBE-MAP DATA STRUCTURE FOR INTERACTIVE GLOBAL ILLUMINATION COMPUTATION IN DYNAMIC DIFFUSE ENVIRONMENTS

White Paper. Advances in Imaging to Improve Output Quality. April The Xerox Versant and EFI Fiery Digital Front End.

Volume Rendering on Mobile Devices. Mika Pesonen

3D Math Overview and 3D Graphics Foundations

So, you want to make a photo-realistic rendering of the Earth from orbit, eh? And you want it to look just like what astronauts see from the shuttle

Cartoon-Looking Rendering of 3D-Scenes

Optimizing Unity Games for Mobile Platforms. Angelo Theodorou Software Engineer Unite 2013, 28 th -30 th August

PRODUCT LIFECYCLE MANAGEMENT COMPETENCY CENTRE RENDERING. PLMCC, JSS Academy of Technical Education, Noida Rendering 1 of 16

Geometry of Vectors. 1 Cartesian Coordinates. Carlo Tomasi

H.Calculating Normal Vectors

GPU Christmas Tree Rendering. Evan Hart

Advanced Computer Graphics. Rendering Equation. Matthias Teschner. Computer Science Department University of Freiburg

Introduction GPU Hardware GPU Computing Today GPU Computing Example Outlook Summary. GPU Computing. Numerical Simulation - from Models to Software

Making natural looking Volumetric Clouds In Blender 2.48a

CSE 564: Visualization. GPU Programming (First Steps) GPU Generations. Klaus Mueller. Computer Science Department Stony Brook University

(Refer Slide Time: 1:42)

Interactive Computer Graphics

A Short Introduction to Computer Graphics

Procedural Shaders: A Feature Animation Perspective

Introduction to Computer Graphics

Cortona3D Viewer. User's Guide. Copyright ParallelGraphics

Overview Motivation and applications Challenges. Dynamic Volume Computation and Visualization on the GPU. GPU feature requests Conclusions

Shadows. Shadows. Thanks to: Frédo Durand and Seth Teller MIT. Realism Depth cue

Rendering Area Sources D.A. Forsyth

Photo Studio. Site Map Preface What`s New? Getting Started Basic Tasks Advanced Tasks Workbench Description Customizing Glossary Index

OpenGL Insights. Edited by. Patrick Cozzi and Christophe Riccio

Autodesk Revit Architecture 2011 Professional Massmodeling Rendering Video Tutorial

Color correction in 3D environments Nicholas Blackhawk

Touchstone -A Fresh Approach to Multimedia for the PC

Advances in Real-Time Skin Rendering

Advanced Visual Effects with Direct3D

2: Introducing image synthesis. Some orientation how did we get here? Graphics system architecture Overview of OpenGL / GLU / GLUT

Rally Sport Racing Game: CodeName Space Racer

The RADIANCE Lighting Simulation and Rendering System

Monte Carlo Path Tracing

How To Draw A Billiards Ball In Gta 3D With Texture Mapping (Gta 3) On A Computer Or 2D Or Gta 2D (Gt) On Your Computer Or Computer Or Your Computer (Or Your Computer)

Computer Graphics. Anders Hast

Approval Sheet. Interactive Illumination Using Large Sets of Point Lights

Silverlight for Windows Embedded Graphics and Rendering Pipeline 1

CSE168 Computer Graphics II, Rendering. Spring 2006 Matthias Zwicker

Interactive Level-Set Segmentation on the GPU

Visualization and Feature Extraction, FLOW Spring School 2016 Prof. Dr. Tino Weinkauf. Flow Visualization. Image-Based Methods (integration-based)

Real Time Rendering. Preface What's New Getting Started Basic Tasks Advanced Tasks Workbench Description Index

Adding vectors We can do arithmetic with vectors. We ll start with vector addition and related operations. Suppose you have two vectors

B2.53-R3: COMPUTER GRAPHICS. NOTE: 1. There are TWO PARTS in this Module/Paper. PART ONE contains FOUR questions and PART TWO contains FIVE questions.

DATA VISUALIZATION OF THE GRAPHICS PIPELINE: TRACKING STATE WITH THE STATEVIEWER

Introduction to Graphics Software Development for OMAP 2/3

Essential Mathematics for Computer Graphics fast

Tessellations. Practice 1 Identifying Tessellations. In each tessellation, color the repeated shape. Example

Last lecture... Computer Graphics:

Chapter 6 - The Scene Graph

Transcription:

Texture Mapping Texture Coord Generation Map a 2D Texture onto an Object How? Consider a Cylinder What if we don t have a cylinder or sphere? gltexgen Powerful, flexible, underutilized Contour mapping Reflection mapping Lighting effects Atmospheric effects gltexgen (cont d) Generate texture coordinates from geometry Object space texture is attached to object Eye space object moves within texture field Sphere map based on reflection vector Reference Plane Uses plane equation Ax + By +Cz = D Computes dot product coord = Ax + By + Cz + Dw coord is distance from plane Computation is separable 1

Object Linear Mapping Texture is attached to object GLfloat params = {A,B,C,D}; gltexgenfv(gl_s, GL_OBJECT_PLANE, params); gltexgeni(gl_s, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); glenable(gl_texture_gen_s); Default mapping is identity (s,t,r,q) = (Xo, Yo, Zo, Wo); Object Linear Sample Texture is attached to object Demo Object Linear Mapping Eye Linear Mapping Texture is fixed in eye space GLfloat params = {A,B,C,D}; gltexgenfv(gl_s, GL_EYE_PLANE, params); gltexgeni(gl_s, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR); glenable(gl_texture_gen_s); Default mapping is identity (s,t,r,q) = (Xe, Ye, Ze, We); Eye Linear Sample Texture is fixed in eye space Demo Eye Linear Mapping 2

Uses Projected shadows Spotlights Aligning screen space textures NPR paper background Distance functions point light attenuation texture fog Sphere Mapping Based on reflection vector gltexgeni(gl_s, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP); glenable(gl_texture_gen_s); S, T coordinates only Show PDF Sphere Map Spheremap Details Sphere Mapping 90 180 Eye 0 Texture Map Center Specular Map Texture looks like a highlight on a sphere projected to a plane 90 degree Reflection Unused Sphere Mapping Based on reflection vector Uses Environment mapping Pre-computed specular lighting (recall lighting lecture) 3

Textures and Specular Filtering Getting Highlights Right With texture GL_SEPARATE_ SPECULAR_COLOR Optimal case Minification Magnification 4

Pixel Footprint Pyramid Textures (Mipmapping) Linear vs. Nearest Trilinear Anisotropic 5

Anisotropic Filtering Getting Finer Highlight and Lighting Fx Run the computation in fragment programs Needs to be local lighting (no radiosity / global illum) Potentially expensive (slow) + Dynamic scene, lights Play texture tricks Compute the lighting beforehand, store in texture Need to recompute when scene/lights change Sphere mapping approximates Phong Shading (s,t) Texture (s,t) Texture coordinates from reflection vector (eye vector and normal) Interpolated coordinates map to texels E N N L E L E...... Texel values computed from Phong lighting equation N L Why would texturing help? Put linear interpolation BEFORE highly non-linear computation (EXP) I specular = k I s light n ( cos φ ) shiny Spheremap Details Spheremap texture indexed from reflection vector Computation done in eye space Texture looks like reflection from chrome hemisphere Maps all reflections to hemisphere Center of map reflects back to eye (180- degrees) 6

Spheremap Details Eye 0 90 180 Texture Map Specular Map Texture looks like a highlight on a sphere projected to a plane Center 90 degree Reflection Unused with Texture Multipass technique: Render object without specular light Redraw object: no lighting, color, surface texture Modulate intensity with highlight texture Combine images with additive blend Can be done in single pass using fragment prog Need additive texenv Steps to adding texture highlights + = Diffuse Lit, Textured White, Modulated by Specular Texture Combined Image (additive blending) Creating Highlight Textures Build an environment map Sphere lit by object s light Relative light position same as object Copy image into highlight texture New texture when light moves relative to viewer Object movement doesn t require changing texture Compare the Results Single pass Phong Lighting Gouraud Shading Phong Lighting, Gouraud Shading Separate specular Two pass Phong Lighting, 7

End of Cached Lighting Results Reuse lighting calculations Multiple local lights (same type) Static portion of scene s light field Sample region with texture instead of tesselating Low resolution sampling Local lighting; rapid change over small area Global lighting; slow change over large area Segmenting Scene Lighting Static vs. dynamic light fields Global vs. local lighting Similar light shape Segmenting the lighting Dominant Lighting Local lighting Texture Tricks Moving Local Lights Recreate the texture; simple but slow Manipulate the lightmap Translate to move relative to the surface Scale to change spot size Change base polygon color to adjust intensity Projective textures ideal for spotlights 3D textures easy to use (if available) Precompute lighting, Fold into texture vs. Surface Texture plus Lightmap + 8

Spotlights as Lightmap Special Case Mapping Single Spotlight Texture Pattern Original Translate Spotlight Texture Coordinates Scale Spotlight Texture Coordinates Change Base Polygon Intensity Use texture matrix to perform spotlight texture coordinates transformations. Creating a lightmap Light white, tesselated surface with local light Render, capture image as texture Texture contains ambient and diffuse lighting gllight() parameters should match light Texture can also be computed analytically Creating a lightmap Lightmap building tips Boundary should have constant value Render surface lit by local light Create a Texture Map from Image Intensity changes from light should be minimal near edge of lightmap Lighting with a Lightmap Local light is affected by surface color and texture Two step process adds local light contribution: Modulate textured, unlit surfaces with lightmap Add locally lit image to scene Can mix OpenGL, lightmap lighting in same scene Creating local contribution Lightmap Unlit Scene Lightmap Intensity Local Light Contribution 9

Adding local light to scene in Quake2 (modulate) lightmaps only decal only OpenGL Lighting Combined Image = combined scene Packing Many into a Single Texture Quake 2 light map texture image example typically heavily magnified. Permits multiple lightmaps packed into a single texture. Quake 2 computes lightmaps via off-line radiosity solver. Lightmap considerations are good: Under-tesselated surfaces Custom lighting Multiple identical lights Static scene lighting Lightmap considerations less helpful: Highly tesselated surfaces Directional lights Combine with other surface effects (e.g. bumpmapping) eats a texture access in fragment programs may need to go to multi-pass rendering (fill-bound app) Multitexturing Multitexturing allows the use of multiple textures at one time. It is a standard feature of OpenGL 1.3 and later. An ordinary texture combines the base color of a polygon with color from the texture image. In multitexturing, this result of the first texturing can be combined with color from another texture. Each texture can be applied with different texture coordinates. 10

Texture Units Multitexturing uses multiple texture units. A texture unit is a part of the rendering pipeline that applies one texture to whatever is being drawn. + + Each unit has a texture, a texture environment, and optional texgen mode. Most current hardware has from 2 to 8 texture units. To get the number of units available: glgetintegerv(gl_max_texture_units) = Texture Units Detail Texture Texture units are named GL_TEXTURE0, GL_TEXTURE1, etc. The unit names are used with two new functions. glactivetexture(texture_unit) selects the current unit to be affected by texture calls (such as glbindtexture, gltexenv, gltexgen). glmultitexcoord2f(texture_unit, s, t) Sets texture coordinates for one unit + = Multitexture Lightmapping Billboards + = look = camera_pos - point_pos; right = up x look; up = look x right; 11

Billboards Billboards [r1 u1 l1 px] [r2 u2 l2 py] [r3 u3 l3 pz] [0 0 0 1] up = arbitrary axis look = camera_pos - point_pos; right = up x look; look = right x up; Billboards Billboard Clouds Slide Credits Slides adapted from Siggraph 2004 OpenGl course U. Virginia Intro to Graphics Michael Gold, NVidia Cass Everitt, NVidia Paul Heckbert, NVidia Michael I. Gold, NVidia Cass Everitt, NVidia Paul Heckbert, NVidia 12