real-time mixed water simulation and rendering...

1
Real-time Mixed Water Simulation and Rendering Techniques for Visual Effects Rodrigo Marques 1,2 , Bruno Feijó 1, Pablo Bioni 1,2 1 - VisionLab – Pontifical Catholic University of Rio de Janeiro - Rio de Janeiro-RJ, Brazil 2 – Globo Network – Visual Effects Research Group [email protected], [email protected], [email protected] VFX Production Pipeline 1 Footage Tracking Displacement Simulation Normals Simulation Dynamic Mesh Builder (LoD) Lighting/Shading Composition Passes Rendering Dynamic Mesh Builder 2 The user can select 3 options of Level of Detail algorithms: Radial LoD [1] GeoClipMap LoD [2] Projected Grid LoD [3] 0 ... N 0 ... N y x = 0 + 1 , = 2 , = 2 0 ... N 0 ... N Level Dimension Pattern 0 512 x 512 1 256 x 256 2 128 x 128 3 64 x 64 4 32 x 32 5 16 x 16 6 8 x 8 7 4 x 4 8 2 x 2 Displacement and Normals Simulation 3 Gerstner Wave Model , , = + × . × , , + = , , , + = , + × . × , , + = Statistical FFT Wave Model Results 5 h x, t = h k,t e jk∙x k N x, t = h x, t = jk h k,t e jk∙x k P h k = h k, t 2 Philips Spectrum P h k =A e 1 kL 2 k 4 k ∙w 2 h 0 k = 1 2 ξ r + jξ j P h k GPU Implementation using CUDA (CUFFT) h0 ω h0 ω Frequency Domain Time Domain Amplitudes Displacement Maps (low freq.) Normal Maps (high freq.) IFFT IFFT Time Time Narrow Band Broad Band Height Map Normal Map h(k,t) h(k,t) h(x,t) h(x,t) Perlin Noise = 2 =0 The system can combine multiple layers of different techniques to produce displacements or normal maps. This allows artist to create a specific ocean shape, like big waves with Gerstner, and control each wave parameter and combine with a random wave model to reduce tile effects. Moreover, the parameters can be changed in real-time using DirectX Shaders, and finally we can render it using OptiX. Lighting and Rendering 4 The water shading uses a Fresnel approach to combine reflections and refractions, and also handle underwater fog and caustics. The real-time version uses reflection and refraction maps and the final OptiX version uses raytracing and adjust the reflections according surface normal. Finally we export the final image with multiple passes (normal, reflection, refraction, zdepth and others) for post processing. 1 10 100 1000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Processing Time (ms) Layers CPU 1 CPU 2 CPU 4 CUDA Interface Final Scene References [1] Hu, Y. et al., 2004. Realistic, Real-Time Rendering of Ocean Waves. Computer Animation and Virtual Worlds, 17(1), pp.59 - 67. [2] Asirvatham, A. & Hoppe, H., 2005. Terrain Rendering Using GP-Based Geometry Clipmaps. In GPU Gems 2. NVidia Corporation. pp.27-45. [3] Johanson, C., 2004. Real-time water rendering. MSc thesis. Lund University.

Upload: dangque

Post on 08-Feb-2019

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Real-time Mixed Water Simulation and Rendering …developer.download.nvidia.com/GTC/PDF/GTC2012/Posters/P...Real-time Mixed Water Simulation and Rendering Techniques for Visual Effects

Real-time Mixed Water Simulation and Rendering Techniques for Visual Effects Rodrigo Marques1,2, Bruno Feijó1, Pablo Bioni1,2 1 - VisionLab – Pontifical Catholic University of Rio de Janeiro - Rio de Janeiro-RJ, Brazil 2 – Globo Network – Visual Effects Research Group [email protected], [email protected], [email protected]

VFX Production Pipeline 1 Footage

Tracking

Displacement Simulation

Normals Simulation

Dynamic Mesh Builder (LoD) Lighting/Shading

Composition

Passes Rendering

Dynamic Mesh Builder 2 The user can select 3 options of Level of Detail algorithms: • Radial LoD [1]

• GeoClipMap LoD [2]

• Projected Grid LoD [3]

0 ... N

0

...

N

y

x

𝑟 = 𝑎0 + 𝑎1𝑖𝑘

𝑥𝑖,𝑗 = 𝑟 𝑐𝑜𝑠2𝜋𝑗

𝑀

𝑦𝑖,𝑗 = 𝑟 𝑠𝑖𝑛2𝜋𝑗

𝑀

0 ... N

0

...

N

Level Dimension Pattern

0 512 x 512

1 256 x 256

2 128 x 128

3 64 x 64

4 32 x 32

5 16 x 16

6 8 x 8

7 4 x 4

8 2 x 2

Displacement and Normals Simulation

3

• Gerstner Wave Model

𝑷 𝒙, 𝒛, 𝒕 =

𝒙 + 𝑸𝒊𝑨𝒊 × 𝑫𝒊. 𝒙 × 𝐜𝐨𝐬 𝝎𝒊 𝑫𝒊 ∙ 𝒙, 𝟎, 𝒛 + 𝝋𝒊𝒕

𝑵

𝒊=𝟏

,

𝑨𝒊 𝐬𝐢𝐧 𝝎𝒊 𝑫𝒊 ∙ 𝒙, 𝟎, 𝒛 + 𝝋𝒊𝒕

𝑵

𝒊=𝟏

,

𝒛 + 𝑸𝒊𝑨𝒊 × 𝑫𝒊. 𝒛 × 𝐜𝐨𝐬 𝝎𝒊 𝑫𝒊 ∙ 𝒙, 𝟎, 𝒛 + 𝝋𝒊𝒕

𝑵

𝒊=𝟏

• Statistical FFT Wave Model

Results 5

h x, t = h k, t ejk∙x

k

N x, t = 𝛻h x, t = jk h k, t ejk∙x

k

Ph k = h k, t2

Philips Spectrum

Ph k = Ae−

1kL 2

k4k ∙ w

2

h 0 k =1

2ξr + jξj Ph k

GPU Implementation using CUDA (CUFFT)

h0

ω

h0

ω

Frequency Domain Time Domain

Amplitudes

Displacement Maps

(low freq.)

Normal Maps

(high freq.)

IFFT

IFFT

Time

Time

Narrow

Band

Broad

Band

Height

Map

Normal

Map

h(k,t)

h(k,t)

h(x,t)

h(x,t)

• Perlin Noise

𝑁𝑜𝑖𝑠𝑒 𝑥 = 𝛼𝑖 ∙ 𝑛𝑜𝑖𝑠𝑒 2𝑖 ∙ 𝑥

𝑁𝑜𝑐𝑡𝑎𝑣𝑒𝑠

𝑖=0

The system can combine multiple layers of different techniques to produce displacements or normal maps. This allows artist to create a specific ocean shape, like big waves with Gerstner, and control each wave parameter and combine with a random wave model to reduce tile effects. Moreover, the parameters can be changed in real-time using DirectX Shaders, and finally we can render it using OptiX.

Lighting and Rendering 4 The water shading uses a Fresnel approach to combine reflections and refractions, and also handle underwater fog and caustics. The real-time version uses reflection and refraction maps and the final OptiX version uses raytracing and adjust the reflections according surface normal. Finally we export the final image with multiple passes (normal, reflection, refraction, zdepth and others) for post processing.

1

10

100

1000

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Pro

cess

ing

Tim

e (m

s)

Layers

CPU 1 CPU 2 CPU 4 CUDA

Interface Final Scene

References [1] Hu, Y. et al., 2004. Realistic, Real-Time Rendering of Ocean Waves. Computer Animation and Virtual Worlds, 17(1), pp.59 - 67. [2] Asirvatham, A. & Hoppe, H., 2005. Terrain Rendering Using GP-Based Geometry Clipmaps. In GPU Gems 2. NVidia Corporation. pp.27-45. [3] Johanson, C., 2004. Real-time water rendering. MSc thesis. Lund University.