NVIDIA TURF EFFECTS: MASSIVE GRASS RENDERING WITH DYNAMIC SIMULATION - - PowerPoint PPT Presentation

nvidia turf effects
SMART_READER_LITE
LIVE PREVIEW

NVIDIA TURF EFFECTS: MASSIVE GRASS RENDERING WITH DYNAMIC SIMULATION - - PowerPoint PPT Presentation

NVIDIA TURF EFFECTS: MASSIVE GRASS RENDERING WITH DYNAMIC SIMULATION EVGENY MAKAROV , DEVTECH NVIDIA OUTLINE Real-time grass rendering Turf Effects: grass rendering Turf Effects: dynamic simulation Grass authoring Q&A REAL-TIME GRASS


slide-1
SLIDE 1

EVGENY MAKAROV , DEVTECH NVIDIA

NVIDIA TURF EFFECTS:

MASSIVE GRASS RENDERING WITH DYNAMIC SIMULATION

slide-2
SLIDE 2

OUTLINE

Real-time grass rendering Turf Effects: grass rendering Turf Effects: dynamic simulation Grass authoring Q&A

slide-3
SLIDE 3

REAL-TIME GRASS RENDERING

slide-4
SLIDE 4

PARTICLE BASED GRASS

Billboards Grass objects

Top view

slide-5
SLIDE 5

PARTICLE BASED GRASS

Pros

Good density Plausible rendering results Good performance

Cons

View dependent Complicated physical interaction

slide-6
SLIDE 6

GEOMETRY BASED GRASS

slide-7
SLIDE 7

GEOMETRY BASED GRASS

slide-8
SLIDE 8

GEOMETRY BASED GRASS

Pros

High density Looks good at any scale Simplified physical interaction Two-sided lighting and self-shadowing

Cons

High rendering complexity

slide-9
SLIDE 9

TURF EFFECTS: GEOMETRY BASED GRASS

slide-10
SLIDE 10

BREAK GRASS INTO A SET OF PATCHES

slide-11
SLIDE 11

RENDERING A GRASS BLADE +

Vertex shader Hull shader Domain shader u v (u1,v1)

slide-12
SLIDE 12

PATCH INITIALIZATION

Application provides a set of seed points Seed point

Position Expansion Asset ID u v 1

slide-13
SLIDE 13

SEED PARAMETERS

Bunching (radial alignment) Dispersal (coverage radius) LOW HIGH

slide-14
SLIDE 14

GRASS PATCH RENDERING

Build a list of visible patches Library renders data for a single asset type at once Render PatchesNum * AssetsNum  Need to minimize API state changes

Use single API call per patch per asset  for (n = 0; n < patchPerAssetCount; n++)

DrawInstanced(…, patchID);

~18.0 millions DrawInstanced() calls/sec*

* i7 4770K 3.5GHz, GeForce GTX 960 driver 347.52

slide-15
SLIDE 15

OCCLUSION CULLING

Per patch occlusion culling on GPU Use application provided depth with occluders information Rasterize per patch conservative boundary boxes with read-only depth

k j i OCCLUDER k i

slide-16
SLIDE 16

OCCLUSION CULLING

void DrawInstanced( UINT VertexCountPerInstance, UINT InstanceCount, UINT StartVertexLocation, UINT StartInstanceLocation );

… …

k

… …

i

. . .

k+1 k-1

. . . … k i . . . 1 1

slide-17
SLIDE 17

RENDERING WITH OCCLUSION CULLING

Per asset:

Write per patch blade count Call DrawInstancedIndirect() to render each patch

Culled patches would still issue draw calls on CPU

slide-18
SLIDE 18

VARYING DENSITY

Reduce blade count for distant patches Analytically defined Use fixed number of discrete LODs with smooth transitions

1 distance density level 0 level 1 level 2 d

slide-19
SLIDE 19

VARYING DENSITY

slide-20
SLIDE 20

VARYING DENSITY

Close up patch view Distant patch view (<10% of original blades)

slide-21
SLIDE 21

DYNAMIC SIMULATION

Grass interacts with dynamic scene objects

slide-22
SLIDE 22

DYNAMIC SIMULATION (2)

Simulate collision with per-blade control points Use mass-spring model

F2 F1 m1 m2

slide-23
SLIDE 23

EXTERNAL FORCES

slide-24
SLIDE 24

EXTERNAL FORCES

RENDER VOLUME

slide-25
SLIDE 25

EXTERNAL FORCES

RENDER VOLUME

slide-26
SLIDE 26

EXTERNAL FORCES

F = kΔ Δ v Fcombined

slide-27
SLIDE 27
slide-28
SLIDE 28

DYNAMIC SIMULATION

slide-29
SLIDE 29

SIMUALTION SUMMARY

Encode dynamic objects in a form of deformation heightfield

Patch-space distance to occluder Per-pixel movement speed

Landscape is also a heightfield Per asset simulation parameters

Stiffness Restitution

Do not resolve collisions between individual grass blades

slide-30
SLIDE 30

GRASS AUTHORING

Seed parameters

Control blades distribution

Asset parameters

Control individual blade look

slide-31
SLIDE 31

ASSET PARAMETERS

Width

float4(w0, w1, w2, w3)

Tip Root w3 w2 w1 w0 (1,1,1,1) (1,1,1,0) (0,1,1,1)

slide-32
SLIDE 32

VARYING SMOOTHNESS

slide-33
SLIDE 33

ASSET PARAMETERS (2)

Edge offset Density falloff Shape variations

A set of “barebones” used for particular grass type

2 user-defined CPs 3 user-defined CPs

slide-34
SLIDE 34

SUMMARY

Turf Effects: real-time grass simulation and rendering Currently uses tessellation (D3D 11.0 or OpenGL 4.0) Can rely on existing content

Convert existing particle-based grass into geometry

slide-35
SLIDE 35

Q&A

slide-36
SLIDE 36

THANK YOU