real-time voxel cone-tracing - github...

38
Ian Lilley, Sean Lilley, Nop Jiarathanakul REAL-TIME VOXEL CONE-TRACING realtimevoxels.blogspot.com

Upload: others

Post on 09-Oct-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: REAL-TIME VOXEL CONE-TRACING - GitHub Pagescis565-fall-2012.github.io/lectures/11-01-GigaVoxels-And...The Technology Behind the Elemental Demo. SIGGRAPH 2012 Voxel Cone Tracing Cyril

Ian Lilley, Sean Lilley, Nop Jiarathanakul

REAL-TIME VOXEL CONE-TRACING

realtimevoxels.blogspot.com

Page 2: REAL-TIME VOXEL CONE-TRACING - GitHub Pagescis565-fall-2012.github.io/lectures/11-01-GigaVoxels-And...The Technology Behind the Elemental Demo. SIGGRAPH 2012 Voxel Cone Tracing Cyril

MOTIVATION Why do we do this?

Page 3: REAL-TIME VOXEL CONE-TRACING - GitHub Pagescis565-fall-2012.github.io/lectures/11-01-GigaVoxels-And...The Technology Behind the Elemental Demo. SIGGRAPH 2012 Voxel Cone Tracing Cyril

http://graphics.stanford.edu/~henrik/images/global.html

Page 4: REAL-TIME VOXEL CONE-TRACING - GitHub Pagescis565-fall-2012.github.io/lectures/11-01-GigaVoxels-And...The Technology Behind the Elemental Demo. SIGGRAPH 2012 Voxel Cone Tracing Cyril

http://www.ea.com/

Page 5: REAL-TIME VOXEL CONE-TRACING - GitHub Pagescis565-fall-2012.github.io/lectures/11-01-GigaVoxels-And...The Technology Behind the Elemental Demo. SIGGRAPH 2012 Voxel Cone Tracing Cyril
Page 6: REAL-TIME VOXEL CONE-TRACING - GitHub Pagescis565-fall-2012.github.io/lectures/11-01-GigaVoxels-And...The Technology Behind the Elemental Demo. SIGGRAPH 2012 Voxel Cone Tracing Cyril

http://www.unrealengine.com/unreal_engine_4/

Page 7: REAL-TIME VOXEL CONE-TRACING - GitHub Pagescis565-fall-2012.github.io/lectures/11-01-GigaVoxels-And...The Technology Behind the Elemental Demo. SIGGRAPH 2012 Voxel Cone Tracing Cyril

http://www.unrealengine.com/unreal_engine_4/

Page 8: REAL-TIME VOXEL CONE-TRACING - GitHub Pagescis565-fall-2012.github.io/lectures/11-01-GigaVoxels-And...The Technology Behind the Elemental Demo. SIGGRAPH 2012 Voxel Cone Tracing Cyril

The Technology Behind the Elemental Demo. SIGGRAPH 2012

Page 9: REAL-TIME VOXEL CONE-TRACING - GitHub Pagescis565-fall-2012.github.io/lectures/11-01-GigaVoxels-And...The Technology Behind the Elemental Demo. SIGGRAPH 2012 Voxel Cone Tracing Cyril

The Technology Behind the Elemental Demo. SIGGRAPH 2012

Page 10: REAL-TIME VOXEL CONE-TRACING - GitHub Pagescis565-fall-2012.github.io/lectures/11-01-GigaVoxels-And...The Technology Behind the Elemental Demo. SIGGRAPH 2012 Voxel Cone Tracing Cyril

METHOD How is it done?

Page 11: REAL-TIME VOXEL CONE-TRACING - GitHub Pagescis565-fall-2012.github.io/lectures/11-01-GigaVoxels-And...The Technology Behind the Elemental Demo. SIGGRAPH 2012 Voxel Cone Tracing Cyril

Voxel Cone Tracing

http://www.icare3d.org/research-cat/publications/interactive-indirect-illumination-using-voxel-cone-tracing.html

Page 12: REAL-TIME VOXEL CONE-TRACING - GitHub Pagescis565-fall-2012.github.io/lectures/11-01-GigaVoxels-And...The Technology Behind the Elemental Demo. SIGGRAPH 2012 Voxel Cone Tracing Cyril

Volume Ray Marching

Real-time Volume Graphics. SIGGRAPH 2004

Page 13: REAL-TIME VOXEL CONE-TRACING - GitHub Pagescis565-fall-2012.github.io/lectures/11-01-GigaVoxels-And...The Technology Behind the Elemental Demo. SIGGRAPH 2012 Voxel Cone Tracing Cyril

Volume Ray Marching

http://en.wikipedia.org/wiki/Volume_ray_casting

Page 14: REAL-TIME VOXEL CONE-TRACING - GitHub Pagescis565-fall-2012.github.io/lectures/11-01-GigaVoxels-And...The Technology Behind the Elemental Demo. SIGGRAPH 2012 Voxel Cone Tracing Cyril

• Pre-filtered Data

• Cone Angle / FOV

• Sample from mips

• Anti-Aliased

• Levels of Detail

• Adaptive Step Size

• Empty Space Skipping

Voxel Cone Tracing

The Technology Behind the Elemental Demo. SIGGRAPH 2012

Page 15: REAL-TIME VOXEL CONE-TRACING - GitHub Pagescis565-fall-2012.github.io/lectures/11-01-GigaVoxels-And...The Technology Behind the Elemental Demo. SIGGRAPH 2012 Voxel Cone Tracing Cyril

Voxel Cone Tracing

Cyril Crassin, GigaVoxels: A Voxel-Based Rendering Pipeline For Efficient Exploration Of Large And Detailed Scenes

Page 16: REAL-TIME VOXEL CONE-TRACING - GitHub Pagescis565-fall-2012.github.io/lectures/11-01-GigaVoxels-And...The Technology Behind the Elemental Demo. SIGGRAPH 2012 Voxel Cone Tracing Cyril

OUR APPROACH How do we do it?

Page 17: REAL-TIME VOXEL CONE-TRACING - GitHub Pagescis565-fall-2012.github.io/lectures/11-01-GigaVoxels-And...The Technology Behind the Elemental Demo. SIGGRAPH 2012 Voxel Cone Tracing Cyril

PIPELINE

Diffuse Shading

• Traditional rasterization-based technique

Beyond Diffuse Shading

• Voxel cone-tracing

2 Separate Scene Representations

• Polygonal Mesh

• Voxel 3D Texture

Page 18: REAL-TIME VOXEL CONE-TRACING - GitHub Pagescis565-fall-2012.github.io/lectures/11-01-GigaVoxels-And...The Technology Behind the Elemental Demo. SIGGRAPH 2012 Voxel Cone Tracing Cyril

Polygonal Scene Render

Shadow Map Voxelize Mipmap

PIPELINE

Triangle Info

Shadow Info

Voxel Info

Pre-filtered Voxel Info

Shadow Info

Page 19: REAL-TIME VOXEL CONE-TRACING - GitHub Pagescis565-fall-2012.github.io/lectures/11-01-GigaVoxels-And...The Technology Behind the Elemental Demo. SIGGRAPH 2012 Voxel Cone Tracing Cyril

Output

PIPELINE – RENDERING

Triangle Info

Shadow Info

Voxel Info

Diffuse Indirect Specular

Local Illumination Gathering Cone Trace

Direct Cone Trace

+ + = (and AO)

Page 20: REAL-TIME VOXEL CONE-TRACING - GitHub Pagescis565-fall-2012.github.io/lectures/11-01-GigaVoxels-And...The Technology Behind the Elemental Demo. SIGGRAPH 2012 Voxel Cone Tracing Cyril

Everything is on the GPU By the way…

Page 21: REAL-TIME VOXEL CONE-TRACING - GitHub Pagescis565-fall-2012.github.io/lectures/11-01-GigaVoxels-And...The Technology Behind the Elemental Demo. SIGGRAPH 2012 Voxel Cone Tracing Cyril

• Soft shadows

• Apply a Gaussian blur to the shadow map

• Use probability function to determine shadow strength

Variance Shadow Map

http://pixelstoomany.wordpress.com/category/shadows/variance-shadow-maps/

Page 22: REAL-TIME VOXEL CONE-TRACING - GitHub Pagescis565-fall-2012.github.io/lectures/11-01-GigaVoxels-And...The Technology Behind the Elemental Demo. SIGGRAPH 2012 Voxel Cone Tracing Cyril

• Render from orthographic camera

• 3 passes for each axis

• Viewport = voxel grid dimensions

• Output: radiance color and direction

• On fragment shader,

Image load/store (OpenGL 4.2)

Voxelize Triangles

Cyril Crassin. OpenGL Insights Sparse Voxelization.

Page 23: REAL-TIME VOXEL CONE-TRACING - GitHub Pagescis565-fall-2012.github.io/lectures/11-01-GigaVoxels-And...The Technology Behind the Elemental Demo. SIGGRAPH 2012 Voxel Cone Tracing Cyril

Mipmaps • Alpha weighted average

• On fragment shader. Image load/store (OpenGL 4.2)

Page 24: REAL-TIME VOXEL CONE-TRACING - GitHub Pagescis565-fall-2012.github.io/lectures/11-01-GigaVoxels-And...The Technology Behind the Elemental Demo. SIGGRAPH 2012 Voxel Cone Tracing Cyril

Mipmaps

Cyril Crassin, GigaVoxels: A Voxel-Based Rendering Pipeline For Efficient Exploration Of Large And Detailed Scenes

Page 25: REAL-TIME VOXEL CONE-TRACING - GitHub Pagescis565-fall-2012.github.io/lectures/11-01-GigaVoxels-And...The Technology Behind the Elemental Demo. SIGGRAPH 2012 Voxel Cone Tracing Cyril

LIGHTING Making things look pretty

Page 26: REAL-TIME VOXEL CONE-TRACING - GitHub Pagescis565-fall-2012.github.io/lectures/11-01-GigaVoxels-And...The Technology Behind the Elemental Demo. SIGGRAPH 2012 Voxel Cone Tracing Cyril

Diffuse Lighting

Page 27: REAL-TIME VOXEL CONE-TRACING - GitHub Pagescis565-fall-2012.github.io/lectures/11-01-GigaVoxels-And...The Technology Behind the Elemental Demo. SIGGRAPH 2012 Voxel Cone Tracing Cyril

• Approximate a hemisphere by tracing cones outwards

• Treat each gather point as point light.

• Ambient Occlusion can be done in a similar way

Indirect Lighting

Cyril Crassin, GigaVoxels: A Voxel-Based Rendering Pipeline For Efficient Exploration Of Large And Detailed Scenes

Page 28: REAL-TIME VOXEL CONE-TRACING - GitHub Pagescis565-fall-2012.github.io/lectures/11-01-GigaVoxels-And...The Technology Behind the Elemental Demo. SIGGRAPH 2012 Voxel Cone Tracing Cyril

• A sharper cone in the direction of the reflected view direction.

• Direct visualization of voxel data

Specular Reflection

Cyril Crassin, GigaVoxels: A Voxel-Based Rendering Pipeline For Efficient Exploration Of Large And Detailed Scenes

Page 29: REAL-TIME VOXEL CONE-TRACING - GitHub Pagescis565-fall-2012.github.io/lectures/11-01-GigaVoxels-And...The Technology Behind the Elemental Demo. SIGGRAPH 2012 Voxel Cone Tracing Cyril

Diffused Color (no lighting)

Page 30: REAL-TIME VOXEL CONE-TRACING - GitHub Pagescis565-fall-2012.github.io/lectures/11-01-GigaVoxels-And...The Technology Behind the Elemental Demo. SIGGRAPH 2012 Voxel Cone Tracing Cyril

Ambient Occlusion

Page 31: REAL-TIME VOXEL CONE-TRACING - GitHub Pagescis565-fall-2012.github.io/lectures/11-01-GigaVoxels-And...The Technology Behind the Elemental Demo. SIGGRAPH 2012 Voxel Cone Tracing Cyril

Indirect Diffuse

Page 32: REAL-TIME VOXEL CONE-TRACING - GitHub Pagescis565-fall-2012.github.io/lectures/11-01-GigaVoxels-And...The Technology Behind the Elemental Demo. SIGGRAPH 2012 Voxel Cone Tracing Cyril

Specular Reflection

Page 33: REAL-TIME VOXEL CONE-TRACING - GitHub Pagescis565-fall-2012.github.io/lectures/11-01-GigaVoxels-And...The Technology Behind the Elemental Demo. SIGGRAPH 2012 Voxel Cone Tracing Cyril

Composited Output

Page 34: REAL-TIME VOXEL CONE-TRACING - GitHub Pagescis565-fall-2012.github.io/lectures/11-01-GigaVoxels-And...The Technology Behind the Elemental Demo. SIGGRAPH 2012 Voxel Cone Tracing Cyril

DEMO The real deal

Page 35: REAL-TIME VOXEL CONE-TRACING - GitHub Pagescis565-fall-2012.github.io/lectures/11-01-GigaVoxels-And...The Technology Behind the Elemental Demo. SIGGRAPH 2012 Voxel Cone Tracing Cyril

FUTURE WORK We still got lots to do.

Page 36: REAL-TIME VOXEL CONE-TRACING - GitHub Pagescis565-fall-2012.github.io/lectures/11-01-GigaVoxels-And...The Technology Behind the Elemental Demo. SIGGRAPH 2012 Voxel Cone Tracing Cyril

• Different from Cyril’s method of using Oct-tree

• Large OpenGL 3D Texture

• Choose regions to be in memory

• Spatially coherent

• Hardware interpolation (trilinear)

• Mipmap interpolation (quadrilinear)

Sparse Texture

Page 37: REAL-TIME VOXEL CONE-TRACING - GitHub Pagescis565-fall-2012.github.io/lectures/11-01-GigaVoxels-And...The Technology Behind the Elemental Demo. SIGGRAPH 2012 Voxel Cone Tracing Cyril

• Voxelize scene only around the eye, on demand

• The renderer can handle larger scenes

• Inspired by cascaded shadow maps

View-Dependent Voxelization

Page 38: REAL-TIME VOXEL CONE-TRACING - GitHub Pagescis565-fall-2012.github.io/lectures/11-01-GigaVoxels-And...The Technology Behind the Elemental Demo. SIGGRAPH 2012 Voxel Cone Tracing Cyril

Sources GigaVoxels: A Voxel-Based Rendering Pipeline For Efficient Exploration Of Large And Detailed Scenes

http://www.icare3d.org/research-cat/publications/gigavoxels-a-voxel-based-rendering-pipeline-for-efficient-exploration-of-large-and-detailed-scenes.html

Octree-Based Sparse Voxelization Using The GPU Hardware Rasterizer

http://www.icare3d.org/research-cat/publications/octree-based-sparse-voxelization-using-the-gpu-hardware-rasterizer.html

The Technology Behind the Elemental Demo. SIGGRAPH 2012.

http://www.unrealengine.com/files/misc/The_Technology_Behind_the_Elemental_Demo_16x9_(2).pdf