Procházet zdrojové kódy

Document that 2D batching currently only works with the GLES2 renderer

Hugo Locurcio před 4 roky
rodič
revize
1875ceb8b8
1 změnil soubory, kde provedl 15 přidání a 11 odebrání
  1. 15 11
      tutorials/optimization/batching.rst

+ 15 - 11
tutorials/optimization/batching.rst

@@ -16,6 +16,10 @@ of work for the user in the GPU driver at the cost of more expensive draw calls.
 As a result, applications can often be sped up by reducing the number of draw
 As a result, applications can often be sped up by reducing the number of draw
 calls.
 calls.
 
 
+.. note::
+
+    2D batching is currently only supported when using the GLES2 renderer.
+
 Draw calls
 Draw calls
 ^^^^^^^^^^
 ^^^^^^^^^^
 
 
@@ -68,8 +72,8 @@ Batching will be broken by (amongst other things):
 * Change of material
 * Change of material
 * Change of primitive type (say going from rectangles to lines)
 * Change of primitive type (say going from rectangles to lines)
 
 
-.. note:: 
-	
+.. note::
+
 	If for example, you draw a series of sprites each with a different texture,
 	If for example, you draw a series of sprites each with a different texture,
 	there is no way they can be batched.
 	there is no way they can be batched.
 
 
@@ -95,7 +99,7 @@ In Godot this back to front order is determined by:
 * Y sort nodes
 * Y sort nodes
 
 
 .. note::
 .. note::
-	
+
 	You can group similar objects together for easier batching. While doing so
 	You can group similar objects together for easier batching. While doing so
 	is not a requirement on your part, think of it as an optional approach that
 	is not a requirement on your part, think of it as an optional approach that
 	can improve performance in some cases. See the diagnostics section in order
 	can improve performance in some cases. See the diagnostics section in order
@@ -144,7 +148,7 @@ balance the costs and benefits in your project.
 	A - wood
 	A - wood
 	C - wood
 	C - wood
 	B - grass
 	B - grass
-	
+
 Because the texture only changes once, we can render the above in only 2
 Because the texture only changes once, we can render the above in only 2
 draw calls.
 draw calls.
 
 
@@ -198,7 +202,7 @@ in a real game, you might be drawing closer to 1000 sprites.
 - Before: 1000 * 4 = 4000 draw calls.
 - Before: 1000 * 4 = 4000 draw calls.
 - After: 1 * 4 = 4 draw calls.
 - After: 1 * 4 = 4 draw calls.
 
 
-That is 1000x decrease in draw calls, and should give a huge increase in
+That is a 1000× decrease in draw calls, and should give a huge increase in
 performance.
 performance.
 
 
 Overlap test
 Overlap test
@@ -411,20 +415,20 @@ Reading a diagnostic
 	canvas_begin FRAME 2604
 	canvas_begin FRAME 2604
 	items
 	items
 		joined_item 1 refs
 		joined_item 1 refs
-				batch D 0-0 
+				batch D 0-0
 				batch D 0-2 n n
 				batch D 0-2 n n
 				batch R 0-1 [0 - 0] {255 255 255 255 }
 				batch R 0-1 [0 - 0] {255 255 255 255 }
 		joined_item 1 refs
 		joined_item 1 refs
-				batch D 0-0 
+				batch D 0-0
 				batch R 0-1 [0 - 146] {255 255 255 255 }
 				batch R 0-1 [0 - 146] {255 255 255 255 }
-				batch D 0-0 
+				batch D 0-0
 				batch R 0-1 [0 - 146] {255 255 255 255 }
 				batch R 0-1 [0 - 146] {255 255 255 255 }
 		joined_item 1 refs
 		joined_item 1 refs
-				batch D 0-0 
+				batch D 0-0
 				batch R 0-2560 [0 - 144] {158 193 0 104 } MULTI
 				batch R 0-2560 [0 - 144] {158 193 0 104 } MULTI
-				batch D 0-0 
+				batch D 0-0
 				batch R 0-2560 [0 - 144] {158 193 0 104 } MULTI
 				batch R 0-2560 [0 - 144] {158 193 0 104 } MULTI
-				batch D 0-0 
+				batch D 0-0
 				batch R 0-2560 [0 - 144] {158 193 0 104 } MULTI
 				batch R 0-2560 [0 - 144] {158 193 0 104 } MULTI
 	canvas_end
 	canvas_end