directx11最新 リアルタイム映像事例集

83
DirectX11最新 リアルタイム映像事例集 1 © 2011 SQUARE ENIX CO., LTD. All rights reserved. Oct. 8, 2011

Upload: others

Post on 29-Nov-2021

11 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: DirectX11最新 リアルタイム映像事例集

DirectX11最新リアルタイム映像事例集

1© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 2: DirectX11最新 リアルタイム映像事例集

Philosophy

• Motivation: Movie Quality in Real-Time

• Approach: DX11 latest features

Remi Ivan Iwata

Tech Art

2© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 3: DirectX11最新 リアルタイム映像事例集

Agenda

• Tessellation– Displacement mapping– Subdivision (ACC)– Creases– Performance & Scalability– Problems– Non-surface tessellation

(hairs)

• Compute Shader– Cloth– Particles

• Other– Reflection

DirectX 11 new features

3© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 4: DirectX11最新 リアルタイム映像事例集

PART 1TESSELLATION

4© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 5: DirectX11最新 リアルタイム映像事例集

Motivation

A scalable tech to render & animate

wide range of high quality surfaces

Both sharp and smooth details!

5© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 6: DirectX11最新 リアルタイム映像事例集

Concept

take a polygon and dice it

into smaller pieces

…but: flat surfaces remains flat

6© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 7: DirectX11最新 リアルタイム映像事例集

Can use displacement procedures to create high resolution surfaces:

– Data-Sampling

– Procedural

Refinement schemes

Procedural smoothing

Displacementmapping

tessellation

7© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 8: DirectX11最新 リアルタイム映像事例集

DX11 pipeline

HullShader

TesselatorDomainShader

GeometryShader

VertexShader

制御点

PixelShader

Tessellation stages

8© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 9: DirectX11最新 リアルタイム映像事例集

Basic pipeline

9© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

HS Tesselator DS PS

Displacementmap

Diffusetexture

Normalmap

VS

制御点

Page 10: DirectX11最新 リアルタイム映像事例集

Basic pipeline

10© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

HS Tesselator DS PS

Displacementmap

Diffusetexture

Normalmap

VS

•Vertex Shader- Skinning, blendshape

制御点

Page 11: DirectX11最新 リアルタイム映像事例集

Basic pipeline

11© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

HS Tesselator DS PS

Displacementmap

Diffusetexture

Normalmap

VS

•Hull Shader-New primitive type : patch-Conversion from one surface type to another(e.g. subdivision surface to bezier patches)

-Tessellation factors per patch-Runs once per control point

制御点

Page 12: DirectX11最新 リアルタイム映像事例集

Basic pipeline

12© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

HS Tesselator DS PS

Displacementmap

Diffusetexture

Normalmap

VS

•Tessellator-Generate new vertices based on TessFactor

制御点

Page 13: DirectX11最新 リアルタイム映像事例集

Basic pipeline

13© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

HS Tesselator DS PS

Displacementmap

Diffusetexture

Normalmap

VS

•Domain Shader-One invocation per vertex-Evaluate surface given UV coordinates-Apply displacements

制御点

Page 14: DirectX11最新 リアルタイム映像事例集

Basic pipeline

14© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

HS Tesselator DS PS

Displacementmap

Diffusetexture

Normalmap

VS

•Pixel Shader- Lighting

制御点

Page 15: DirectX11最新 リアルタイム映像事例集

“Smoothing” Schemes= procedural displacements

Procedural smoothing

15© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 16: DirectX11最新 リアルタイム映像事例集

Local schemes

• Use local vertex info

– (PN-Triangles, Phong tessellation, etc…)

• Merit

– Easy to implement

• Problems

– No guarantees on higher level continuity

– Is limited in the amount of curvature

16© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 17: DirectX11最新 リアルタイム映像事例集

Subdivision

•Global scheme = depends on the surrounding vertices•Subdivision surface(細分割曲面) =

the limit of successive refinements

•History-3D surface subdivision dates back to 1978-Used for ages in the Movie Industry

17© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Geri’s Game (1989) : Pixar Animation Studios

…But it was not real time until now !

Page 18: DirectX11最新 リアルタイム映像事例集

Our Choice

• Many “smoothing” Schemes exist:

– Catmul Clark (Pixar, Maya)

– Doo Sabin

– Loop

– Butterfly – Nira Dyn

– Etc…

•Our choice: ACC [Loop & Schaefer]-Approximating Catmull-Clark Subdivision Surfaces with Bicubic Patches-Catmull Clark is what all tools are using !

18© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

From [Loop & Schaefer]

Page 19: DirectX11最新 リアルタイム映像事例集

References

A good survey of local refinement schemes

Tianyun Ni, Ignacio Casta no, Jörg Peters, Jason Mitchell, Philip Schneider, and Vivek Verma. Efficient substitutes for subdivision surfaces. In ACM SIGGRAPH Courses, pages 1–107, 2009.

A good introduction to subdivision surfaces

D. Zorin, P. Schröder, A. Levin, L. Kobbelt, W. Sweldens, and T. DeRose. Course Notes Subdivision for Modeling and Animation. In ACM SIGGRAPH, 2000

ACC “Approximating Catmull-Clark Subdivision Surface with BicubicPatches” by Charles Loop and Scott Schaefer, ACM Transactions on Graphics, Vol. 27 No. 1 Article 8 March 2008.

ACC(gregorypatches)

“Approximating Subdivision Surface with Gregory Patches for hardware Tessellation” by Charles Loop, Scott Schaefer, TianyunNi, Ignacio Castano, Siggraph Asia 2009.

19© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 20: DirectX11最新 リアルタイム映像事例集

ACC principle

• Principle:– Use Bezier patches to approximate Catmull-Clark surface

– Shape of patches depends on control points

• 3 Types: Corner / Edge / Interior

– For each quad construct a geometry patch and tangent patches

00b

20b

30b

10b

31b

13b

01b 02b 03b

21b 22b

12b11b

23b

32b 33b

20© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

corner

edge

interior

Page 21: DirectX11最新 リアルタイム映像事例集

• Geometry patches– For each patch, control points are calculated from surrounding

vertices as a weighted average using weight masks

– (almost) smooth everywhere

00b

20b

30b

10b

31b

13b

01b 02b 03b

21b 22b

12b11b

23b

32b 33b

ACC principle

Control points Weight masks

21© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 22: DirectX11最新 リアルタイム映像事例集

(From Loop & Schaefer )

Geometry patch only

Geometry + tangent

(almost) smooth everywhere ?!

22© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

• Patches are not smooth along edges leading to an extraordinary vertex !

• Tangent patches

– Produce a continuous normal field

– Make the patch surface appear smooth

Page 23: DirectX11最新 リアルタイム映像事例集

Basic ACC Result

23© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 24: DirectX11最新 リアルタイム映像事例集

Displacement mapping(=displacement based on data sampling)

Displacementmapping

24© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 25: DirectX11最新 リアルタイム映像事例集

Concept

Vertex position += normal * height from texture

25© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 26: DirectX11最新 リアルタイム映像事例集

Example

- Nice silhouette- Workflow: similar to normal map

+Disp. map: 940KBModel: 790 quads

26© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 27: DirectX11最新 リアルタイム映像事例集

Results

27© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 28: DirectX11最新 リアルタイム映像事例集

“Vector”Displacement

- Vertex position += 3D info from texture

- Overhangs are possible !

28© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 29: DirectX11最新 リアルタイム映像事例集

Example

+ =

=+

29© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Nice but Memory intensive !

16MB

Page 30: DirectX11最新 リアルタイム映像事例集

Results

30© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 31: DirectX11最新 リアルタイム映像事例集

Tests:performance& scalability

31© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 32: DirectX11最新 リアルタイム映像事例集

Use tessellation + diffuse texture + displacement map + normal map

No tessellation TessFactor=1 TessFactor=2 TessFactor=4 TessFactor=8 TessFactor=16 TessFactor=32

geom. + diffuse tex

Model Quads

NB

Screen QuadN

bmicros

ec

Screen QuadN

bmicros

ec

Screen QuadN

bmicros

ec

Screen QuadN

bmicros

ec

Screen QuadN

bmicros

ec

Screen QuadN

bmicros

ec

Screen QuadN

bmicros

ec

1 1 183 1 185 4 185 16 197 64 196 256 196 1024 203

100 100 197 100 195 400 203 1600 209 6400 258 25600 352 102400 791

250 250 189 250 197 1000 205 4000 237 16000 305 64000 503 256000 1651

500 500 194 500 203 2000 216 8000 260 32000 364 128000 882 512000 3359

750 750 195 750 207 3000 224 12000 277 48000 422 192000 1294 768000 4955

1000 1000 198 1000 219 4000 244 16000 304 64000 522 256000 1690102400

0 6459

2000 2000 203 2000 230 8000 267 32000 359 128000 910 512000 3299

4000 4000 220 4000 278 16000 334 64000 573 256000 1809102400

0 6621

8000 8000 275 8000 317 32000 395 128000 821 512000 3535

10000 10000 284 10000 348 40000 456 160000 1359 640000 4429

16000 16000 296 16000 475 64000 661 256000 2127102400

0 6980

20000 20000 304 20000 563 80000 793 320000 2656

30000 30000 326 30000 784 120000 1116 480000 3975

40000 40000 345 40000 1001 160000 1439 640000 5285

60000 60000 383 60000 1418 240000 2074

80000 80000 415 80000 1797 320000 2670

120000 120000 556 120000 2550 480000 3799

160000 160000 735 160000 3232

200000 200000 916

300000 300000 1364

GPU Performance

• GPU Time (NSight)

• Model: Static “grid” mesh

• Results:

– Complex shader = slow

– Tessellation has overhead

• TessFactor=1 bad!

– faster to display the high-res model

32© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 33: DirectX11最新 リアルタイム映像事例集

How not to use Tessellation• Add local relief details on a static object ?

- Naïve tessellation = bad idea

- at least use a density map to avoid waste…

Original high-def model(Maya) Simplified model with tess. & disp.

33© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 34: DirectX11最新 リアルタイム映像事例集

Adaptive Tessellation

•LOD algorithm can run on GPU

•Patch-level LOD

– Detail-density maps

– Distance of patch to camera

– Orientation of patch to camera

– Screen-space size of patch

– Frustum culling(tessFactor=0)

34© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 35: DirectX11最新 リアルタイム映像事例集

Video

35© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 36: DirectX11最新 リアルタイム映像事例集

+=

Poly Memory Performance(static)

Performance(animated)

High Res 40,000 triangles

10,936 KB 378 fps 265fps

Low Res +Disp Map +ACC

2,544 quads

628 KB +223 KB =851 KB

410 fps 290fps

Not yet optimized !

How to use Tessellation

• Model: artist-created skinned mesh

• Test: – High-Res model vs. ACC + Disp. Map

– Similar visual quality

36© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Faster rendering using less space !

GeForce GTX 460

Page 37: DirectX11最新 リアルタイム映像事例集

Animated Mesh : Result

37© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 38: DirectX11最新 リアルタイム映像事例集

How to improve ACC?

38© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 39: DirectX11最新 リアルタイム映像事例集

ACC is too smooth

• How to express hard creases?

?

39© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 40: DirectX11最新 リアルタイム映像事例集

Various methods

Artifacts.. memory Hard to use.. Not very scale-able..

Displacement Patches Add polygons

40© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 41: DirectX11最新 リアルタイム映像事例集

Solution = Creasing

• Give a “weight” to edges

• Possible to control “sharpness”

• Used in Maya

none partial full

41© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 42: DirectX11最新 リアルタイム映像事例集

Crease algorithm

•Offline: give a weight to creased edges•Hull Shader:

for each control point, get the 3 highest crease values of incoming edges: C1 > C2 > C3

•(C1=C2=C3=0)no crease, usual ACC equation

•(C1>0 , C2=C3=0)1 creased edge. Corner does not move. Only edge points.

•(C1>0, C2 >0, C3=0) 2 creased edges. Corner converges to plan defined by these edges

•(C3>0)more than 3 creases. Corner converges to original corner

00b

20b

30b

10b

31b

13b

01b 02b 03b

21b 22b

12b11b

23b

32b 33b

n^2 + A*C2 + C3

4 * (min(C2 , CREASE +1)

2n * (CREASE + 1)

4 * (CREASE + 1)

42© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 43: DirectX11最新 リアルタイム映像事例集

• When creasing :

– Have to keep the normals coherent with geometric changes

– LERP between original normals and ACC normals

Crease Implementation

43© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 44: DirectX11最新 リアルタイム映像事例集

Results

• Merits

– Easy to produce intermediary shapes

– No need to change topology

• Demerit

– Heavy

– Need to preprocess edges

– No perfect match with Maya

44© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 45: DirectX11最新 リアルタイム映像事例集

Crease: Results

45© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 46: DirectX11最新 リアルタイム映像事例集

Problems & Difficulties

46© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 47: DirectX11最新 リアルタイム映像事例集

Basic Problems & Difficulties

• Difficult to debug huge shaders– Output normal field or barycentric

coordinates as color

• We don’t use only vertex data, but a whole neighborhood ring

• Have to keep all calculus on patches symmetrical

crack

subdivide

47© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 48: DirectX11最新 リアルタイム映像事例集

Displacement cracks

• Discontinuities

- Displacing with disjoint normals

- Different displacement values

- Texture Seam / Sampling error- Solution: insure you use the same UV on both sides of edges

48© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 49: DirectX11最新 リアルタイム映像事例集

Tangent Field

• Discontinuities in the tangent field -> Cracks or artifacts !

• Our solution

– Preprocess the mesh to create a continuous tangent field

– detect singularities and avoid displacement at those points

discontinuity singularity

49© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 50: DirectX11最新 リアルタイム映像事例集

Minification aliasing

• Problem

– Low-frequency sampling of high frequency texture

– Change tessellation on a displaced mesh = shimmering

High freq data (disp. map)

Low freq sampling(vertices)

?

Interesting blogto check out

The problem with tessellation in DirectX 11 Posted by Sebastian Sylvan http://sebastiansylvan.wordpress.com/

Mip-mapped texture

vertices

• Solution

– Use mip-mapping

50© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 51: DirectX11最新 リアルタイム映像事例集

Bulging

• Bulging on mesh tips when height-displacing with ACC

51© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 52: DirectX11最新 リアルタイム映像事例集

Non-surface tessellation(lines)

52© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 53: DirectX11最新 リアルタイム映像事例集

Hairs

• Sarah Tariq @ Nvidia methodNVIDIA Real Time Hair Presentations at Siggraph 2008

http://www.nvidia.com/object/siggraph-2008-hair.html

- Tessellation on isolines

- Create large amount of hairs (10,000+)

- Heavy

53© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 54: DirectX11最新 リアルタイム映像事例集

Results

54© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 55: DirectX11最新 リアルタイム映像事例集

55© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 56: DirectX11最新 リアルタイム映像事例集

Impressions on Tessellation

56© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 57: DirectX11最新 リアルタイム映像事例集

A lot of merits…

• Performance

- Faster animation with less data

• Scalability

- Expand on-demand on GPU

• Visual Quality

- Perfect smoothness

- Accurate silhouette

- Proper occlusion & shadow

• Simpler pipeline

– subdivide & sculpt!Subdivide,

Sculpt

displaced

Normal mapped

57© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 58: DirectX11最新 リアルタイム映像事例集

… and a few “buts”

• ACC is heavy and needs preprocessing

• Need to find a balance

• Too much tessellation is bad

• Too few tessellation is a waste

58© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 59: DirectX11最新 リアルタイム映像事例集

Will likely use the tech:- For animation (cloth, facial, transformation effects)- When seamless LOD is necessary

• Keep the shaders as simple as possible

• Topology matters

• Communicate a lot with the artist

- E.g. Ask for quad-only models if you use ACC

Advice

Page 60: DirectX11最新 リアルタイム映像事例集

Present & Future work

• Asset from artist

– Hi-Res Movie Quality Asset (e.g. Cloth)

– Mesh Reduction & Baked vertex animation (Maya) Hi Res

ModelLow ResModel

• Real-time framework– ACC only

– Even Higher-resolution mesh on screen !

60© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 61: DirectX11最新 リアルタイム映像事例集

61© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Baked vertex animation Result

Page 62: DirectX11最新 リアルタイム映像事例集

PART 2COMPUTE SHADER

62© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 63: DirectX11最新 リアルタイム映像事例集

•Structured buffers•shared memory between threads•Un-ordered I/O operations•Atomic operations

Application has control over dispatching and synchronization of threads

More general algorithms, beyond shading

Compute Shader Features

63© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 64: DirectX11最新 リアルタイム映像事例集

CS applicationsCurrently under investigation

• Image processing

- Post-effect, convolution, SSS, etc…

• Simulation

- Cloth

- Particles

• Real-time global illumination

64© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 65: DirectX11最新 リアルタイム映像事例集

• CS merits– Easy to use

– Flexible (not limited to graphics)

– Can provide nice optimizations

• CS demerits– So many things to do: tiled-rendering, SSAO, DOF,

Soft bodies, AI, Etc…

Compute Shaders: Impressions

“Efficient Compute Shader programming”Bill Bilodeau, AMD (developer.amd.com)

65© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 66: DirectX11最新 リアルタイム映像事例集

Cloth Simulation

66© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 67: DirectX11最新 リアルタイム映像事例集

Basic approach

• Cloth is modeled as a set of particles

• Each particle is subject to:

– External forces: gravity, wind,..

– Internal “spring” constraints

– collision constraints

67© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 68: DirectX11最新 リアルタイム映像事例集

• Verlet integration of particles’ motionnewx = x + (x – oldx)*damping + a*dt*dt

• Not always accurate, but stable!

• Constraints solved by relaxation, using a given number of iterations.

Basic approach

“Cloth Simulation, White Paper”. NVidia

“OpenCL Cloth Simulation in the Bullet Physics SDK“ [Lee Howes] AMD

68© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 69: DirectX11最新 リアルタイム映像事例集

Results

• Physical simulation at 30Hz

• rendering with ACC

– 40x40 cloth & TessFactor=8 > 40*40*64 = 102,400 quads on screen

– 200+ fps

69© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 70: DirectX11最新 リアルタイム映像事例集

70© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 71: DirectX11最新 リアルタイム映像事例集

Particlesパーティクル

71© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 72: DirectX11最新 リアルタイム映像事例集

Next generation particle system次世代のパーティクル・システム

• Goal– 100 000 particles and more– very small particles– Update, create geometry

on GPU– Self-shadowing and

scattering

• Challenges– Random numbers on GPU– Fast sorting

72© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

• 目標– 10万個以上– 極めて小さい– GPUでアップデートとジオメトリの生成

– セルフシャドウ+スカッタリング

• 挑戦– GPU上での乱数– 速いソート

Page 73: DirectX11最新 リアルタイム映像事例集

Our solution我々のソリューション

• Random numbers on GPU:– Tiny Encryption Algorithm

[Zafar10]

• Sort- “Bitonic sort”

- not satisfied

- In future: hybrid radix/merge sort

[Zafar10] “GPU Random Numbers via the Tiny Encryption Algorithm” F. Zafar, et al.

73© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

• GPU上での乱数

– Tiny Encryption Algorithm [Zafar10]

• ソート

- “Bitonic sort”

- 不十分

- 将来: radix/mergeのハイブリッドソート

Page 74: DirectX11最新 リアルタイム映像事例集

[Swoboda11] http://directtovideo.wordpress.com/

• Self-shadowing

- inspired by [Swoboda11]

- Split in slices by depth from light source

- Render slice N to a shadow map

- Use that result to shadow particles in slice N+1

particlesUse Shadow

map

74© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Our solution我々のソリューション

• セルフシャドウ

- [Swoboda11]を参考

- ライトから奥行き、複数のスライスに空間を割る

- スライスNを、シャドウマップに描画

- スライスN+1を描画するとき、そのシャドウマップを利用

Page 75: DirectX11最新 リアルタイム映像事例集

Fluid-like movement流体

• Possible approaches:

– Grid based fluid simulation (Stam’s stable fluids)

• Slow in 3D

– Smoothed Particle Hydrodynamics

• Some stability problems, not very good for smoke

• Our Choice:

– Curl Noise on GPU [Bridson07]

– Fake, but nice shapes and very fast

[Bridson07] “Curl noise for procedural fluid flow”, R. Bridson, J. Hourihan, and M. Nordenstam, Proc. ACM SIGGRAPH 2007

75© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

• 可能なアプローチ

– グリッドに基づくシミュレーション (Stam’s stable fluids)

• 3次元なら遅い

– 「Smoothed Particle Hydrodynamics」

• 不安定

• 煙に不向き

• 我々の選択:

– 「Curl Noise on GPU」[Bridson07]

– 偽物だが、きれい

– 速い

Page 76: DirectX11最新 リアルタイム映像事例集

Results

76© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 77: DirectX11最新 リアルタイム映像事例集

Reflectionsリフレクション

77© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 78: DirectX11最新 リアルタイム映像事例集

• Planar reflections

– Reflected object: arbitrary

– Receiver object: objects facing one general direction

• Cubemap

– Heavy

Dynamic Local Reflectionsローカルな動的リフレクション

78© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

• 平面リフレクション

– 反射される方:なんでも

– 反射する方:大体同じ方向に向いている平面的なオブジェクト

• キューブマップ

– 重い

Page 79: DirectX11最新 リアルタイム映像事例集

From “The Technology Behind the DirectX 11Unreal Engine"Samaritan" Demo”

• Billboard Reflection- “Epic’s Samaritan Demo”- Reflected object:

billboard- Receiver object: arbitrary- Isotropic/Anisotropic

Reflection

• ビルボード・リフレクション- Epicの「Samaritan」デモ

- 反射される方:ビルボードだけ

- 反射する方:なんでも

- アイソトロピック・アニソトロピックリフレクションが可能

Dynamic Local Reflectionsローカルな動的リフレクション

Page 80: DirectX11最新 リアルタイム映像事例集

• Future: Try screen space local reflections from Crysis 2

• 将来:Crysis2のスクリーン・スペース・ローカル・リフレクション

“Reflected-Scene Impostors for Realistic Reflections at Interactive Rates”, V. Popescu et al.

“One-Shot Approximate Local Shading”, L. Wang et al.

Game Developer Conference 2011. The Technology Behind theDirectX 11 Unreal Engine"Samaritan" Demo

“Crysis 2 DX11 Ultra Upgrade” www.mycrysis.com/sites/default/files/support/download/c2_dx11_ultra_upgrade.pdf

From“Crysis 2 DX11Ultra Upgrade”

80© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Dynamic Local Reflectionsローカルな動的リフレクション

Page 81: DirectX11最新 リアルタイム映像事例集

Results

81© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 82: DirectX11最新 リアルタイム映像事例集

Conclusion

A new project

Many things to do and techs to test!

Soon we will have real assets!

Next year will be awesome !

82© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011

Page 83: DirectX11最新 リアルタイム映像事例集

Q&A

Remi Ivan Iwata

Tech Art

83© 2011 SQUARE ENIX CO., LTD. All rights reserved.Oct. 8, 2011