ebiten: Regression - Artifacts and performances
Ebitengine Version
v2.6.0-alpha.4
Operating System
- Windows
- macOS
- Linux
- FreeBSD
- OpenBSD
- Android
- iOS
- Nintendo Switch
- Xbox
- Web Browsers
Go Version (go version
)
go1.18.3 windows/amd64
What steps will reproduce the problem?
(opengl)
-
(case 1) Run this program https://gist.github.com/Zyko0/185f7b625a46cfc4c1df34efad29a6fa produces black bars for me when I press ‘R’, there are other mouse positions, where it does
-
(case 2) Measure FPS in vsync off (in another program, not necessarily this one)
What is the expected result?
-
(case 1) Proper tiling and rendering when moving the mouse and after pressing ‘R’ key
-
(case 2) Same or almost equivalent FPS than before*
What happens instead?
-
(case 1) Black bars are showing sometimes, and at the mouse offset after pressing ‘R’ key
-
(case 2) Worse FPS than before*
Anything else you feel useful to add?
This is a single issue containing two things (as discussed on discord), because they both seem to have been introduced by the same commit* https://github.com/hajimehoshi/ebiten/commit/1c09ec5e44727a0c38b605552d93e4d470a128ab This was originally observed on v2.6.0-alpha.4, then found it might come from this specific commit.
- (case 1) It’s only after this commit that I’m seeing black bars on the gist I linked above.
- (case 2) Before this commit, I get 3200+ fps with vsync off on a project I’m currently developping, while I get to 1900+ fps right after this commit.
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 1
- Comments: 19 (19 by maintainers)
Commits related to this issue
- make fps drops go away See https://github.com/hajimehoshi/ebiten/issues/2676 See https://github.com/ebitenui/ebitenui/issues/83 I'm using a forked ebitenui to avoid the min Ebitengine version pinned... — committed to quasilyte/roboden-game by quasilyte a year ago
- internal/atlas: change when to count up usedAsDestinationCount An image has a counter to count how many times an image is used. Before this change, the counter was updated only when an image was mov... — committed to hajimehoshi/ebiten by hajimehoshi a year ago
- internal/atlas: clarify the logic when to update usedAsDestination As the name is `usedAsDestination`, this should be updated whenever the image is used as a rendering destination. Confirmed that th... — committed to hajimehoshi/ebiten by hajimehoshi a year ago
- internal/atlas: reland: clarify the logic when to update usedAsDestination This is a reland of 2c9f5d9dad09fecf4705e4b9bf437ffd2ffd8df1. As the name is `usedAsDestination`, this should be updated wh... — committed to hajimehoshi/ebiten by hajimehoshi a year ago
- internal/restorable: reuse empty byte slices for ClearPixels This is an improvement for https://github.com/hajimehoshi/ebiten/issues/2676#issuecomment-1650325027 Updates #2676 — committed to hajimehoshi/ebiten by hajimehoshi 10 months ago
- internal/restorable: use clearImage to clear a region This is an improvement for https://github.com/hajimehoshi/ebiten/issues/2676#issuecomment-1650325027 Updates #2676 — committed to hajimehoshi/ebiten by hajimehoshi 10 months ago
Thanks! I’ll close this issue for now.
I can confirm that https://github.com/hajimehoshi/ebiten/commit/1ae5e022b65492024cb8dbc365be652a7915c25a solves it for me https://github.com/hajimehoshi/ebiten/commit/98cb77d94f7368588aae39d2be928ab835faffa2 still does, but shows a few less FPS than the first one (measurable but not significant imo: 2500 vs 2800 on the project I’ve been testing)
My current rough understanding is:
internal/atlas
, there are two types for backends: source and destination.usedAsSourceCount
anddestinationCount
destinationCount
up was changed. This variable is less likely updated. (only when the image becomes an independent image)putOnSourceBackend
. This indicates that an image is moved from a destination backend to a source backend often.I bumped into this issue as well.
@Zyko0 helped me out in Discord.
I’ll copy some parts of the discussion here for reference. I’ll also come back after my game is released on Steam with some extra info (I can’t spend much time on debugging right now as I’m crunching).
My original question:
The trace is (v2.5.4):
Zyko responded with:
And it did, in fact, solve my issue.
Zyko continued:
This version does make things go bad.
Is this https://gist.github.com/Zyko0/185f7b625a46cfc4c1df34efad29a6fa?
I’ll take a look, thanks!