• Aucun résultat trouvé

GigaVoxels: Voxels Come Into Play Cyril Crassin

N/A
N/A
Protected

Academic year: 2022

Partager "GigaVoxels: Voxels Come Into Play Cyril Crassin"

Copied!
60
0
0

Texte intégral

(1)

HAL Id: inria-00526646

https://hal.inria.fr/inria-00526646

Submitted on 15 Nov 2010

HAL is a multi-disciplinary open access archive for the deposit and dissemination of sci- entific research documents, whether they are pub- lished or not. The documents may come from teaching and research institutions in France or abroad, or from public or private research centers.

L’archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d’enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.

GigaVoxels: Voxels Come Into Play

Cyril Crassin

To cite this version:

Cyril Crassin. GigaVoxels: Voxels Come Into Play. Crytek Conference, Nov 2009, Frankfurt, Germany.

�inria-00526646�

(2)

Cyril Crassin, Fabrice Neyret,

INRIA Rhône-Alpes & Grenoble Univ.

Sylvain Lefebvre, Elmar Eisemann, Miguel Sainz

INRIA Sophia-Antipolis Saarland Univ./MPI NVIDIA Corporation

Crytek Conference 26/11/09

(3)

A (very) brief history of voxels

Rings a bell?

Comanche (Novalogic)

Outcast (Appeal Software)

Voxel gridillustration courtesy of “Real-Time Volume Graphics”

(4)

Voxel Engines in Special effects

Natural representation

Fluid, smoke, scans, …

Volumetric phenomena

Semi-transparency

Unified rendering representation

Particles, meshes, fluids…

Lord of the Rings, Digital Domain The Day After Tomorrow, Digital Domain

XXX, Digital Domain

(5)

Voxels in video games ?

Renewed interest

ID Software

John Carmack, Jon Olick (Siggraph 08)

Sparse Voxel Octree ray-casting

Crytek

Cevat Yerli

Two goals :

Content generation

Rendering

[Olick08]

Jon Olick, John Carmack

(6)

Why bother with voxels?

Exploding number of triangles

Costly to transform & rasterize

Inefficient raster of small triangles on current generation GPUs

Geometric LOD ill-defined

Eg. Progressive Meshes

Lot of manual intervention for the artist

(7)

Why bother with voxels?

Filtering is an issue

Needs massive multi- sampling

Multi-sampling is expensive

The Mummy 3, Digital Domain/Rhythm&Hues

(8)

Why bother with voxels?

The Mummy 3, Digital Domain/Rhythm&Hues

Unified Geometry + Texture representation

Avg space

occupancy/density information

Avg color information

(9)

Why bother with voxels ?

Filtering is well defined

LOD = Mip-Mapping

Similarly to 2D textures

Unique multi-scale representation

No additional authoring

Structured representation

Convenient to traverse & edit

Efficient to render

-> Ray-casting

(10)

How to exploit them ?

Main problems:

How to render voxels quickly on the GPU ?

How to exploit these properties ?

Memory is a key issue !

E.g. 4096 ^ 3 x RGBA8 = 256 GB!!!

Transfer CPU  GPU expensive

(11)

GigaVoxels

Goal: Real-time exploration of very large voxel scenes

Full GPU rendering pipeline

Ray-tracing based approach

Fully scalable: Infinite resolution

Publications:

I3D2009 paper [CNLE09]

Siggraph 2009 Talk

GPU Pro (ShaderX 8) Book Chapter

(12)

Key ideas

Rendering only dependant on what is visible

Ray-tracing approach

Load only needed data, at the needed resolution

Occlusion + LOD

Ray-guided streaming

Reuse loaded data as much as possible

GPU cache mechanism

Voxel Ray- Tracer

GPU Cache

Data requests

(13)

GigaVoxels CUDA pipeline

GPU

Sparse Voxel

Octree Structure updates

Data usage+requests

GPU Cache Manager

CPU

Central

Memory Store

Mass storage

Output image

Voxel Ray- Tracer

GPU Producer

Mesh data

(14)

I3D 2008 [BNMBC08]

(15)
(16)
(17)

Voxel sculpting

Direct voxel scultping

3D-Coat

Like ZBrush

Generate a lot of details

5-20 FPS

(18)

Data Structure

GPU

Structure updates Sparse Voxel

Octree

CPU

Data usage+requests

Output image

Voxel Ray- Tracer

CPU Data Store

GPU Cache Manager

Mass storage

(19)

Sparse Voxel MipMap Pyramid

Composed structure

Data structure

Generalized Octree

• Empty space compaction

Bricks of voxels

• Linked by octree nodes

• Store opacity, color, normal,…

Tower model courtesy of Erklaerbar, made with 3DCoat

(20)

Brick pool

CUDA 3D Array (Texture)

Node pool

Linear Memory

Octree of Voxel Bricks

One child pointer

Compact structure

Cache efficient

1

1 2 3 4 5

4 5

2 3

Compact node encoding

2x 32bits values

GPU

(21)

Rendering

GPU

CPU

Output image

Structure updates

Data usage+requests

Sparse Voxel Octree

CPU Data Store

GPU Cache Manager

On- demand

Data Producer

Voxel Ray- Tracer

(22)

Hierarchical Volume Ray-Casting

Render semi-transparent materials

Participating medias

Emission/Absorption model for each ray

Accumulate Color intensity + Alpha

Front-to-back

Stop when opaque

(23)

Hierarchical Volume Ray-Casting

Volume ray-casting

[Sch05, CB04, LHN05a, Olick08, GMAG08, CNLE09]

One big CUDA kernel

One thread per ray

Octree traversal

KD-restart algorithm [FS05]

Ray-driven LOD

Bricks marching

Regular sampling into the 3D texture

(24)

Volume Ray-Casting

1

2 3

4 5

6 7 8 9

1

2

4 5

6 7

3 Tree

Descent

Brick Marching

Brick Marching

Brick

Marching

Skip Node

Per-ray LOD evaluation Ray traversal

(25)

Rendering costs

(26)

Volume MipMapping mechanism

Problem: LOD uses

discrete downsampled levels

Popping + Aliasing

Same as bilinear only for 2D textures

Geometry is texture 

Uses pre-integrated LOD !

No need of multi-sampling (eg. MSAA)

L0 L1 L2 L3

MipMap zones MipMap pyramid

(27)

Cone tracing

Image plane

One pixel footprint S1

S2 S3

S0

S10 S20

S30

Integrated pixel Color+Alpha

Full MipMap pyramid

Linearly interpolat ed sample Sample

footprint

S21 S31

S11

(28)

Shading computation

Standard Blinn-Phong illumination

Per sample

Normal information

On-the-fly gradient with finite differences

Stored normal information

Deferred for opaque objects

(29)
(30)

Data Management

GPU

Structure updates

Data usage+requests

Sparse Voxel Octree

Output image

Voxel Ray- Tracer

CPU Data Store GPU

Cache Manager

GPU Producer

(31)

GPU Caches

Data management made through a cache mechanism

Used for both the node pool and brick pool

Allows full scalability

Rely on the octree to address elements

The node pool is addressing itself !

No page table

Data requests generated by the ray-tracing

Node subdivision

Brick loading

Brick Pool

Cache Mgr

Node Pool

Cache Mgr

(32)

1

Incremental octree update

Progressive loading

1

2 3

4 5

Pass 2

Pass 3 Pass 4

Wrong LOD

Wrong LOD

1 2 3 4 5

Node poolBrick pool

Data request

2 Data 3 requests

4 Data

request

(Constant value)

(Max opacity)

Pass 1

(Node not reached) (LoD OK)

No Data

(33)

Minimum amount of data is loaded

Progressive refinement

Always ensure interactivity

Fully compatible with secondary rays and exotic rays paths

Reflections, refractions, shadows, curved rays, …

Ray-based visibility & requests

(34)

Cache requests handling

Entirely handled on the GPU

Brick Pool

Cache Mgr

Node Pool

Cache Mgr

Request batch

Voxel Ray- Tracer

Request

handler CPU Data

Store

Zero-copy fetch

Data Provider

Procedural Generation Nodes write

Voxel bricks write

(35)

Cache strategy

Least Recently Used (LRU) strategy

Older elements replaced first

Sorted usage list maintained for each cache on the GPU.

Usage info provided by the ray-tracer

Maintained as a data-parallel process

Used when new elements have to be

inserted

(36)

Usage sorted nodes addresses

Oldest Newest

SVMP caches

LRU (Least Recently Used)

Track elements usage

Maintain list with least used in front

Octree/Bricks Pool

Cache Elements (Node Tile/Brick)

Stream

compaction

Used nodes mask

Stream

compaction

Concatenate New elements

New data

(37)

Global cache characteristics

Driven by ray-tracing

Fully managed on the GPU

Zero CPU intervention apart kernel launches.

Leads to fully on-chip structure management and building

More efficient when large amount of

updates

(38)
(39)
(40)
(41)

Voxel data synthesis

Instantiation

Recursivity

Infinite details

(42)
(43)

Free voxel objects instancing

BVH structure ray-casting

Cooperative ray packet traversal [GPSS07]

Shared stack

WA-Buffer

Deferred compositing

(44)

(45)
(46)

Voxels generation

GPU

Sparse Voxel Octree

Structure updates

Data usage+requests

GPU Cache Manager

Output image

Voxel Ray- Tracer

GPU Producer

Mesh data

(47)
(48)

Procedural noise

On-the-fly mesh voxelization

Distance field

Procedural noise

(49)
(50)
(51)

Cool Blurry Effects

Going further with 3D MipMapping

Full pre-integrated versions of objects

Idea: Implements blurry effects very efficiently

Without multi-sampling

Tuning the mipmap level

Soft shadows

Depth of field

Glossy reflections…

(52)

Soft shadows

Secondary rays

When ray hit object surface

MipMap level chosen to approximate light source cone

Resulting integrated opacity

Fully compatible with the cache

Light source

Occluder Point light

source

Occluder

Impact volume

Primary ray

(53)
(54)

Depth-Of-Field

Similarly for depth- of-field…

MipMap leveld

based on circle-of- confusion size

Lens Image

plane

Apperture

Plane in focus

Illustration courtesy of GPU Gems

(55)
(56)

Ambient occlusion

Uses one filtered sample

Covers the surrounding region

Without AO With AO

(57)
(58)

Future work direction

Animation

Yes, this can be efficiently animated !

Volume deformation (skinning)

Improved visibility integration

Filtering

Shading/Normals

Isotropic pre-integration

Two walls problems

(59)

Many thanks go to …

Digisens Corporation

Rhone-Alpes Explora’doc program

Cluster of Excellence on Multimodal Computing and Interaction (M2CI)

3D-Coat and Rick Sarasin

Erklaerbar

(60)

Any questions ?

Références

Documents relatifs

Puisque GL(V ) est engendré par les matrices de transvection et de dilatation, et les deux membres de l’égalité que l’on cherche à montrer sont multiplicatifs, il suffit de montrer

In particular, the agents that Daniela and Niva have implemented in DALI do not sim- ply propose chunks of Pirandello’s text: rather, each agent is intended to reproduce the

La courbure du temps ne précipite pas l’issue fatale, mais la retarde. Elle contrarie le compte-à-rebours linéaire d’une mort annoncée. Contre l’en- fer du même, Gus Van

used during Data Production Management Shader (write your custom shader). used during Visit algorithm

In this paper, we have presented a new multiscale surface representation and a rendering algorithm able to reproduce view-dependent effects of detailed geometry accounting

It may seem less important because the N 3 -tree memory occupation is much lower than for the brick pool, but the amount of data read during the traversal of the tree is critical

- If the two pixels fall in subtiles in different column of the same tile, total frame cost is T (2) - If the two pixels fall in subtiles in same column of the same tile,

At rendering time for each pixel we deter- mine the collector area on the lit cloud surface for different sets of scattering orders, then we infer the associated light transport..