Download - 그래픽 최적화로 가...가버렷! (부제: 배치! 배칭을 보자!) , Batch! Let's take a look at Batching! - Unite Seoul 2016
Frame 1 Frame 2 Frame 3 Frame 4 Frame 5
Frame 6 Frame 7 Frame 8 Frame 9 Frame 10
1 sec
0 sec
10FPS (100ms/frame)
CPU
DRAW!
TEXTURE!
SHADER!
VERTEX BUFFER!
ALPHA BLENDING!
CHANGE STATES
Draw Call
GPU...
USE Z-BUFFER!
TRANSFORM
CPU (App)
GPU
COMMAND
Draw
COMMAND
SetTexture
COMMAND
Set Texture
COMMAND
Set VBO
COMMAND
Set Shader
Command Buffer
...
Video Memory
To draw
Batch= Draw Call + Set VB/IB (mesh)
+ Set Transform (Shader Constant)
+ Set Shader+ Set Texture 0~7+ Set Blending + Set Z enable+ ...
Batch= Draw Call + Set VB/IB (mesh)
+ Set Transform (Shader Constant)
+ Set Shader+ Set Texture 0~7+ Set Blending + Set Z enable+ ...
SetPass Call(Material&Shader)
Device Batches
Samsung Galaxy S2 85
Samsung Galaxy S3 178
Samsung Galaxy S4 215
Samsung Galaxy S5 260
Batch(in Rendering Statistics Window)
= Draw Call
+ Setting Shader + Setting Blending
+ Setting Texture + Setting Vertex Buffer
+ ...
Dynamic Batching : 제약사항
Overhead- Skinned Mesh - Vertex Mesh
- position, normal, uv0 -> 300- position, normal, uv0, uv1, tangent -> 180
- http://docs.unity3d.com/kr/current/Manual/DrawCallBatching.html
Device : Galaxy Note4 Rez : 2560X1440
CPU : ARMv7 VFPv3(1.9GHz) GPU : Mali-760MP(0.6GHz)
Shader : Custom Unlit Shader, Self-Illumin/Diffuse, Lightmap : 13 textures
Condition 1
- Batching : No
- Occlusion Culling : No
Condition 2
- Batching : Yes
- Occlusion Culling : No
Condition 3
- Batching : Yes
- Occlusion Culling : Yes
FPS(ms) 41(24.3) 50(20.0) 60(16.6)
Batches 1365 157 94
SetPass Calls 134 142 81
Saved by Batching 0 1207 244
Tris 114.3K 114.3K 28.9K
-4.3ms -3.4ms
-1208 -63
-8 -61
-85.4K
Note :- This is not the official data.- This is the rough test. Not the exact reference.- Keep in mind “case by case”