Title: Fast Scene Voxelization and its Applications
1Fast Scene Voxelization and its Applications
Elmar Eisemann and Xavier Décoret ARTIS-GRAVIR
/IMAG-INRIA ARTIS is a team of the GRAVIR/IMAG
laboratory, a joint effort of CNRS, INRIA, INPG
and UJF
2A long time ago ...
- Simple games and simple pleasures...
3Nowadays ...
- 3D
- Complex models
- Complex effects
4Context
- Complex and dynamic scenes
- Need for
- Fast information acquisition
- Fast information evaluation
- Shader compatibility
5Context
6Context
7Context
8What is common?
- All use information from voxels!
9What is a Voxel?
- Space discretized by cubes (voxels)
- Can contain information
10Why would I care?
- Lots of applications
- Acceleration structure
- Reconstruction
- Visibility
- Terrain rendering
- Simplification...
11Whats good about voxels?
- Constant complexity
- (scene independent)
- Simple structure
- Simple entities
12Whats bad about voxels?
- Storage cost (3D)
- Not GPU adapted
- Slow on CPU
- 100K polygons
- octree 256 x 256 x 256
- 3 minutes Haumont and Warzee 2002
13Previous Work on GPU Voxelization
- Everitt et al. 2001 using Depth Peeling
- Layers are peeled off using zBuffers
- Pro
- Representation is accurate from the viewpoint
- Contra
- One pass per depth complexity
- Result not easy to use (and several textures)
14Goals of our approach
- Representation easy to use on GPU
- Result in one pass
- Handle depth complexity problem
15Previous Work on GPU Voxelization
- Dong, Chen, Bao, Zhang and Peng
- Pacific Graphics 2004,
- Real-time Voxelization for Complex Models
- Same key idea for representation
- Comparison later...
16Our contribution(s)
- Simple and compact representation
- GPU adapted (especially in future)
- Very fast
- 1.000 K polygons
- 1024 x 1024 x 128
- At approx. 70Hz (0.02 seconds)
- Three sample applications
17The price of speed
- Less information
- basically 1 bit
- trade-off grid resolution ltgt information
- Not accurate
- not watertight
- For most applications this is not problematic
- Not hierarchical
18Lets voxelize ...
19Principle - The key idea
- Represent a 3D grid as a 2D image
slicemap
- Use GPU to fill grid by rasterizing
20Principle - Voxel encoding
- Associate bitmask to distance of fragment
21Principle - Voxel encoding
using OpenGL LogicOps
22Principle - Voxel encoding
- Shader extremely simple (lt10 instructions)
23Principle - Voxel encoding
- 32 slices for 4 channels (RGBA) with 8 bits
24Principle - Voxel encoding
25Technical details - Precision
- Using MRT 432 128 in a single pass
26Principle - Grid
27Technical details Local precision
uniform
28Technical details Local precision
- Tighter interval using two depth maps
29Technical details Local precision
local
30Technical details Local precision
- Very efficient
- 1 or 2 depth renderings (FastZBuffer)
- still simple shader (2 supplementary texlookups)
31Limitations
32Limitations
- Max resolution 4096 x 4096 x 128
- Only rasterizable objects
- Different representation along Z-axis
- but can be beneficial
33Comparison to Dong et al.
- Same encoding in bits
- 3 slicemaps to solve hole problem
- limits resolution or several render passes
- needs fusion into final voxel texture
- No local precision
34Applications
- Transmittance shadow maps
- Refraction
- Shadow volume culling and clamping
35Transmittance Shadow Maps - TSM
36TSM - Related Works
- Deep shadow maps Lokovic and Veach 00
- Opacity maps Kim and Neumann 01
- Nalu Nguyen and Donnelly 05
37TSM - Related Works
- Deep shadow maps Lokovic and Veach 00
- Opacity maps Kim and Neumann 01
- Nalu Nguyen and Donnelly 05
38Deep shadow maps
- Shadows for complex scenes
- 1D attenuation function per pixel
- Evaluation like shadow map
39Deep shadow maps
- Pro
- nice results
- Contra
- far from real-time
- no physical meaning
Images courtesy of Lokovich and Veach, Deep
Shadow Maps, Proc. of Siggraph 2000
40TSM - Related Works
- Opacity maps Kim and Neumann 01
- Store float opacity in layers (interpolation
simple) - Creation of one layer uses whole geometry
- For GPU evaluation (original algo used CPU
evaluation) - Currently gt16 layers possible perfomance
dropKoster04 - Expensive for complex scenes and several layers
41Transmittance shadow maps Key idea
- Semi-transparent surfaces
Attenuation nb of intersected
surfaces
42Transmittance shadow maps Key idea
- Transparent objects slicemap
Attenuation nb of intersected
voxels
43Transmittance shadow maps - Algo
- Input Object with semi-transparent material
- 2 render passes
- Light
- Viewer
163.000 tris
44Transmittance shadow maps - Algo
- Near/far depth maps of semi-transparent parts and
local slicemap
depth maps
slicemap
45Transmittance shadow maps - Shader
46Transmittance shadow maps - Shader
- Value truncation by position
just a mod
S(p)
47Transmittance shadow maps - Shader
48Transmittance shadow maps
Results
49Transmittance shadow maps
- Trade-off Precision vs. information
50Deep shadow maps in real time
51Deep shadow maps in real time
supersampling
partial occlusion (small occluders)
semi-transparent (glass)
volumetric (fog)
52Deep shadow maps in real time
supersampling
TSM
partial occlusion (small occluders)
semi-transparent (glass)
volumetric (fog)
53Deep shadow maps in real time
supersampling
TSM
Now...
partial occlusion (small occluders)
semi-transparent (glass)
volumetric (fog)
54Applications
- Transmittance shadow maps
- Refraction
- Shadow volume culling and clamping
55Volumetric effects Related Works
- Inspired by Wyman 05
-
- Refract ray twice
- front face normals and back face normals
-
- Traversed depth approximated
- precalculation depth map difference
56Volumetric effects Approach
- Use volume info for refraction / scattering as
well as attenuation
Lokovic and Veach
57Volumetric effects - Algorithm
- Suppose closed object
- Goal traversed volume/create filled voxels
Depth map difference works
58Volumetric effects - Algorithm
- Suppose closed object
- Goal traversed volume/create filled voxels
Depth map difference fails
59Volumetric effects Naive approach
- Single slicemap from eye and flood fill
60Volumetric effects Naive approach
- Single slicemap from eye and flood fill
- Problems
- On GPU flood fill is too slow
- Evaluation texture is impossible
- More than 4 Gbyte for 32 slices
- Several faces in one voxel (ambiguity)
61Volumetric effects Key Idea
- Create two slicemaps
- Front and back facing surfaces
- This can be done in a single pass (MRT)
62Volumetric effects Key Idea
- Two slicemaps allow incremental volume
computation via in/out states
63Volumetric effects - Ambiguity
Even ambiguity can often be solved!
64Volumetric effects Evaluation
- Evaluation texture for a single channel
- info to resolve ambiguity
- Texture lookups are independent
-
- Details in paper
65Volumetric effects
gt200 fps on a Geforce6800
66Applications
- Transmittance shadow maps
- Refraction
- Shadow volume culling and clamping
67Shadow volume culling and clamping
- CC ShadowVolumes
- Lloyd, Wendt, Govindaraju, Manocha 2004
- Culling and Clamping of SV Crow 77
- CC Shadow volumes
- Caster culling
- 1
1
1
68CC Shadow volumes
- Shadow volume clampingReceiver culling
69Shadow volume culling and clamping
- Our approach uses the slicemap to perform shadow
clamping (modified depth function)
70Shadow volume culling and clamping
- Our approach uses the slicemap to perform shadow
clamping (modified depth function)
Shadow volumes
CC shadow volumes
71Shadow volume culling and clamping
- Slicemap with modified depth function
72Shadow volume culling and clamping
- Our approach uses the slicemap to perform shadow
clamping (modified depth function)
73Shadow volume culling and clamping
- How to determine volume extent
- Currently in a shader, 1 pass for 1 slice
74Shadow volume culling and clamping
- Proposed hardware extension
- OR in area of occluder would be sufficient
- (1 pass for 128 slices)
75Shadow volume culling and clamping
- Slight Optimizations to improve culling and
clamping
76Conclusion
- Fast voxelization of highly complex scenes
- Grid of high resolution 4096 x 4096 x 128
- Completely GPU based
- Input of almost arbitrary nature/topology
- Several applications possible
77And the future ...?
- 32 bit framebuffers imply 512 slices in 1 pass
- Direct X 10 implies bit operations
78- Thank you very much
- for your attention!