BRINGING WAVEWORKS ONLINE TIM TCHEBLOKOV, SR DEVELOPER TECHNOLOGY - - PowerPoint PPT Presentation

bringing waveworks online
SMART_READER_LITE
LIVE PREVIEW

BRINGING WAVEWORKS ONLINE TIM TCHEBLOKOV, SR DEVELOPER TECHNOLOGY - - PowerPoint PPT Presentation

WAR THUNDER: BRINGING WAVEWORKS ONLINE TIM TCHEBLOKOV, SR DEVELOPER TECHNOLOGY ENGINEER, NVIDIA WAR THUNDER Ground and Air forces combat simulator Tank mode: Shooter-like level of details Features/detail size of 2-3cm WAR THUNDER


slide-1
SLIDE 1

TIM TCHEBLOKOV, SR DEVELOPER TECHNOLOGY ENGINEER, NVIDIA

WAR THUNDER: BRINGING WAVEWORKS ONLINE

slide-2
SLIDE 2

WAR THUNDER

Ground and Air forces combat simulator Tank mode: Shooter-like level of details Features/detail size

  • f 2-3cm
slide-3
SLIDE 3

WAR THUNDER

Destroyed by tank, revenge with bomber! Air combat simulator level of details Realistic LOS, up to 160 km Features/detail size of several kilometers

slide-4
SLIDE 4

WAR THUNDER

War Thunder is Free To Play MMO game Unlike premium games, people pay only if they like the game You should be running fast and look great

  • n any PC
slide-5
SLIDE 5

WAR THUNDER

PS4, DX11, DX9, GL, GLES Windows, Mac, Linux, Mobile, Consoles Toasters to Titans

slide-6
SLIDE 6

WAR THUNDER

Permanent engine improvements New effects Performance tweaks Water tech lacked progress Need new water tech!

slide-7
SLIDE 7

WHAT WAVEWORKS CAN OFFER?

Simulation in frequency domain, iFFT to spatial domain No repeats! 3D displacements & normals Energy based foam Readbacks for physics Textures as results

iFFT 5m 1km

slide-8
SLIDE 8

WHAT WAVEWORKS CAN OFFER?

Simulation in frequency domain, iFFT to spatial domain No repeats! 3D displacements & normals Energy based foam Readbacks for physics Textures as results

1km x 1km

slide-9
SLIDE 9

WAVEWORKS IN WAR THUNDER

Rendering

WaveWorks brings new look to the water Able to reuse existing features

One man-week for basic integration

Reflection Refraction Shadows Atmospherics + Displacements Surface foam Bubbles Scattering

slide-10
SLIDE 10

WAVEWORKS IN WAR THUNDER

Rendering

WaveWorks brings new look to the water Able to reuse existing features

One man-week for basic integration Water must be interactive

Challenge for simulation!

1km x 1km

Reflection Refraction Shadows Atmospherics + Displacements Surface foam Bubbles Scattering

slide-11
SLIDE 11

CHALLENGES: SIMULATION

As fast as possible, High-End PCs down to toasters

WaveWorks: CUDA, DC and CPU simulation Gaijin: added GPU simulation support for some other platforms

Same physics for every player

Physics vs Graphics

Interaction with the world:

Displacements for vessels and hydroplanes Raycasts for planes and projectiles Shores, Rivers, Lakes

slide-12
SLIDE 12

CHALLENGES: SIMULATION

Simulation for physics runs on CPU

Ensure same physics for everybody Server + each client Fixed timestep, 48 ticks/second

Simulation for graphics runs on CPU or GPU

Prefer GPU if possible Client only Variable timestep, each frame

slide-13
SLIDE 13

CHALLENGES: SIMULATION

Large sized FFT is expensive for CPU!

Physics: 128x128 Graphics: up to 512*512

Close enough!

< 5 cm discrepancy @ 3m amplitude 512x512 256x256 128x128

slide-14
SLIDE 14

SIMULATION: READBACKS

3D displacements, not heightmap

Fast! 900 results in <1msec

Ideal for floating objects

Reabacks on hulls Inertia and drag

Does not work for projectiles!

slide-15
SLIDE 15

SIMULATION: RAYCASTS

Can’t do triangle/ray tests! Successive approximation using a number of readbacks

Up to ~2000 projectiles in flight

slide-16
SLIDE 16

We need readbacks for in-game physics! DirectX11: no stalls OpenGL: PBO is expected to give access to GPU data without stall. Some drivers do introduce stall DirectX9: GPU readbacks always introduce stall Avoid readbacks by performing simulation on CPU!

CHALLENGES: GPU READBACKS

slide-17
SLIDE 17

A lot of textures are fetched in both Vertex and Pixel Shaders:

Reflection Refraction Shoreline Foam Depth Shadows Atmospherics etc…

At least 15 samplers in PS plus 6 in VS

CHALLENGES: API LIMITATIONS

slide-18
SLIDE 18

OpenGL: many implementations do not follow specification

For instance, you can’t use more than 16 samplers per program on many drivers

Use Texture Arrays instead

Texture Arrays support added to WaveWorks

DirectX9: No support for Texture Arrays

Degrade quality of displacements on DX9

CHALLENGES: API LIMITATIONS

slide-19
SLIDE 19

INTERACTION: SHORES, RIVERS, LAKES

Nature: Shore waves appear in shallow areas Mostly parallel to the shore

slide-20
SLIDE 20

INTERACTION: SHORES, RIVERS, LAKES

Distance Field

Distance to shore as phase for waves

DF done on GPU

  • n loading the location

4k*4k for 65km*65km world

RGBA8 texture:

R: Depth G: Distance to shore B,A: DF gradient

Depth Distance

slide-21
SLIDE 21

INTERACTION: SHORES, RIVERS, LAKES

Nature: Rivers and lakes

No shore waves No ocean waves

Depth Distance

slide-22
SLIDE 22

INTERACTION: SHORES, RIVERS, LAKES

Nature: Terrain is obstacle for wind & ocean waves

Smaller shore waves Smaller ocean waves

Depth Distance

Wind Downwind area

slide-23
SLIDE 23

INTERACTION: SHORES, RIVERS, LAKES

How much the terrain is obstacle for waves?

Sample range of directions 1 (terrain) / 0 (water) Sum -> [0..1]

Large texels -> blurred Wind

slide-24
SLIDE 24

INTERACTION: SHORES, RIVERS, LAKES

Downwind data

A measure of “openness” Smaller ocean/shore waves No ocean/shore waves in rivers and lakes!

Rivers and lakes get proper “openness” automatically

slide-25
SLIDE 25

SHORE WAVES

Gerstner waves

Shore waves amplitude depends on ocean waves amplitude Normals calculated analytically Sawtooth for foam

slide-26
SLIDE 26

SHORE WAVES

Gerstner waves

Shore waves amplitude depends on ocean waves amplitude Normals calculated analytically Sawtooth for foam

slide-27
SLIDE 27

SHORE WAVES

Scale waves according to depth Move wave tops forward

Seabed drag

slide-28
SLIDE 28

SHORE WAVES

Scale waves according to depth Move wave tops forward

Seabed drag

slide-29
SLIDE 29

SHORE WAVES

Break regularity

Add noise Apply energy loss

slide-30
SLIDE 30

SHORE WAVES

Break regularity

Add noise Apply energy loss

slide-31
SLIDE 31

SHORE WAVES

Terrain shading

Sand becomes wet and reflective Water and foam roll back

slide-32
SLIDE 32

SHORE WAVES

Distant view

slide-33
SLIDE 33

RENDERING PERFORMANCE

Aggressive LODs for everything:

Close up Mid range At distance

Displacements and normals All cascades Some cascades Largest cascade Water geometry Dense grid Coarse grid Flat quad Refractions Distorted Simple None Reflections Distorted Blurred Blurred Shore interaction Full Full Normals + Foam Wakes & splashes Full Normals only Normals only Light scattering Yes Yes No

slide-34
SLIDE 34

Basic WaveWorks integration: extremely easy! War Thunder specific:

MMO: physics runs in parallel on CPU Shores, rivers and lakes Texture arrays Raycasts

developer.nvidia.com/waveworks

SUMMARY

slide-35
SLIDE 35

THANK YOU

TTCHEBLOKOV@NVIDIA.COM