real-time wave acoustics for games nikunj raghuvanshi microsoft research

61
Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Post on 15-Jan-2016

221 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Real-time wave acoustics for games

Nikunj Raghuvanshi

Microsoft Research

Page 2: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Immersion

• Graphics has made leaps and bounds• Audio far behind: great potential

Image taken from: incrysis.com

Page 3: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Sound in games today• Manually tuned roll-off/occlusion/reverb filters

• Realism requires tedious labor• Reduces time for creativity

3

Page 4: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Physically-based sound• Physics

Perception automation control

• Use auditory perception compact, parametric models• realistic-sounding starting point• artistic control• quality-efficiency tradeoff

• More time for creative work

“Physically-based”

Page 5: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Sound Propagation (Acoustics)

• Sound waves propagate from source, complex interactions with boundary

• Diffraction, high-order reflection, scattering

Listener

Source

Page 6: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Sound Propagation

• Essential for immersion in acoustic spaces

• Physically complex, perceivable effects

Positive pressure Negative pressure

Page 7: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Diffraction

• Sound does NOT propagate in rays like light, it bends• So, you often hear what you don’t see• Low-frequencies bend more: occluders act as low-

pass filters

Light Sound

Page 8: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Scattering

Light Sound• Geometric details cause scattering: A furnished

room sounds very different from an empty one

Page 9: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Games today

Hand-tuned filters: difficult & tediousSimulated propagation → automatic, detailed, scene-dependent acoustics

Direct path muffledReflections muffled

Direct path muffledReflections clear

Direct path clearReflections muffled

Images: Dmitri Gait © 2003

Page 10: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Ray-based methods

• Beam-tracing [Funkhouser et. al. 2004]

• Ray frustum-tracing [Chandak et. al., 2008]

• Image-source method [Tsingos, 2009]

• Problems: diffraction/scattering, high-order reflections challenging

Page 11: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Our Approach

• Pre-computed wave simulation• attenuation behind obstructions, low-pass filtering• scattering from complex surfaces• realistic, scene-dependent reverb• works with “triangle-soup” scenes

• Pre-compute & render• scene geometry not needed at runtime

Page 12: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Comparison with Half Life 2TM

• “Train Station” scene• Our engine vs. game’s default sound engine

Page 13: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research
Page 14: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research
Page 15: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Pre-compute & Render

Impulse ResponseTime

Pre

ssure

Precompute

direct

reflected

Render

?

+=P

ress

ure

Time*

Convolution

Page 16: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Moving Source & Listener

Time

Pre

ssu

re

Page 17: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Moving Source & Listener

Time

Pre

ssu

re

Page 18: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Moving Source & Listener

Time

Pre

ssu

re

Page 19: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Moving Source & Listener

Time

Pre

ssu

re

Page 20: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Moving Source & Listener

Time

Pre

ssu

re

Page 21: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Main Challenge

• Acoustic responses vary spatially• 7D sampling space

• source (3D) x listener (3D) x time (1D)

• Can reduce to 6D• Restrict listener to 2.5D surface

• Brute-force sampling still infeasible

Page 22: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Brute-force sampling

• Scene: Half-Life 2’s Citadel (28m x 60m x 32m)• Simulation grid (12 cm)• Direct storage:

200,000 GB

Page 23: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Main ideas

• Compact representation for acoustic impulse responses• works well with wave simulations

• Spatial interpolation allowing coarse (~1m) grid

• Real-time wave effects• automatic correspondence to scene geometry

Page 24: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Our approach: Overview

Source locations

Listener locations

~ 1-2 meters

Page 25: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Wave Simulation

Response (Listener at source location)

Encode this compactly

• Simulator: ARD [Raghuvanshi et. al., 2009]

• Fast and memory-efficient• Input:

• scene geometry (triangle mesh)• acoustic material properties

Source pulse

Positive pressure Negative pressure

Page 26: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Psycho-acoustics

Time

Pre

ssure

Early Reflections

Late Reverberation

• Direct Sound: sense of direction• Early Reflections: loudness, timbre; spatial variation; ~100 ms• Late Reverberation: decay envelope; no spatial variation; few

seconds Reference: “Room Acoustics” by Heinrich Kuttruff

Page 27: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Demo

• Perceptual effect• Only Direct sound• Direct + Early Reflections• Direct + Early Reflections + Late Reverberation

Page 28: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research
Page 29: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

TimePre

ssure

Record response

Probe Source

Listener

Technique: Wave Simulation

Page 30: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Early Reflections (ER)

Late Reverberation (LR)

Early Reflections / Late Reverb

• Automatic separation: echo density (500 peaks/sec)

• single late reverb filter per room: room-dependent reverb

• early reflection sampled on a grid within room

Store one per room

Peak Detection

TimePre

ssure

Page 31: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Store ,[Peak times and amplitudes

Frequency trend

ER Representation

Early Reflections (ER)

Late Reverberation (LR)

captures reflection/diffraction strengths and delays

captures spectral effects(low-pass filtering etc.)

TimePre

ssure

]

Page 32: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Runtime: Spatial Interpolation

Time

Pre

ssur

e

P1

P2

P2

Time

Pre

ssure

P1

Ours

Time

Pre

ssure

Linear

Time

Pre

ssure

peak aliasing

no aliasing

?P1 P2

Page 33: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Runtime: Audio Engine

Game EngineAudio Engine

source

listener

Source position

Listener position

Impulse Response

InterpolatedEarly

reflection

RoomLate reverb+

Source sound

*Convolve

Output

Page 34: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Results: Citadel Walkthrough

• Game environment from Half Life 2TM

• Size: 60m x 28m x 22m

Page 35: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research
Page 36: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Results: Walkway

• Size: 19m x 19m x 8m• Realistic attenuation behind walls

Page 37: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research
Page 38: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Results: Walkway

• Sound focusing • Loudness increases beneath concave reflector

Page 39: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research
Page 40: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Results: Living Room

• Empty vs. furnished living room

• Scattering off furnishings changes acoustics

Page 41: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research
Page 42: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research
Page 43: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Integration with Half Life 2TM

• Train Station scene: 36m x 83m x 32m

Page 44: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research
Page 45: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Cost

• Run-time: ~5% of a core per source• Reduce further: partitioned convolution

• Memory: <100 MB – current work to reduce to <10 MB

• Pre-compute: few minutes per source location, few hours per scene

• Reference processor: 2.8GHz Quad-core Intel Xeon

Page 46: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Summary

• First real-time wave-based sound propagation engine• Automatic diffraction, occlusion/obstruction, late

reverberation, focusing, in complex 3D scenes

• Moving sources and listener

Page 47: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Future Work

• Need further 10x reduction in memory: ~5 MB footprint• spatial compression

• adaptive sampling

• Dynamic geometry could be added• Pre-computed frequency-dependent occlusion factors

• Integration with existing audio middleware

Page 48: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Conclusion

• Wave acoustics for games• automatic scene-dependent roll-off, obstructions,

focusing, reverb etc., depending on source/listener location

• Physically-based techniques are a powerful way to deal with game sounds• automation for the tedious part of audio design

Page 49: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Acknowledgements

• Collaborators: • Ming C. Lin, UNC Chapel Hill• John Snyder, Microsoft Research• Naga K. Govindaraju, Microsoft• Ravish Mehra, UNC Chapel Hill• Kristofor Mellroth, Microsoft Game Studios

Page 50: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Thank you!! Questions?

• http://research.microsoft.com/people/nikunjr/• Papers, demos etc.

[email protected]

Page 51: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research
Page 52: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

State-of-the-art: Games

Image © Dmitry Gait 2003

Occlusion

Obstruction

Exclusion

Hand-tuned filters: tediousSimulated propagation → automatic, detailed scene-dependent acoustics

Page 53: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Technique: Peak Detection

• search for local extrema• extract peak delays and amplitudes• wide-band information

Page 54: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Early Reflections (ER) Late Reverberation (LR)

Time Frequency

Technique: Frequency Trend Extraction

Band-limitedFFT

Page 55: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

FFT

Technique: Frequency Trend Extraction

• peak data does not capture downward trend (diffraction)

Early Reflections (ER) Late Reverberation (LR)

Time Frequency

FFT

Page 56: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

FFTDivide

Frequency trend

Extrapolated

Technique: Frequency Trend Extraction

Early Reflections (ER) Late Reverberation (LR)

Time Frequency

FFT

Page 57: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

FFTDivide

Store ,[ ]Peak times and amplitudes Frequency trendExtrapolated

Technique: ER Representation

Early Reflections (ER) Late Reverberation (LR)

Time Frequency

FFT

Page 58: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Peak Detection

• search for local extrema• extract peak delays and amplitudes – captures

reflection/diffraction strength and delay

Page 59: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

impulse response interpolation

Runtime: Spatial Interpolation

listenersource

Page 60: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Applying the acoustic response

• Convolve source sound with response• Need fast convolution• Fast frequency-domain convolutions

• bottleneck: FFT• need a frequency-domain audio pipeline• no need to access scene geometry at runtime

Page 61: Real-time wave acoustics for games Nikunj Raghuvanshi Microsoft Research

Propagation EnginePe

r Ear

.FFT

IFFTOutput

Short FFT

Pre-baked

Input

ER

LR

Frequency Trend

. + +

Source 2Source n

: element-wise multiplication

.: element-wise sum+