[flame_3d] Allow rendering World3D at a fraction of the device resolution
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
Start from World3D.renderFromCamera, where the render size passed to beginPass is computed, and the FlameGame3D game class that would expose renderResolutionScale. Read the existing drawImageRect upscale path and the MSAA option before changing anything, then verify the default scale leaves rendering unchanged. Done means the scale is clamped, the upscale filter and MSAA interaction are decided, and the 3D rendering tests/examples still pass.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem to solve
World3D.renderFromCamera always renders the scene at the viewport size multiplied by the device pixel ratio, for example 2556x1179 on an iPhone 15 Pro or 1920x1080 on an AYN Thor, then draws the result into the viewport. On dense handheld screens that resolution often costs more fill rate than it adds visible detail, especially for stylized or pixel-art 3D, and there is no way to lower it today without copying World3D.
Proposal
Expose a render resolution scale on the 3D game, for example FlameGame3D.renderResolutionScale, defaulting to 1.0 and clamped to a range such as [0.25, 1]. World3D would multiply it into the render size passed to beginPass, and the existing drawImageRect would scale the smaller image back up to the viewport, so games that keep the default see no change.
Two open questions:
- whether the game should also choose the filter used for that upscale (nearest suits pixel art, linear suits most other styles);
- how it should combine with the new MSAA option, since a lower resolution with MSAA is a common trade-off on mobile.
More information
We run this change on a local copy of flame_3d in a game built on it, with a scale of 0.5 on Android and iOS devices whose pixel ratio is at least 2. On an AYN Thor, on the same route through a night scene, the raster wait per frame went from 6.52 ms to 0.47 ms on average (p90 from 11.31 ms to 0.53 ms), and frames over 33 ms went from 12 of 248 to 2 of 247.
The change only touches World3D and the game class. I'm happy to open a PR if this direction suits you.
Other
- Are you interested in working on a PR for this?
- Lingua principale
- Dart
- Stelle
- 10.8k
- Fork
- 1.1k
- Merge medio
- 1g 21h
- PR unite (30g)
- 62
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di flame-engine/flame
-
`Viewfinder.visibleGameSize` is not reapplied when the viewport changes sizeForse già presa @ufrshubham l’ha presa 1 giorno fa. Apertabug
flame-engine/flame#4204 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
`Viewfinder.visibleGameSize` zooms in too far with a `FixedResolutionViewport`Forse già presa @ufrshubham l’ha presa 1 giorno fa. Apertabug
flame-engine/flame#4203 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Camera bounds with `considerViewport: true` are not updated when the viewport is resizedForse già presa @ufrshubham l’ha presa 1 giorno fa. Apertabug
flame-engine/flame#4202 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
`CameraComponent.setBounds` with `considerViewport: true` only works for bounds that start at (0, 0), at zoom 1Forse già presa @ufrshubham l’ha presa 1 giorno fa. Apertabug
flame-engine/flame#4201 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
`findPostProcessFromContext` returns `null` for components rendered with `CameraComponent.postProcess`Forse già presa @ufrshubham l’ha presa 1 giorno fa. Apertabug
flame-engine/flame#4200 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di flame-engine/flame
Issue simili
-
check-relative-paths reports links to existing directories as missingForse già presa @reidbaker-agent l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
google/skills_lint.dart#202 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
InlitX/GymMane#311 · 1 reazione ·
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
zjs81/meshcore-open#634 ·
I maintainer di solito rispondono entro 1 giorno