Flame On: Real-Time Fire Simulation for Video Games. Simon Green, NVIDIA Christopher Horvath, Pixar



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

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

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

Interactive Visualization of Magnetic Fields

Introduction to Computer Graphics

High Dynamic Range and other Fun Shader Tricks. Simon Green

INTRODUCTION TO RENDERING TECHNIQUES

Sparse Fluid Simulation in DirectX. Alex Dunn Dev. Tech. NVIDIA

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

Hardware-Aware Analysis and. Presentation Date: Sep 15 th 2009 Chrissie C. Cui

Introduction to Computer Graphics. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012

A Proposal for OpenEXR Color Management

The Future Of Animation Is Games

CS 325 Computer Graphics

Computer Vision: Machine Vision Filters. Computer Vision. Optical Filters. 25 August 2014

Interactive Level-Set Segmentation on the GPU

Real-time Visual Tracker by Stream Processing

Video Camera Image Quality in Physical Electronic Security Systems

Shader Model 3.0. Ashu Rege. NVIDIA Developer Technology Group

NVIDIA GeForce GTX 580 GPU Datasheet

Using Photorealistic RenderMan for High-Quality Direct Volume Rendering

CFD Based Air Flow and Contamination Modeling of Subway Stations

Introduction to GPGPU. Tiziano Diamanti

Graphics Cards and Graphics Processing Units. Ben Johnstone Russ Martin November 15, 2011

Graphics. Computer Animation 고려대학교 컴퓨터 그래픽스 연구실. kucg.korea.ac.kr 1

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

BCC Multi Stripe Wipe

NVFX : A NEW SCENE AND MATERIAL EFFECT FRAMEWORK FOR OPENGL AND DIRECTX. TRISTAN LORACH Senior Devtech Engineer SIGGRAPH 2013

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

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

Dynamic Resolution Rendering

A Short Introduction to Computer Graphics

Outline. srgb DX9, DX10, XBox 360. Tone Mapping. Motion Blur

Thea Omni Light. Thea Spot Light. Light setup & Optimization

CONVERGE Features, Capabilities and Applications

Data Visualization Using Hardware Accelerated Spline Interpolation

GPGPU Computing. Yong Cao

GPU Christmas Tree Rendering. Evan Hart

THE NATURE OF LIGHT AND COLOR

Image Synthesis. Fur Rendering. computer graphics & visualization

Treasure Hunt. Lecture 2 How does Light Interact with the Environment? EMR Principles and Properties. EMR and Remote Sensing

Interactive Level-Set Deformation On the GPU

Lecture Notes, CEng 477

MassArt Studio Foundation: Visual Language Digital Media Cookbook, Fall 2013

GPU Point List Generation through Histogram Pyramids

Computers in Film Making

How many PIXELS do you need? by ron gibbs

ADVANCED THEORIES FOR CG LIGHTING

Outline. Quantizing Intensities. Achromatic Light. Optical Illusion. Quantizing Intensities. CS 430/585 Computer Graphics I

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

A comparison between a CRT and a LCD monitors colors rendering

COMP175: Computer Graphics. Lecture 1 Introduction and Display Technologies

Water Flow in. Alex Vlachos, Valve July 28, 2010

NUMERICAL SIMULATION OF FLOW FIELDS IN CASE OF FIRE AND FORCED VENTILATION IN A CLOSED CAR PARK

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

Overview. Raster Graphics and Color. Overview. Display Hardware. Liquid Crystal Display (LCD) Cathode Ray Tube (CRT)

GPU Parallel Computing Architecture and CUDA Programming Model

Blackbody radiation derivation of Planck s radiation low

LBM BASED FLOW SIMULATION USING GPU COMPUTING PROCESSOR

Dynamic Simulations in a 3D-Enviornment a comparison between Maya and Blender

Hyperspectral Satellite Imaging Planning a Mission

Color Management Terms

NVIDIA IndeX Enabling Interactive and Scalable Visualization for Large Data Marc Nienhaus, NVIDIA IndeX Engineering Manager and Chief Architect

Multi-Block Gridding Technique for FLOW-3D Flow Science, Inc. July 2004

5. The Nature of Light. Does Light Travel Infinitely Fast? EMR Travels At Finite Speed. EMR: Electric & Magnetic Waves

Improved predictive modeling of white LEDs with accurate luminescence simulation and practical inputs

Investigation of Color Aliasing of High Spatial Frequencies and Edges for Bayer-Pattern Sensors and Foveon X3 Direct Image Sensors

Fire Simulation For Games

Development and Evaluation of Point Cloud Compression for the Point Cloud Library

Radiation Transfer in Environmental Science

Electromagnetic Radiation (EMR) and Remote Sensing

GPGPU: General-Purpose Computation on GPUs

SkillsUSA 2014 Contest Projects 3-D Visualization and Animation

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

GPU Architecture. Michael Doggett ATI

GPU Shading and Rendering: Introduction & Graphics Hardware

OpenEXR Image Viewing Software

Simulation of Cumuliform Clouds Based on Computational Fluid Dynamics

Optimizing AAA Games for Mobile Platforms

Medical Image Processing on the GPU. Past, Present and Future. Anders Eklund, PhD Virginia Tech Carilion Research Institute

Digital Image Fundamentals. Selim Aksoy Department of Computer Engineering Bilkent University

Introduction to Flow Visualization

Otis Photo Lab Inkjet Printing Demo

Visualizing Data: Scalable Interactivity

Getting Started with iray in 3ds Max 2014

Automatic 3D Mapping for Infrared Image Analysis

Today. Keyframing. Procedural Animation. Physically-Based Animation. Articulated Models. Computer Animation & Particle Systems

ART 269 3D Animation Fundamental Animation Principles and Procedures in Cinema 4D

1. Introduction to image processing

Spectral Response for DigitalGlobe Earth Imaging Instruments

Texture Cache Approximation on GPUs

Image Processing & Video Algorithms with CUDA

Visualization. For Novices. ( Ted Hall ) University of Michigan 3D Lab Digital Media Commons, Library

Instructor. Goals. Image Synthesis Examples. Applications. Computer Graphics. Why Study 3D Computer Graphics?

Principle of Thermal Imaging

Interactive simulation of an ash cloud of the volcano Grímsvötn

Optical Design Tools for Backlight Displays

Color Accurate Digital Photography of Artworks

Transcription:

Flame On: Real-Time Fire Simulation for Video Games Simon Green, NVIDIA Christopher Horvath, Pixar

Introduction This talk is about achieving realistic looking simulations for games / visual effects Not necessarily physically accurate! There is a large artistic component

Overview 2D fire simulation using CUDA Sneak peak: 3D fire simulation using DirectX 11 5 Tips For Good Looking Fluid Sims

A Brief History of Eulerian Fluids on the GPU

Stable Fluids, Jos Stam, Siggraph 1999

Mark Harris' 2D fluid solver (GPU Gems 1, 2004)

3D fluid solver (GPU Gems 3, Crane, Llamas, Tariq, 2007)

APEX Turbulence (Cohen, Tariq, 2010) Interactive Fluid-Particle Simulation using Translating Eulerian Grids

Inspiration Directable, high-resolution simulation of fire on the GPU, Horvath, Geiger, SIGGRAPH 2009 Computes high-res 2D slices of a 3D simulation Seeded using particle system GPGPU - used OpenGL Used in Harry Potter film

Goal Interactive Fire for Video Games Most video games today use 2D sprites for fire Procedural, or based on filmed footage 3D simulation probably still too expensive for real-time use today?

Today s Video Game Fire

Simulated Fire Advantages Disadvantages High resolution Computation time Non-repeating animation Artist controllability Can respond to wind etc. Less storage (?)

Implementation Implemented 2D stable fluids solver in CUDA Uses pitch-linear textures to store fields cudamallocpitch / cudabindtexture2d Geometric multi-grid solver Credit: Nuttapong Chentanez OpenGL for rendering Shading done in GLSL pixel shader

Example CUDA Kernel global void pressuresolved(float * restrict newpressure, const float * restrict divergence, int width, int height, int pitch) { int x = blockidx.x*blockdim.x + threadidx.x; int y = blockidx.y*blockdim.y + threadidx.y; int i = y*pitch+x; if (x >= width y >= height) return; float2 pos = make_float2((float)x + 0.5f, (float)y + 0.5f); float pl = tex2d(pressuretex, pos.x - 1, pos.y); float pr = tex2d(pressuretex, pos.x + 1, pos.y); float pb = tex2d(pressuretex, pos.x, pos.y - 1); float pt = tex2d(pressuretex, pos.x, pos.y + 1); float bc = divergence[i]; float pnew = (pl + pr + pb + pt - params.dx2*bc) * 0.25f; } newpressure[i] = pnew;

Fire Recipe Take smoke simulator Velocity, density Add new channels Temperature, Fuel, Noise Add a simple combustion model Combustion consumes fuel, generates heat Heat also generates upwards buoyancy force

Tip 1 Get the Colors Right Need to map temperature to color use physically-based black body radiation model (see later) Or: just an artist defined color gradient Dynamic range is important Fire is very bright! Can apply curve to density to get sharp flame edges

Temperature

Color

Tip 2 Use High Quality Advection Advection determines quality of motion and appearance detail in velocity and density fields Bilinear filtering not really good enough To much blurring over time Lots of other options: Higher-order filters (cubic) Error correction schemes e.g. MacCormack Particle based - PIC/FLIP We used Catmull-Rom filter, bounded to neighbourhood

Tip 3 Use a High-Res Density Field Density field can be much higher resolution than velocity field 4x or more Read interpolated velocity field when advecting density Need to downsample density to velocity resolution if simulation is coupled i.e. buoyancy based on density

Tip 3 Post Processing is Important Fire is very hot! Use post-processing to communicate temperature to viewer Glow - blur HDR image, add back on top Heat distortion offset background based on gradient of temperature Motion blur sample image several times along velocity vector

No Glow

With Glow

With Motion Blur

Tip 5 - Embers Add particles passively advected by velocity field Shows motion of air even in empty regions Motion blurred Drawn as quads stretched between previous and current position (using geometry shader) Inherit temperature from simulation Cool over time

Tip 4 Just Add Noise Fire is very turbulent and fast moving Use high levels of vorticity confinement to preserve vortices Use procedural (curl) noise to add turbulence Also advect a 2D noise field Blend in small amount of noise each frame Can be used to add detail to other fields Noise moves with fire

Work in Progress - 3D Simulation Relatively simple to extend simulation to 3D Surface writes to 3D textures are now possible in CUDA 4.x and DirectX 11

3D Performance Texture performance is great on Kepler architecture Sample results: 128 x 128 x 64 (0.5M) voxels for sim, 64 solver steps 2x res density field (8M voxels) 17 msecs per frame, including rendering (GeForce GTX 680)

Tip 5 Add Light Scattering Simple scattering approximation Similar idea to Light propagation volumes (Discrete Ordinate Method) Basic algorithm: Render radiance to 3D texture Blur radiance in 3 dimensions Sample blurred radiance (indirect light) in volume render

Demo

Physically Correct Flame Rendering Or... How to get the Planck Blackbody Radiation Function to actually look right.

Overview Components of Flame Appearance Blackbody Radiation Spectral Emission Tristimulus Response CIE XYZ Direct RGB (Human,Camera,Infrared)

Flame Appearance Blackbody Radiation of Combustion Byproducts (Soot/Smoke) - The Red/Orange/Yellow part. Spectral Emission - The Blue/Purple/Green part. http://en.wikipedia.org/wiki/flame

Blackbody Radiation

Planck s Law Relationship between emitted radiant intensity at each individual wavelength of light with temperature Calculated for a spectrum of wavelengths within visible range (380nm to 780nm). With 5nm increments, this is a color sample with 81 values.

Spectral Emission Dependent on type of fuel Dependent on mixture of oxygen Also defined as an intensity per wavelength

Butane Spectrum

Stimulus Response For a given receptor, a Stimulus Response Curve represents the sensitivity of that receptor to each individual wavelength of light The integral of a Stimulus Response Curve with an Emission Spectrum produces a single scalar receptor response to a spectrum of radiation

Tristimulus Response Combination of Stimulus Response Curves for a triplet of receptor types Human Color Vision composed of three types of cells with different spectral sensitivites, called cones. (L, M, S) Color Photography created from three types of color sensitive films or sensors, or alternatively three different filters (Technicolor)

CIE XYZ Created in 1931 by International Commission on Illumination

CIE RGB RGB curves have negative spectral response

Human Spectral Sensitivity Significantly Overlapping in Red and Green

Digital Camera Response Significant Infrared Sensitivity without IR Filter

Digital Camera Response Significant Infrared Sensitivity without IR Filter

1300K Flame via CIE Overly Saturated, Computer Generated look.

1300K Flame via crgb Properly Balanced Flame Appearance

Questions?

Thanks Chris Horvath Mark Harris Nuttapong Chentanez

References Jos Stam, "Stable Fluids", In SIGGRAPH 99 Conference Proceedings, Annual Conference Series, August 1999, 121-128 PDF Fast Fluid Dynamics Simulation on the GPU, Mark Harris, GPU Gems Real-Time Simulation and Rendering of 3D Fluids, Keenan Crane, Ignacio Llamas, Sarah Tariq, GPU Gems 3 Capturing Thin Features in Smoke Simulations, Siggraph Talk 2011, Magnus Wrenninge, Henrik Falt,Chris Allen, Stephen Marshall PDF