유니티 그래픽 최적화, 어디까지 해봤니 (optimizing unity graphics) ndc15 ver

Post on 20-Jul-2015

2.289 Views

Category:

Technology

8 Downloads

Preview:

Click to see full reader

TRANSCRIPT

그래픽최적화어디까지해봤니

- Unity Field Engineer 오지현

Image : 무사, Implosion, Z-rush, 히어로즈아레나

Bottleneck

Draw Call

Batching (Pros, Cons)

Profiling

Profiling Sample

Level Of Detail

Lighting (Image Based Lighting)

Physically Based Rendering

Image : volvo

Bottleneck

Draw Call

Batching (Pros, Cons)

Profiling

Profiling Sample

Level Of Detail

Lighting (Image Based Lighting)

Physically Based Rendering

Optimization = Removing Bottleneck

CPU

GPU

Frame

End

Frame

start

Bottleneck?

CPU

GPU

Frame

End

Frame

start

CPU boundary VS GPU boundary

CPU

GPU

Frame

End

Frame

start

Logic AI Physics

Loading GC ...

CPU boundary

GPU boundary

Polygon Texture Filtering

Lighting Framebuffer

Shader Overdraw ...

Bottleneck

Draw Call

Batching (Pros, Cons)

Profiling

Profiling Sample

Level Of Detail

Lighting (Image Based Lighting)

Physically Based Rendering

CPU

DRAW!

Draw Call in a narrow sense

GPU

OK

CPU

DRAW!

TEXTURE!

SHADER!

VERTEX BUFFER!

ALPHA BLENDING!

TRANSFORM

CHANGE STATES

Draw Call in a broad sense

GPU...

USE Z-BUFFER!

CPU (App)

GPU

COMMAND COMMAND COMMAND COMMAND COMMAND

Set Texture Set Shader

Use BlendingSet VBO

Draw

Command Buffer

+Draw CallLogic AI Physics

Loading GC …

CPU boundary

Bottleneck

Draw Call

Batching (Pros, Cons)

Profiling

Profiling Sample

Level Of Detail

Lighting (Image Based Lighting)

Physically Based Rendering

Batch(in Rendering Statistics Window)

= Draw Call

+ Setting Shader + Setting Blending

+ Setting Texture + Setting Vertex Buffer

+ ...

Batching =

1 batch for

many objects

Material A Material B

Mesh 1 Mesh 2 Mesh 1 Mesh 3

Batch Batch

s

c

e

n

e

Asset : Top-down Sci-Fi

Static Batching VS

Dynamic Batching

Static Batching do this on loading

Dynamic Batching do this on Run-time

GPU

Vertex BufferScene

Dynamic Batching : limitations

Overhead for collecting vertices.

- Not for Skinned Mesh.

- Less than 300 vertices per mesh.(position, normal, uv0)

Unity Frame Debugger

Bottleneck

Draw Call

Batching (Pros, Cons)

Profiling

Profiling Sample

Level Of Detail

Lighting (Image Based Lighting)

Physically Based Rendering

Analyze your Bottleneck

Measure correctly

Average value

Diverse situation

Per Target Device

CPU : A5

GPU : PowerVR SGX535

Resolution : 1024 x 768

CPU : A5X

GPU : PowerVR SGX543

Resolution : 2048 x 1536

Performance ?

Episode of

Unity Profiler

CPU

GPU

Simple test

High Polygon model VS Low Polygon model

Expensive Shader VS Cheap Shader .

High rez texture VS Low rez texture

Deep GPU ProfileVendor Profiler tools

Qualcomm Adreno Profiler

Mali Graphics Debugger

ARM DS-5

http://community.arm.com/docs/DOC-9414

iOS GPU profiler

Bottleneck

Draw Call

Batching (Pros, Cons)

Profiling

Profiling Sample

Level Of Detail

Lighting (Image Based Lighting)

Physically Based Rendering

LG G-pad ( Adreno 320, 1920 X 1200)

Deferred Render

GPU Skinning

MatCap Shader

Lightmap

15K Polygons

Player Settings -> GPU Skinning

Skinning

GPU

CPU

or

Asset : Succubus Monster 2.0

Player Settings > Rendering

GPU :Vertex

Shader

Buffer

GPU Skinning with Transform FeedbackOpen GL ES 3.0 ~

CPU :NEON

Buffer

CPU Skinning with NEON SIMD

NEON TM

X1 + =X2 X3

X1 + =X2 X3

Y1 + =Y2 Y3

Z1 + =Z2 Z3

W1 + =W2 W3

Single Instruction

Multi Data

Single Instruction

Single Data

GPU Skinning -> CPU Skinning

-9ms

cmd > adb.exe shell setprop debug.egl.profiler 1

image : Adreno Profiler user guide

Mobile/Unlit (support Lightmap)

-17ms

Level Of Detail

Image : Infinity Tap SF

ASSET : Armored Golem

Per Pixel Lit

NormalmapPer Vertex Lit

LOD Plugins in Asset Store

Normalmap X

15K -> 7K Poly

LOD

-3ms

Deferred -> Forward

-5ms

Image : FPS Hangar

17 FPS (57ms)iPhone 6 : PowerVR GX6450 1334 X 750

Vertex Pixel

Tile Based Deferred Rendering

39 FPS (25ms)iPhone 6 : PowerVR GX6450 1334 X 750

SSAO SunShaft

Bottleneck

Draw Call

Batching (Pros, Cons)

Profiling

Profiling Sample

Level Of Detail

Lighting (Image Based Lighting)

Physically Based Rendering

image : http://www.aversis.be/tutorials/vray/vray-20-gi-methods.htm

Texture

Image Based Lighting

Unlit lighting

DiffuseWrap MatCap

Toon Shading (Diffuse Wrap)

MatCap (Material Capture)

IMG : http://www.cgarena.com/freestuff/tutorials/misc/photoreal/

X( ) + =

MatCap Shading

Standard Shader

PC Ver. Mobile Ver.

We are optimizing more

Use less textures

ASSET : Many-Worlds

Use Secondary Maps

4.6.3~

Q & A유니티개발자커뮤니티

유니티허브

ozlael.oz ozlael

ozlael.egloos.com

Thank you

top related