Reflections from Bumpy Surfaces

Slides:



Advertisements
Similar presentations
Parameterized Environment Maps
Advertisements

Lecture 8 Transparency, Mirroring
An Optimized Soft Shadow Volume Algorithm with Real-Time Performance Ulf Assarsson 1, Michael Dougherty 2, Michael Mounier 2, and Tomas Akenine-Möller.
Technische Universität München Computer Graphics SS 2014 Graphics Effects Rüdiger Westermann Lehrstuhl für Computer Graphik und Visualisierung.
Ray tracing. New Concepts The recursive ray tracing algorithm Generating eye rays Non Real-time rendering.
3D Graphics Rendering and Terrain Modeling
Week 9 - Wednesday.  What did we talk about last time?  Fresnel reflection  Snell's Law  Microgeometry effects  Implementing BRDFs  Image based.
Reflections from Bumpy Surfaces GPU Graphics. What are we trying to achieve?  Most surfaces are not flat like glass  Some of these surfaces still give.
CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Object-Order vs. Screen-Order Rendering April 24, 2003.
(conventional Cartesian reference system)
IN4151 Introduction 3D graphics 1 Introduction to 3D computer graphics part 2 Viewing pipeline Multi-processor implementation GPU architecture GPU algorithms.
Global Illumination May 7, Global Effects translucent surface shadow multiple reflection.
CIS 310: Visual Programming, Spring 2006 Western State College 310: Visual Programming Ray Tracing.
Basic Ray Tracing CMSC 435/634. Visibility Problem Rendering: converting a model to an image Visibility: deciding which objects (or parts) will appear.
Computer Graphics Inf4/MSc Computer Graphics Lecture 11 Texture Mapping.
09/18/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Bump Mapping Multi-pass algorithms.
Shadows Computer Graphics. Shadows Shadows Extended light sources produce penumbras In real-time, we only use point light sources –Extended light sources.
Shadow Algorithms Ikrima Elhassan.
1 Computer Graphics Week13 –Shading Models. Shading Models Flat Shading Model: In this technique, each surface is assumed to have one normal vector (usually.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
Reflections Specular reflection is the perfect reflection of light from a surface. The law a reflection states that the direction of the incoming ray and.
Programmable Pipelines. 2 Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
09/09/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Event management Lag Group assignment has happened, like it or not.
Graphics Graphics Korea University cgvr.korea.ac.kr 1 Chapter 6 Special Effects 강 신 진강 신 진
CS 376 Introduction to Computer Graphics 04 / 16 / 2007 Instructor: Michael Eckmann.
Texture Mapping Applications 2. Parallax Mapping with Slope  parallax mapping assumes that the surface is a single plane  a better approximation  surface.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
CS 638, Fall 2001 Multi-Pass Rendering The pipeline takes one triangle at a time, so only local information, and pre-computed maps, are available Multi-Pass.
Basic Ray Tracing CMSC 435/634. Visibility Problem Rendering: converting a model to an image Visibility: deciding which objects (or parts) will appear.
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
Basic Ray Tracing CMSC 435/634.
Global Illumination. Local Illumination  the GPU pipeline is designed for local illumination  only the surface data at the visible point is needed to.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Chapters 5 2 March Classical & Computer Viewing Same elements –objects –viewer –projectors –projection plane.
11/24/ :45 Graphics II Shadow Maps Reflections Session 5.
Module 06 –environment mapping Module 06 – environment mapping Module 06 Advanced mapping techniques: Environment mapping.
Graphics Review Geometry, Color & Shading Brad Tennis Leslie Wu
Digital Media Dr. Jim Rowan ITEC 2110 Vector Graphics II.
Basic Ray Tracing CMSC 435/634.
- Introduction - Graphics Pipeline
Scene Manager Creates and places movable objects like lights and cameras so as to access them efficiently, e.g. for rendering. Loads and assembles world.
Ying Zhu Georgia State University
Texture Mapping.
Photorealistic Rendering vs. Interactive 3D Graphics
Week 2 - Friday CS361.
Programmable Pipelines
Modeling 101 For the moment assume that all geometry consists of points, lines and faces Line: A segment between two endpoints Face: A planar area bounded.
Graphics Processing Unit
3D Graphics Rendering PPT By Ricardo Veguilla.
The Graphics Rendering Pipeline
CS451Real-time Rendering Pipeline
Jim X. Chen George Mason University
© University of Wisconsin, CS559 Fall 2004
GPU Graphics Gary J. Katz University of Pennsylvania CIS 665
Shading CMSC 435/634.
Michael Tanaya , Hua ming Chen
(c) 2002 University of Wisconsin
Introduction to Computer Graphics with WebGL
Chapter V Vertex Processing
UMBC Graphics for Games
Image.
Dr. Jim Rowan ITEC 2110 Vector Graphics II
ICG 2018 Fall Homework1 Guidance
CS5500 Computer Graphics May 29, 2006
CSCE 441: Computer Graphics Ray Tracing
Frame Buffer Applications
Environment Mapping.
Introduction to Ray Tracing
Dr. Jim Rowan ITEC 2110 Vector Graphics II
Real-time Global Illumination with precomputed probe
Presentation transcript:

Reflections from Bumpy Surfaces GPU Graphics

What are we trying to achieve? Most surfaces are not flat like glass Some of these surfaces still give off reflections, we would like to model this effect

Methods for Reflection Ray Tracing (expensive) Environment Mapping (cube maps) Is an option in the shader 4 model In shader model 3 we can not update the cube map in real time easily Spherical Environment Mapping (with cube map)

Cube Map Example Can not be updated in real-time easily Cube Map pictures taken from http://developer.nvidia.com/object/cube_map_ogl_tutorial.html Can not be updated in real-time easily Only currently works well for static scenes Shader 4 will allow arrays of textures, will make real-time cube maps easy to implement

Simple Cube Map Lookup Reflect incoming View vector around Normal T Intersect Vr with environment map and perform texture lookup What is the issue here? T N Vr Two points with identical mirror directions will look up the same direction in the environment map V O Works well on the tea pot, works really badly on flat surfaces like floors 2D view of an environment map

Spherical Environment Mapping EM V = view vector, reflected about the point normal at x r V V r P = point on sphere interior using regular cube map r EM V mod reflector O P = intersection between line x + V t and sphere using V = P – O to index cube map based at O x r mod Pg 212 of Advanced Renderman http://books.google.com/books?id=6_4VaJiOx7EC&dq=advanced+renderman&pg=PP1&ots=cpXnKUMPC4&sig=bxeZp02CTI2kZQ0mRjM2JEv9lSw&hl=en&prev=http://www.google.com/search?hl=en&q=advanced+renderman&sa=X&oi=print&ct=title&cad=one-book-with-thumbnail#PRA1-PA213,M1 r < infinity V = modified view vector mod Assume the environment map exists on the interior of a sphere with a finite radius and center Define a ray using the position and mirror direction of the point, calculate the ray intersection with environment sphere Use intersection as the environment lookup direction

An even simpler case: The planar reflection Two Pass algorithm Reflected image is rendered to a texture Reflected surface is shaded with reflected texture from first pass Only useful for something like floors

Rendering Reflection to Texture Camera Pos: Er = reflecta(E) Front: Fr = reflecta(F) Right: Rr = reflecta(R) Up: Ur = - reflecta(U) E F R Reflector Plane (A) If we reflect the whole viewpoint reference frame it will cause culling issues If we flip the up vector we do not get the culling issue. Use a culling plane to make sure only objects on the same side as the viewpoint are reflected Essentially altering the view matrix, Model view and projection matrices stay the same Ur Rr Fr 1. Reflect the current viewpoint about the reflector plane. 2. Render the relevant parts of the scene from the new viewpoint. Er

Reflection Texture Lookup For the Perfect Reflector: for_each fragment { Fpos = fragment world position Vr = reflected view matrix Epos = eye space position = Fpos * Vr Ppos = post projective space = Epos * P S = scale translate matrix texture_lookup = (S*P*Vr*Fpos).xy color = tex2d(texture_lookup) } Vr is same from the first pass Post projective space = homogenous clipping space P = projection matrix S moves all coordinates into [-1,1] to [0,1] range (Same techniques as is used with shadow maps) S, P, and Vr are computed on CPU and passed as constants

Reflection Texture Lookup For the Bumpy Reflector N = normal E = viewpoint Er = reflected viewpoint N1 = fragment’s normal V = view vector VN1 = view vector reflected about N1 P = perfect reflector’s reflection P1 = non-perfect reflector’s reflection P1 P h N1 is taken from a texture lookup for the normal map fPos1 is what we want, that is the texture lookup for the reflection VN1 is V reflected around N1 Er is E reflected around the surface N1 N E viewpoint VN V 1 fPos fPos1 Solve for fPos1 Er reflected viewpoint