Description

Volume Rendering utilizing Design Equipment Travis Gorkin GPU Programming and Engineering, June 2009 Motivation Volume Rendering Foundation Volumetric Information Optical Model Amassing Comparisons Volume Rendering on the CPU Raymarching Calculation Volume Rendering on Representation Equipment

Transcripts

Volume Rendering utilizing Graphics Hardware Travis Gorkin GPU Programming and Architecture, June 2009

Agenda Volume Rendering Background Volumetric Data Optical Model Accumulation Equations Volume Rendering on the CPU Raymarching Algorithm Volume Rendering on Graphics Hardware Slice-Based Volume Rendering Stream Model for Volume Raycasting Volume Rendering in CUDA

Volume Rendering Definition Generate 2D projection of 3D information set Visualization of medicinal and exploratory information Rendering common impacts - liquids, smoke, fire Direct Volume Rendering (DVR) Done without extricating any surface geometry

Volumetric Data 3D Data Set Discretely tested on standard framework in 3D space 3D exhibit of tests Voxel â volume component One or more steady information values Scalars â thickness, temperature, darkness Vectors â shading, typical, inclination Spatial directions controlled by position in information structure Trilinear introduction Leverage representation equipment

Transfer Function Maps voxel information qualities to optical properties Glorified shading maps Emphasize or group elements of enthusiasm for the information Piecewise straight capacities, Look-up tables, 1D, 2D GPU â basic shader capacities, composition lookup tables

Volume Rendering Optical Model Light collaborates with volume âparticlesâ through: Absorption Emission Scattering Sample volume along review beams Accumulate optical properties

Volume Ray Marching Raycast â once per pixel Sample â uniform interims along beam Interpolate â trilinear add, apply exchange capacity Accumulate â coordinate optical properties

Ray Marching Accumulation Equations Accumulation = Integral Color Transmissivity = 1 - Opacity Total Color = Accumulation (Sampled Colors x Sampled Transmissivities)

Ray Marching Accumulation Equations Discrete Versions Accumulation = Sum Color Opacity Transmissivity = 1 - Opacity

CPU Based Volume Rendering Raycast and raymarch for every pixel in scene Camera (eye) area: For Each Pixel Look Direction: Cast Ray Along: Accumulate Color Along Line

CPU Based Volume Rendering Sequential Process Minutes or Hours per outline Optimizations Space Partitioning Early Ray Termination

Volumetric Shadows Light constricted as goes through volume âDeeperâ tests get less brightening Second raymarch from test point to light source Accumulate enlightenment from sampleâs perspective Same collection comparisons Precomputed Light Transmissivity Precalculate light for each voxel focus Trilinearly interject at render time View free, scene/light source subordinate

GPU Based Volume Rendering GPU Gems Volume 1: Chapter 39 âVolume Rendering Techniquesâ Milan Ikits, Joe Kniss, Aaron Lefohn, Charles Hansen IEEE Visualization 2003 Tutorial âInteractive Visualization of Volumetric Data on Consumer PC Hardwareâ âAcceleration Techniques for GPU-Based Volume Renderingâ J. Krugger and R. Westermann, IEEE Visualization 2003

Slice-Based Volume Rendering (SBVR) No volumetric primitive in design API Proxy geometry - polygon primitives as cuts through volume Texture polygons with volumetric information Draw cuts in sorted request â back-to-front Use part shader to perform compositing (mixing)

Volumetric Data Voxel information sent to GPU memory as Stack of 2D surfaces 3D composition Leverage representation pipeline Instructions for setting up 3D surface in OpenGL http://gpwiki.org/index.php/OpenGL_3D_Textures

Proxy Geometry Slices through 3D voxel information 3D voxel information = 3D composition on GPU Assign surface direction to each cut vertex CPU or vertex shader

Proxy Geometry Object-Aligned Slices Fast and basic Three heaps of 2D surfaces â x, y, z standard headings Texture stack swapped taking into account nearest to perspective

Proxy Geometry Issues with Object-Aligned Slices 3x memory utilization Data recreated along 3 guideline bearings Change in perspective results in stack swap Image popping ancient rarities Lag while downloading new surfaces Sampling separation changes with perspective Intensity varieties as camera moves

Proxy Geometry View-Aligned Slices Slower, yet more memory productive Consistent testing separation

Proxy Geometry View-Aligned Slices Algorithm Intersect cutting planes with jumping box Sort coming about vertices in (counter)clockwise request Construct polygon primitive from centroid as triangle fan

Proxy Geometry Spherical Shells Best duplicates volume beam throwing Impractical â complex intermediary geometry

Sliced-Based Volume Rendering Steps

Rendering Proxy Geometry Compositing Over administrator â back-to-front request Under administrator â front-to-delay purchase.:

Rendering Proxy Geometry Compositing = Color and Alpha Accumulation Equations Easily executed utilizing equipment alpha mixing Over Source = 1 Destination = 1 - Source Alpha Under Source = 1 - Destination Alpha Destination = 1

Simple Volume Rendering Fragment Shader void main( uniform float3 emissiveColor, uniform sampler3D dataTex, float3 texCoord : TEXCOORD0 , float4 shading : COLOR ) { float a = tex3D (texCoord, dataTex);/Read 3D information surface shading = a * emissiveColor;/Multiply by opac }

Fragment Shader with Transfer Function void main( uniform sampler3D dataTex, uniform sampler1D tfTex, float3 texCoord : TEXCOORD0 , float4 shading : COLOR ) { float v = tex3d (texCoord, dataTex);/Read 3D information shading = tex1d (v, tfTex);/exchange capacity }

Local Illumination Blinn-Phong Shading Model Resulting = Ambient + Diffuse + Specular

Local Illumination Blinn-Phong Shading Model Requires surface typical vector Whats the ordinary vector of a voxel? Coming about = Ambient + Diffuse + Specular

Local Illumination Blinn-Phong Shading Model Requires surface ordinary vector Whats the typical vector of a voxel? Slope Central contrasts between neighboring voxels Resulting = Ambient + Diffuse + Specular

Local Illumination Compute on-the-fly inside of part shader Requires 6 composition brings for every figuring Precalculate on host and store in voxel information Requires 4x composition memory Pack into 3D RGBA composition to send to GPU

Local Illumination Improve impression of profundity Amplify surface structure

Volumetric Shadows on GPU Light lessened from lightâs perspective CPU â Precomputed Light Transfer Secondary raymarch from test to light source GPU Two-pass calculation Modify intermediary geometry cutting Render from both the eye and the lightâs POV Two distinctive edge supports

Two Pass Volume Rendering with Shadows Slice pivot set somewhere between perspective and light bearings Allows every cut to be rendered from eye and light POV Render request for light â front-to-back Render request for eye â (a) front-to-back (b) back-to-front

First Pass Render from eye Fragment shader Look up light shading from light cushion bound as composition Multiply material shading * light shading

Second pass Render from light Fragment shader Only mix alpha qualities â light transmissivity

Volumetric Shadows

Scattering and Translucency General disseminating impacts excessively complex for intuitive rendering Translucency aftereffect of dispersing Only need to consider approaching light from cone in course of light source

Scattering and Translucency Blurring operation See GPU Gems Chap 39 for points of interest

Performance and Limitations Huge measure of section/pixel operations Texture access Lighting estimation Blending Large memory use Proxy geometry 3D surfaces

Volume Raycasting on GPU âAcceleration Techniques for GPU-Based Volume Renderingâ Krugger and Westermann, 2003 Stream model taken from work in GPU Raytracing Raymarching executed in piece project Cast beams of sight through volume Accumulate shading and obscurity Terminate when haziness achieves edge

Volume Raycasting on GPU Multi-pass calculation Initial passes Precompute beam headings and lengths Additional passes Perform raymarching in parallel for every pixel Split up full raymarch to check for ahead of schedule end

Step 1: Ray Direction Computation Ray course processed for every pixel Stored in 2D surface for utilization in later steps Pass 1: Front appearances of volume bouncing box Pass 2: Back countenances of volume jumping box Vertex shading segments encode article space guideline headings

Step 1: Ray Direction Computation Subtraction mix two compositions Store standardized course â RGB segments Store length â Alpha segment

Fragment Shader Raymarching DIR[x][y] â beam heading composition 2D RGBA values P â per-vertex float3 positions, front of volume bouncing box Interpolated for section shader by illustrations pipeline s â consistent step size Float esteem d â aggregate raymarched separation, s x #steps Float esteem

Fragment Shader Raymarching DIR[x][y] â beam bearing composition 2D RGBA values P â per-vertex float3 positions, front of volume bouncing box Interpolated for section shader by design pipeline s â steady step size Float esteem d â aggregate raymarched separation, s x #steps Float esteem Parametric Ray Equation r â 3D surface directions used to test voxel information

Fragment Shader Raymarching Ray traversal method split into vari