mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
Updated Performance Tips (markdown)
parent
d219c68a45
commit
0a33bebbba
@ -2,17 +2,16 @@
|
||||
|
||||
The less draw commands, the better the performance is.
|
||||
|
||||
One drawing function like `DrawImage` or `Fill` is usually treated as one (internal) draw command, but there is an exception. Drawing commands for one image are treated as one draw command when all the below conditions are satisfied:
|
||||
One drawing function like `DrawImage` or `Fill` is usually treated as one (internal) draw command, but there is an exception. Successive drawing commands are treated as one draw command when all the below conditions are satisfied:
|
||||
|
||||
* All the functions are `DrawImage`
|
||||
* All the render sources are same (`B` in `A.DrawImage(B, op)`) and not changed (no drawing commands for B).
|
||||
* All the render targets are same (`A` in `A.DrawImage(B, op)`)
|
||||
* All the render sources are same (`B` in `A.DrawImage(B, op)`)
|
||||
* All the color matrices are same
|
||||
* All the composite modes are same
|
||||
|
||||
examples/sprites is a good example to draw > 10000 sprites with one draw command.
|
||||
|
||||
All drawing commands for one image are needed to be successive for merging so far.
|
||||
|
||||
# Avoid changing render sources' pixels
|
||||
|
||||
Ebiten records almost all draw functions in order to restore when context lost happens. When a render source's pixel is changed after it is used as a render source, Ebiten tries a complicated calculation for restoring.
|
||||
|
Loading…
Reference in New Issue
Block a user