Scalable multi-gpu cloud raytracing with OpenGL

Similar documents
Real-Time Ray Tracing Using Nvidia Optix Holger Ludvigsen & Anne C. Elster 2010

Graphics for VEs. Ruth Aylett

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

Introduction to 3D Graphics

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

COMP 4801 Final Year Project. Ray Tracing for Computer Graphics. Final Project Report FYP Runjing Liu. Advised by. Dr. L.Y.

Effects needed for Realism. Computer Graphics (Fall 2008) Ray Tracing. Ray Tracing: History. Outline

Chapter 9- Ray-Tracing

There are many kinds of surface shaders, from those that affect basic surface color, to ones that apply bitmap textures and displacement.

03 RENDERING PART TWO

V-Ray RT: A New Paradigm in Photorealistic Raytraced Rendering on NVIDIA GPUs. Vladimir Koylazov Chaos Software.

The Animation Process. Lighting: Illusions of Illumination

Ray Tracing. Kjetil Babington

Computer Graphics (CS 563) Lecture 4: Advanced Computer Graphics Image Based Effects: Part 2. Prof Emmanuel Agu

Enabling immersive gaming experiences Intro to Ray Tracing

CS451Real-time Rendering Pipeline

V-RAY NEXT FOR 3DS MAX

Com S 336 Final Project Ideas

Introduction Ray tracing basics Advanced topics (shading) Advanced topics (geometry) Graphics 2010/2011, 4th quarter. Lecture 11: Ray tracing

Render methods, Compositing, Post-process and NPR in NX Render

Interactive Cloth Simulation. Matthias Wloka NVIDIA Corporation

Ray Tracing through Viewing Portals

Programmable GPUS. Last Time? Reading for Today. Homework 4. Planar Shadows Projective Texture Shadows Shadow Maps Shadow Volumes

Computer Graphics. Si Lu. Fall uter_graphics.htm 11/22/2017

Lecture 11: Ray tracing (cont.)

Motivation. Sampling and Reconstruction of Visual Appearance. Effects needed for Realism. Ray Tracing. Outline

Global Rendering. Ingela Nyström 1. Effects needed for realism. The Rendering Equation. Local vs global rendering. Light-material interaction

Ray tracing. Computer Graphics COMP 770 (236) Spring Instructor: Brandon Lloyd 3/19/07 1

Building a Fast Ray Tracer

Lighting. To do. Course Outline. This Lecture. Continue to work on ray programming assignment Start thinking about final project

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

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

Ray Tracing. CS334 Fall Daniel G. Aliaga Department of Computer Science Purdue University

Computer Graphics (CS 543) Lecture 13b Ray Tracing (Part 1) Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

CSE528 Computer Graphics: Theory, Algorithms, and Applications

Effects needed for Realism. Ray Tracing. Ray Tracing: History. Outline. Foundations of Computer Graphics (Spring 2012)

lecture 18 - ray tracing - environment mapping - refraction

SAMPLING AND NOISE. Increasing the number of samples per pixel gives an anti-aliased image which better represents the actual scene.

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

Chapter 23- UV Texture Mapping

CS 354R: Computer Game Technology

COSC 448: REAL-TIME INDIRECT ILLUMINATION

Real-Time Shadows. Computer Graphics. MIT EECS Durand 1

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

Real-Time Rendering of a Scene With Many Pedestrians

Ray Tracing CSCI 4239/5239 Advanced Computer Graphics Spring 2018

Sung-Eui Yoon ( 윤성의 )

Topics and things to know about them:

Practical Techniques for Ray Tracing in Games. Gareth Morgan (Imagination Technologies) Aras Pranckevičius (Unity Technologies) March, 2014

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

Consider a partially transparent object that is illuminated with two lights, one visible from each side of the object. Start with a ray from the eye

Efficient Depth-Compensated Interpolation for Full Parallax Displays

Rendering: Reality. Eye acts as pinhole camera. Photons from light hit objects

Ray Tracing. Foley & Van Dam, Chapters 15 and 16

Ray Tracing Foley & Van Dam, Chapters 15 and 16

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

Ray Tracing III. Wen-Chieh (Steve) Lin National Chiao-Tung University

Computer Graphics I Lecture 11

CS 563 Advanced Topics in Computer Graphics Camera Models. by Kevin Kardian

Computer Graphics. Lecture 13. Global Illumination 1: Ray Tracing and Radiosity. Taku Komura

Volume visualization. Volume visualization. Volume visualization methods. Sources of volume visualization. Sources of volume visualization

Point Cloud Filtering using Ray Casting by Eric Jensen 2012 The Basic Methodology

LEVEL 1 ANIMATION ACADEMY2010

There are two lights in the scene: one infinite (directional) light, and one spotlight casting from the lighthouse.

Computer Graphics: Programming, Problem Solving, and Visual Communication

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

CHAPTER 1 Graphics Systems and Models 3

Computer Graphics Lecture 11

Corona Sky Corona Sun Corona Light Create Camera About

Advanced Graphics. Global Illumination. Alex Benton, University of Cambridge Supported in part by Google UK, Ltd

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

Announcements. Written Assignment 2 out (due March 8) Computer Graphics

Dynamic Ambient Occlusion and Indirect Lighting. Michael Bunnell NVIDIA Corporation

Computer Graphics. Lecture 9 Environment mapping, Mirroring

Image-based Lighting

Ray Tracing: Special Topics CSCI 4239/5239 Advanced Computer Graphics Spring 2018

Ray Tracing. CSCI 420 Computer Graphics Lecture 15. Ray Casting Shadow Rays Reflection and Transmission [Ch ]

SEOUL NATIONAL UNIVERSITY

Hidden Surface Elimination Raytracing. Pre-lecture business. Outline for today. Review Quiz. Image-Space vs. Object-Space

Z-Buffer hold pixel's distance from camera. Z buffer

Ray Tracing Basics I. Computer Graphics as Virtual Photography. camera (captures light) real scene. photo. Photographic print. Photography: processing

Fog and Cloud Effects. Karl Smeltzer Alice Cao John Comstock

CGDD 4113 Final Review. Chapter 7: Maya Shading and Texturing

Ray Tracing. Outline. Ray Tracing: History

Computer Graphics (CS 543) Lecture 10: Normal Maps, Parametrization, Tone Mapping

Chapter 17: The Truth about Normals

Luxo Jr. (Pixar, 1986) Last Time. Real Cameras and Ray Tracing. Standard Rasterization. Lights, Cameras, Surfaces. Now Playing:

Computer Graphics. - Texturing Methods -

Rendering Smoke & Clouds

Rendering Algorithms: Real-time indirect illumination. Spring 2010 Matthias Zwicker

The Prism Glass. Christopher Sauer and Kevin Rakestraw. Description of Assets

Ray Tracing. Computer Graphics CMU /15-662, Fall 2016

Interpolation using scanline algorithm

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

Michal Valient Lead Tech Guerrilla Games

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

Designing the look and feel for Smoke and Neon powers The creation of a new toolset and pipeline for I:SS Pros and cons from our new workflow and

COMP371 COMPUTER GRAPHICS

CS 4620 Program 4: Ray II

An Efficient Approach for Emphasizing Regions of Interest in Ray-Casting based Volume Rendering

Transcription:

Scalable multi-gpu cloud raytracing with OpenGL University of Žilina Digital technologies 2014, Žilina, Slovakia

Overview Goals Rendering distant details in visualizations Raytracing Multi-GPU programming using OpenGL Cloud trace Algorithm Implementation Results Future work

Goals Research Methods of distant detail rendering Simple raytracing algorithms Using modern GPUs for raytracing Using multiple GPUs in OpenGL Develop An efficient algorithm fitting the GPU pipeline and architecture Implement a working prototype Evaluate the usability for other purposes Medical or volumetric data visualization Solid geometry raytracing

Distant detail rendering Sky Atmosphere Clouds Celestial bodies Distant landscapes Distant landmarks and skylines Used in Computer games Outdoor simulations and visualizations Source: X-Ray engine / S.T.A.L.K.E.R.

Sky and cloudscape rendering Sky planes Sky spheres or sky domes Sky boxes Combinations and extensions of the above

Sky plane One or several planes, with cloud textures applied, rendered above the ground Can be animated by transforming texture coordinates by exchanging different texture images Simple to implement Can appear flat and unconvincing especially if the observer s altitude changes Source: http://indiegorenderer.com

Sky sphere, sky dome One or several concentric spheres or hemi-spheres with textures applied Centered at or near the observer The texture mapping (from 2D planar to spherical coordinates) causes the texture to be distorted Lack of detail in certain areas The textured sphere geometry is more complex

Sky box One or several (nearly) concentric cubes with textures applied The cub(es) are centered at the observer They can be moved slightly at a different pace to simulate view parallax effect. Requires textures for 5 (without the ground) or 6 faces Animation by texture coordinates does not work well Animated by exchanging texture images Simple geometry Clouds do not appear flat

Combined A combination of sky boxes sky domes sky planes particle systems post-processing effects bloom lens flare light rays etc. Distant segments of regular geometry can be blended into the sky box Source: Half life 2 / http://half-life.wikia.com

Important properties of sky textures Visual properties Realistic cloud sizes, shapes and distributions. Realistic lighting and (self) shadowing. Realistic atmospheric light scattering. The texture image pixels can encode basic data that can be finalized later Cloud density Cloud distance Cloud lighting Atmosperic density Atmosphere lighting and shadowing etc. Dynamic finishing of a static texture One texture can result in multiple final images which can be smoothly animated HDR and other effects can be applied The light direction must be static More demanding that just a plain colorized texture

Sources of sky textures Textures for a skybox can be obtained in several ways: Real sky photography (usually requires post-processing) Static Limited number or requires a lot of storage space Can be difficult to photoshop into a full cube-map Simple generating algorithms (Perlin noise, etc.) Fast and simple Low quality Sometimes looking unnatural Advanced algorithms (usually raytracing) Computationaly expensive and slow High quality

Raytracing Visualization technique for generating an image by tracing the path of light through pixels in an image plane and simulating the effects of its encounters with virtual objects. Capable of producing a very high degree of visual realism. Greater computational cost than other techniques. Is recursive. Source: http://en.wikipedia.org

Raytracing Scenes in ray tracing can be described mathematically. Scenes may also incorporate Polygonal models Images Volumetric data Light sources Properties of the surfaces and interiors of objects in the scene determine further raytracing steps Raytracing can simulate various optical effects Reflection Refraction Scattering Dispersion Incandescence Emission Using multiple rays per pixel can be used for Antialiasing Simulation of depth-of-field Motion blur

Basic raytracing algorithm 1 For each pixel on the virtual screen, cast one or multiple rays originating at the position of the observer through the position of the screen pixel in world space. 2 Find the nearest object that the ray intersects with. 3 Cast secondary rays from the point where the object was hit to all light sources. 4 For any light source not obstructed by other objects calculate the amount of light hitting the surface of the object. 5 Take into account the surface and interior properties of the object the properties of the light and the angle at which the light arrives. 6 Calculate the final color of the light reaching the observer.

Raytracing algorithm extensions 1 When an object is hit by the primary ray, recursivelly shoot rays from the surface along vectors determined by the surface properties and find intersections with other objects Reflection Refraction Scattering 2 For volumetric objects sample along the ray through the defining data. 3 etc.

Cloud trace - overview Purpose Generator of skybox cube-map texture images. Provides also basic ray-trace data for dynamic finishing. Testbed for other multi-gpu raytracing applications. Properties Open-source. Multi-platform. Implemented using OpenGL (OGLplus 1 ). Utilizes multiple GPUs if available (currently only nvidia+glx). Is usable from the command line to allow scripting. Allows to import cloud scenes from CSV and Blender. Has a build-in cloud volume and placement generator. 1 http://oglplus.org/

Architecture Thread(s) GPU resources Renderer Raytracer(s) Copier Loader Main Saver Generator Main-glX Main-GLFW

Components Main Initializes the GL contexts and other components Currently has two implementations: glx multi-gpu, GLFW multi-platform, single GPU. Loaders load cloud volume and placement data Generators generate cloud volume and placement data Saver saves raytrace output or finalized images GPU resources manage used GPU resources (textures, shaders, etc.) Raytracers raytrace the cloudscape, generate output data Threads execute the raytracers Copier does efficient data copying between GPUs Renderer renders the final image from the raytrace data by using a finishing shader

Cloud representation Cloud volume and structure is represented by a cubic 3D texture Individual clouds are represented as spheres enclosing the cube. Finding ray-sphere intersections consists of very simple vector operations well suited for the GPU. Cloud parametes are stored in a buffer on the GPU Position Radius Rotation Unit density Unit light attenuation etc.

Main rendering algorithm 1 Parse input parameters 2 Load or generate the cloud volume texture 3 Load or generate the cloud placement and parameters 4 Initialization (threads, GL contexts, components). 5 Face set rendering for each of the 6 cube faces: 1 Cleanup output buffer 2 Setup raytracer(s) 3 Activate raytracer(s) (each in its own thread) 4 Face tile rendering for each tile on a face: 1 Raytrace a batch of tiles 2 Copy the raytraced tiles into a shared buffer 5 Suspend raytracer(s) 6 Render the final image, using finishing shadera 7 Save face final image and/or intemediate raytrace data

Raytracing algorithm CPU 1 Each cube face is divided into rectangular tiles 2 The individual tiles are assigned to idle raytracers in batches 3 Each raytracer processes a single tile on the GPU 4 After all tiles in a batch are processes they are copied by the copier into a shared texture. Ray-cloud intersection search

Raytracing algorithm GPU 1 Find ray direction 2 Search for intersections 3 Sample the interior of the intesected cloud-spheres 1 For each sample in the interior of the cloud, cast a secondary ray to the light source, calculating the sample lighting. 4 Backtrace all samples along the primary ray and blend them into the final value according to the sample density. 5 Output raytrace data Cloud interior sampling Casting secondary rays

Performance testing Hardware CPU Intel Xeon W3550, 8 cores @3.07 GHz RAM 8 GB GPU 2 x nvidia Quadro 600 (GPU 0, GPU 1 ) Testing scenes S 2 2 cloud spheres S 4 4 cloud spheres... S 512 512 cloud spheres S 1024 1024 cloud spheres Test cases T(A) GPU 0 : Finisher + Raytracer T(B) GPU 0 : Finisher GPU 1 : Raytracer T(C) GPU 0 : Finisher + Raytracer GPU 1 : Raytracer

Typical rendering times and scalability 00:30 00:25 T(A off-screen) T(B off-screen) T(C off-screen) 18:00 16:00 14:00 T(A off-screen) T(B off-screen) T(C off-screen) 30:00 27:00 24:00 T(A on-screen) T(B on-screen) T(C on-screen) Real rendering time 00:20 00:15 00:10 Real rendering time 12:00 10:00 08:00 06:00 Real rendering time 21:00 18:00 15:00 12:00 09:00 00:05 04:00 02:00 06:00 03:00 00:00 S 2 S 4 S 8 S 16 S 32 Scene 00:00 S 64 S 128 S 256 S 512 S 1024 Scene 00:00 S 2 S 4 S 8 S 16 S 32 S 64 S 128 S 256 S 512 S 1024 Scene Rendering times in off-screen mode Rendering times in on-screen mode

Multi-GPU execution speedup Speedup 1.8 1.7 1.6 1.5 1.4 1.3 1.2 1.1 1 0.9 0.8 0.7 S16 S8 S4 S2 Off-screen T(A)/T(B) T(A)/T(C) S32 S1024 S512 S256 S128 S64 Speedup 70 60 50 40 30 20 10 0 On-screen T(A)/T(B) T(A)/T(C) S1024 S512 S256 S128 S64 S32 S16 S8 S4 S2 Scene Scene Execution speedup T (A) T (A) and in Scenario 2 in off-screen and on-screen modes. T (B) T (C)

Raytrace output data Cloud density data (inverted) Primary lighting data Cloud distance data (normalized) Secondary lighting data

Finished output

Finished output

Finished output

Finished output

Animations Cloud trace allows command line invocation. Cloud placement data is animated and prepared for each frame by an external script. Each frame is rendered by a single invocation of Cloud trace.

Planned features for Cloud trace Optimizations Network rendering Raytracers as separate network servers Common broker dispatching raytrace tasks Other output parameters Cloud age usable in animations Cloud light emission Cloud altitude Multiple light sources Multiple textures Improved cloud texture generator Other finishing shaders

Multi-GPU medical imaging data visualization Raytraced data volume from an MRI brain scan