Advanced Ray Tracing Smoke and Fog.

Slides:



Advertisements
Similar presentations
The Radiance Equation.
Advertisements

Realistic Simulation and Rendering of Smoke CSE Class Project Presentation Oleksiy Busaryev TexPoint fonts used in EMF. Read the TexPoint manual.
An Optimized Soft Shadow Volume Algorithm with Real-Time Performance Ulf Assarsson 1, Michael Dougherty 2, Michael Mounier 2, and Tomas Akenine-Möller.
Ray tracing. New Concepts The recursive ray tracing algorithm Generating eye rays Non Real-time rendering.
Computer graphics & visualization Global Illumination Effects.
Week 10 - Monday.  What did we talk about last time?  Global illumination  Shadows  Projection shadows  Soft shadows.
3D Graphics Rendering and Terrain Modeling
Real-Time Rendering TEXTURING Lecture 02 Marina Gavrilova.
CLASS 9 ADVANCE RENDERING RAY TRACING RADIOSITY LIGHT FIELD CS770/870.
The Radiance Equation Mel Slater. Outline Introduction Light Simplifying Assumptions Radiance Reflectance The Radiance Equation Traditional Rendering.
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics1 Ray Tracing Variants Distributed ray tracing Generalized rays Cone Tracing Beam Tracing Pencil.
1Notes  Textbook: matchmove 6.7.2, B.9. 2 Match Move  For combining CG effects with real footage, need to match synthetic camera to real camera: “matchmove”
William Moss Advanced Image Synthesis, Fall 2008.
Christian Lauterbach COMP 770, 2/11/2009
Rasterization and Ray Tracing in Real-Time Applications (Games) Andrew Graff.
Efficient Simulation of Light Transport in Scenes with Participating Media using Photon Maps Paper by Henrik Wann Jensen, Per H. Christensen Presented.
CSCE 641: Photon Mapping Jinxiang Chai. Outline Rendering equation Photon mapping.
Admission to CS 184 Enrollment priorities are 1. CS/EECS majors, 2. CS/EECS minors (this category includes applied math majors) 3. anyone else with a declared.
3D Graphics Processor Architecture Victor Moya. PhD Project Research on architecture improvements for future Graphic Processor Units (GPUs). Research.
Global Illumination May 7, Global Effects translucent surface shadow multiple reflection.
Modeling Fluid Phenomena -Vinay Bondhugula (25 th & 27 th April 2006)
Paper by Alexander Keller
Modelling Realistic Water & Fire Sérgio Leal Socrates/Erasmus student at: AK Computer Graphics Institute for Computer Graphics and Vision Technical University.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Introduction to Modeling Fluid Dynamics 1.
CSS 522 Topics in Rendering March 01,2011 Scott and Lew.
COMP 175: Computer Graphics March 24, 2015
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
Today More raytracing stuff –Soft shadows and anti-aliasing More rendering methods –The text book is good on this –I’ll be using images from the CDROM.
Optical Models Jian Huang, CS 594, Spring 2002 This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC,
02/25/05© 2005 University of Wisconsin Last Time Meshing Volume Scattering Radiometry (Adsorption and Emission)
Multiple Scattering in Vision and Graphics Lecture #21 Thanks to Henrik Wann Jensen.
Advanced Computer Graphics March 06, Grading Programming assignments Paper study and reports (flipped classroom) Final project No written exams.
COMPUTATIONAL FLUID DYNAMICS IN REAL-TIME An Introduction to Simulation and Animation of Liquids and Gases.
Computer Graphics An Introduction. What’s this course all about? 06/10/2015 Lecture 1 2 We will cover… Graphics programming and algorithms Graphics data.
-Global Illumination Techniques
Project Raytracing. Content Goals Idea of Raytracing Ray Casting – Therory – Practice Raytracing – Theory – Light model – Practice Output images Conclusion.
CS 376 Introduction to Computer Graphics 04 / 16 / 2007 Instructor: Michael Eckmann.
Ray Tracing Chapter CAP4730: Computational Structures in Computer Graphics.
CS447/ Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.
Computer Graphics Global Illumination: Photon Mapping, Participating Media Lecture 12 Taku Komura.
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
Taming a Wild River Jeff Lander Darwin 3D
111/17/ :21 Graphics II Global Rendering and Radiosity Session 9.
- Laboratoire d'InfoRmatique en Image et Systèmes d'information
Monte-Carlo Ray Tracing and
Photo-realistic Rendering and Global Illumination in Computer Graphics Spring 2012 Hybrid Algorithms K. H. Ko School of Mechatronics Gwangju Institute.
Ray Tracing Fall, Introduction Simple idea  Forward Mapping  Natural phenomenon infinite number of rays from light source to object to viewer.
Ray Tracing II. HW1 Part A due October 10 Camera module Object module –Read from a file –Sphere and Light only Ray tracer module: –No shading. No reflection.
Bounding Volume Hierarchy. The space within the scene is divided into a grid. When a ray travels through a scene, it only passes a few boxes within the.
Graphics Lecture 17: Slide 1 Interactive Computer Graphics Lecture 17: Fire.
COMPUTER GRAPHICS CS 482 – FALL 2015 SEPTEMBER 29, 2015 RENDERING RASTERIZATION RAY CASTING PROGRAMMABLE SHADERS.
Slide 1Lastra, 2/14/2016 Monte-Carlo Methods. Slide 2Lastra, 2/14/2016 Topics Kajiya’s paper –Showed that existing rendering methods are approximations.
02/07/03© 2003 University of Wisconsin Last Time Finite element approach Two-pass approaches.
Global Illumination (3) Path Tracing. Overview Light Transport Notation Path Tracing Photon Mapping.
Distributed Ray Tracing. Can you get this with ray tracing?
Distributed Ray Tracing. Can you get this with ray tracing?
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics1 Water Computational Fluid Dynamics Volumes Lagrangian vs. Eulerian modelling Navier-Stokes equations.
Photorealistic Rendering vs. Interactive 3D Graphics
Deferred Lighting.
3D Graphics Rendering PPT By Ricardo Veguilla.
The Graphics Rendering Pipeline
© University of Wisconsin, CS559 Fall 2004
(c) 2002 University of Wisconsin
Real-time Volumetric Lighting in Participating Media
(c) 2002 University of Wisconsin
Plants from Images CS 658.
CS5500 Computer Graphics May 29, 2006
Distributed Ray Tracing
GPAT – Chapter 7 Physics.
Presentation transcript:

Advanced Ray Tracing Smoke and Fog

What is Ray Tracing? Recall from Day 1: Computer Graphics is the inverse of Computer Vision, Kajiya Equation Given 3D data, figure out the 2D image with cameras and lighting Ray tracing is an alternative solution to the fixed-function/GLSL pipeline (mostly) For each pixel in output image, shoot a ray (line segment) through the screen (viewport) into the scene to calculate intersections with geometry

Sound Complex? Recall from Day 4: Human Eye, Optics Human eye sees range of visible light emitted from light sources and bouncing/interacting with matter First Idea: Try to compute light coming to the camera by tracing path of photons emitted from light source - Very difficult, complex physics, slow Second Idea: Trace path of light from screen to objects in scene then shade (approximate radiance) Third Idea (Photon Mapping): Trace light from both light sources and screen, terminate after some quantitative criterion, compute radiance

Examples of Ray Traced Images (1) IBM: Interactive Ray Tracer (iRT): Note the natural looking shadows and reflections

Examples of Ray Traced Images (2) Ray tracing refractions are superior compared to GPU refraction, simply recursively ray trace at the refracted angle

Examples of Ray Traced Images (3) Ray tracing also makes it easier to add camera effects such as depth of field

Do we need primitive geometry? Sphere: |x – c|2 = r2 , Line: x = dl Solve for d: |dl – c|2 = r2 Expand and Simplify: d2l2 = 2d(l ∙ c) + c2 –r2 = 0 Quadratic Equation: d = (l ∙c) ± sqrt((l ∙c)2 – c2 + r2 ) Depending on your implementation, we might not need vertices, quads & triangles for certain geometric primitives

Hardware Discussion All of this is easily done without a graphics card! Need to manually manage transformation matrices for the entire scene (not as hard as it sounds) in your application No card compatibility problems in graphics applications (#version) faster processor  instantly faster application (Exact same code running on Core 2 Duo vs. i7) Embarrassingly parallel, Can use as many cores as you give it, imagine one core per pixel!

Advanced Topics Real-time ray tracing Aliasing/Anti-aliasing Smoke and fog

Real Time Ray Tracing Previously very limited The trick is usually high parallelization Clever optimizations at a low level make a big difference Recently there have been some interesting developments Quake Ray Traced http://en.wikipedia.org/wiki/Quake_Wars:_Ray_Traced IBM iRT http://www.youtube.com/watch?v=oLte5f34ya8 NVIDIA announced OptiX, a ray tracing hardware pipeline in 2009 available on CUDA (parallel computing architecture) chips http://www.youtube.com/watch?v=87PmVhERz6A

Anti-aliasing (1) Aliasing: Distortion caused by sampling multiple signals, reconstructed (discrete) signal is not the same as the continuous one In ray tracing we see aliasing on the edges of objects, very sharp lines and jagged edges At one pixel the ray misses the object, at the next pixel it hits the target, there is no transition

Original aliased image, note rough edges Anti-aliasing (2) Anti-aliased image, super-sampling averages neighborhood of pixels, slight blurring Original aliased image, note rough edges

Anti-aliasing (3) Also some distributed techniques, better than blurring Original criticisms of ray tracing argued that things look too clean / artificial Distributed ray tracing uses noisy perturbations of rays shot through scene 2001 SIGGRAPH paper talks about using Perlin Noise in anti-aliasing Monte Carlo integration

Fog and Smoke Modelling (1) Will briefly talk about how to actually model smoke physically Physics behind fluid dynamics is very tough Fluid dynamics laws: Navier-Stokes equations Figuring out when Navier-Stokes equations have solutions is one of the Clay Mathematics Millennium Prize Problems (1M dollar prize) Probably as hard as P = NP problem Usually a good hack is enough (human eye does not detect these things very well anyways)

Fog and Smoke Modelling (2) Rough basics of particle systems (different lecture topic) Particles as vectors that store measured quantities e.g. Position, velocity, force, mass, heat, energy, colour etc... Have system of differential equations for a particle system, compute forces (based on physics laws) Force and mass tells us acceleration, integration of acceleration gives velocity, integration of velocity gives position Explicit integration methods cause instability, force slow time steps in simulation

Fog and Smoke Modelling (3) Physics of fluid dynamics assumes viscous flow of incompressible fluids Navier-Stokes system of equations, pressure gradient gravity Local pressure Kinematic viscosity

Fog and Smoke Modelling (4) Navier-Stokes: All possible momentum difference possibilities Gives us a way to calculate buoyancy forces...more physics The previous slide shows a continuous model To do this on a computer, needs to be discretized Usually bound by a volume cube, compute pressure in voxels, need to mark which part of volume is surface of fluid, empty cells and internal cells (non surface volume, cells with particles in them) Leads into volume rendering, volumetric ray tracing (I think this is also another lecture topic) Simulation: http://www.youtube.com/watch?v=vOFcHqImXJ8

Back to Ray Tracing To ray trace fog and smoke, do not need to look too heavily at simulation, integration techniques Lets not think too much about smoke geometry & simulation here From an optics point of view fog and smoke are light scattering phenomenon Radiance is no longer constant along a ray (between surfaces)

Volume Scattering (1) Three phenomenon to consider: Emission Absorption Scattering Taken from Physically Based Rendering, Matt Pharr and Greg Humphreys. 2004. Chapter 11: Volume Scattering

Volume Scattering - Absorption (2) Absorption of radiance as ray passes through medium

Volume Scattering - Absorption (3) L0(p, ω) - Li(p, -ω) = dL0(p, ω) = -σa(p, ω)Li(p, -ω)dt Derivative linear combination of itself:

Volume Scattering – Emission (4) Emission of radiance as ray passes through medium

Volume Scattering – Emission (5) Lve(p, ω) is another distribution function Differential Equation: dL0(p, ω) = Lve(p, ω) dt

Volume Scattering (6) In-scattering, Out-scattering and extinction Beams of light deflected out of path of ray Beams of light deflected into path of ray Caused by collisions with particles in the medium Out-Scattering coefficient, again chosen in a distribution function σs(p, ω)

Volume Scattering (7) Differential equation that defines out-scattering dL0(p, ω) = -σs(p, ω)Li(p, -ω) dt Combine out-scattering and absorption, we get extinction σt(p, ω) = σa(p, ω) + σs(p, ω) Differential equation: dL0(p, ω)/dt =−σt(p, ω) Li(p, −ω) Solution of this system is called the transmittance

Volume Scattering (8) Accounting for extinction, if radiance of point p point is L0(p, ω), incident radiance at point p’ is: Tr(pp’)L0(p, ω)

Volume Scattering (9)

Volume Scattering (10) Particles are roughly spaced out by a few multiples of their radii Use a phase function, this is the volumetric version of BDRF Angular distribution of scattered radiance Phase functions are probability density functions In-scattering:

Volume Scattering (11)

Bibliography Pharr, Matt. Humphreys, Greg. (2004). Physically Based Rendering. MA. Elsevier, Inc. [1] Foster, N. Metaxas, D. (1996). Realistic Animation of Liquids. Graphical Models and Image Processing. Volume 58 (5), 24. [2] Fedkiw, R. Stam, J. Jensen, H.W. (2001). Visual Simulation of Smoke. SIGGRAPH ‘01, 8. [3] Zhou, K. Ren, Z. Lin, S. Bao, H. Guo, B. Shum, H. 2008. ACM Transactions of Graphics. Volume 27 (3), 12. [4] Langer, M. (2008, November, 13). Volume Rendering [PDF], Retrieved From: www.cim.mcgill.ca/~langer/557/lecture20.pdf Links: http://en.wikipedia.org/wiki/Ray_tracing_%28graphics%29 http://en.wikipedia.org/wiki/Aliasing