-
-
Notifications
You must be signed in to change notification settings - Fork 154
gl_engine: use full screen intermediate render targets #3710
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
by design the gl renderer created offscreen buffers of different sizes based on the scene box size. Because of this different offscreen buffers had their own coordinate system and had to deal with the alignment of offscreen buffers and the window buffer. It also meant having multiple buffer pools for different sizes. This complicates the logic and creates the need to recalculate alignment, viewports and scissors every frame, as well as texture coordinates for shaders. Now all offscreen buffers have the same size as the window buffer, which simplifies the pool logic, as well as the blending/compositing/effects logic. The number of created buffers is equal to the depth of the scene graph, including temporary buffers for copies of the window buffer #3698 - Render Targets
e0657e2
to
4eab777
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the OpenGL renderer to use full-screen intermediate render targets instead of variably-sized buffers based on scene bounding boxes. This simplifies the rendering pipeline by eliminating the need for coordinate system transformations, viewport/scissor recalculations, and multiple buffer pools for different sizes.
- Consolidates multiple render target pools into a single pool with uniform buffer sizes
- Removes viewport-based coordinate transformations in shaders and compositing tasks
- Simplifies buffer management by using window-sized render targets consistently
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
tvgGlShaderSrc.cpp | Removes viewport uniform blocks and simplifies blur shader coordinate calculations |
tvgGlRenderer.h | Consolidates multiple render target pools into a single pool |
tvgGlRenderer.cpp | Updates render target acquisition and simplifies compositing geometry calculations |
tvgGlRenderTask.cpp | Fixes scissor rectangle dimensions and removes unnecessary viewport setup |
tvgGlRenderTarget.h | Refactors pool interface to use uniform-sized render targets |
tvgGlRenderTarget.cpp | Implements new pooling logic with consistent buffer dimensions |
tvgGlEffect.h | Updates effect rendering signatures to use single pool reference |
tvgGlEffect.cpp | Adapts effect rendering to new pooling system and adds proper resource cleanup |
@tinyjin Please confirm any regression on the web. Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For a quick check in a single animation, we can use game_finished.json and guitar.json animation from our standtard animations set. Run web player on the largest resolution as we can and compare performance Thanx |
30c82d7
to
0c3e8ff
Compare
7b0fe6f
to
811aac3
Compare
by design the gl renderer created offscreen buffers of different sizes based on the scene box size. Because of this different offscreen buffers had their own coordinate system and had to deal with the alignment of offscreen buffers and the window buffer. It also meant having multiple buffer pools for different sizes. This complicates the logic and creates the need to recalculate alignment, viewports and scissors every frame, as well as texture coordinates for shaders.
Now all offscreen buffers have the same size as the window buffer, which simplifies the pool logic, as well as the blending/compositing/effects logic. The number of created buffers is equal to the depth of the scene graph, including temporary buffers for copies of the window buffer
#3698 - Render Targets