-
Notifications
You must be signed in to change notification settings - Fork 4
Add support for multisample anti-aliasing (MSAA), working HiDPI support #94
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
Merged
Conversation
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
+ add GUI elements for frame vels
fixup GraphicsPipeline introduction
fixup GraphicsPipeline use in shadow pass
fixup RobotScene
fixup DepthViz
…t introducing MSAA texture buffers + RenderContext now hides swapchain, user must access color target thru getter + make depth texture private, add depthTarget() getter + getters for main color/depth targets automatically switch to MSAA textures if needed update all render systems/effects for new RenderContext API
+ make things work on High DPI display
+ throw if swapchain acquisition failed
fixup examples/Visualizer
…tion (using CTAD trick)
…er transparency support)
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.
This PR adds support for MSAA as an antialiasing technique (and so far, the only planned one) to Candlewick.
This was a pain to figure out but we've got it working.
There is full support for MSAA up to 8x (the maximum texture sample count in SDLGPU). The deferred effects (SSAO, transparency) are still supported.
As part of the major changes, we now have HiDPI support, and no longer directly render to the window swapchain (for convenience reasons due to having to manage MSAA workflows in the rendering code).
Comparisons
Before (no MSAA)

After (8x MSAA) (observe the grid lines far out and the robot arm's shoulder)

Other changes
Window(wrapper forSDL_Window)GraphicsPipelineRAII wrapper class because I was tired of cleaning up pipeline resources manually. Also significantly cleaned up pipeline management for theRobotScenerender system. Several non-ECS/non-Visualizerexamples were also updated to show its use.candlewick::guinamespace.terminate_with_message()function. I did a trick using class template automatic deduction (CTAD).Configstruct members inRobotScene.Contributed PRs
In the course of making the changes I contributed libsdl-org/SDL#13768 to SDL. Not sure I need it since the final MSAA resolve is done in the order-independent transparency (OIT) composite pass, which has a single render target.