feat(flame_3d)!: Introduce RenderContext to make GraphicsDevice focused#3872
Draft
wolfenrain wants to merge 1 commit intomainfrom
Draft
feat(flame_3d)!: Introduce RenderContext to make GraphicsDevice focused#3872wolfenrain wants to merge 1 commit intomainfrom
RenderContext to make GraphicsDevice focused#3872wolfenrain wants to merge 1 commit intomainfrom
Conversation
wolfenrain
commented
Mar 23, 2026
Comment on lines
+32
to
+38
| void setCamera(Matrix4 viewMatrix, Matrix4 projectionMatrix) { | ||
| _viewMatrix.setFrom(viewMatrix); | ||
| _projectionMatrix.setFrom(projectionMatrix); | ||
| _cameraPosition.setFrom( | ||
| Matrix4.inverted(viewMatrix).transform3(Vector3.zero()), | ||
| ); | ||
| } |
Contributor
Author
There was a problem hiding this comment.
I was thinking of moving this into CameraComponent3D but then accessing the cameraComponent requires look-ups. That is the current approach that we already have in Flame(2d) so it would align more if we did that, but wanted to know y'all opinion @spydon @luanpotter @erickzanardo @renancaraujo @ufrshubham.
Right now this gets sets when renderFromCamera happens, which is in the World and if it was in the camera we kinda have to do world.context.viewMatrix.setFrom etc in camera which feels low-key disgusting (and would not allow users to build non-component based 3d games)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Introducing a
RenderContext3Dthat abstracts away actual rendering from theGraphicsDevice. This simplifies both binding, rendering and applying shaders in a way that is more sensible for game developers.We hide away the complexity of the
GraphicsDevicewhile still allowing complexity for those who need it.Checklist
docsand added dartdoc comments with///.examplesordocs.Breaking Change?
Related Issues