Skip to content
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

RenderTarget: Add resolveStencilBuffer. #28096

Merged
merged 2 commits into from
Apr 10, 2024
Merged

RenderTarget: Add resolveStencilBuffer. #28096

merged 2 commits into from
Apr 10, 2024

Conversation

Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Apr 9, 2024

Related issue: #27799 (comment)

Description

This PR introduces a new flag RenderTarget.resolveStencilBuffer. It can be used to control whether the stencil buffer should be resolved or not when rendering to a multisampled render target.

@Mugen87 Mugen87 added this to the r164 milestone Apr 9, 2024
@Mugen87
Copy link
Collaborator Author

Mugen87 commented Apr 9, 2024

@Oletus Looking good?

Copy link

github-actions bot commented Apr 9, 2024

📦 Bundle size

Full ESM build, minified and gzipped.

Filesize dev Filesize PR Diff
672.9 kB (166.8 kB) 672.9 kB (166.8 kB) +60 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Filesize dev Filesize PR Diff
452.6 kB (109.3 kB) 452.6 kB (109.3 kB) +59 B

Copy link
Contributor

@Oletus Oletus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't have time to test this yet, but looks great!

@gkjohnson
Copy link
Collaborator

Defines whether the stencil buffer should be resolved when rendering into a multisampled render target or not.

Can you clarify what this means? The description isn't super clear. Does this just mean "use the stencil buffer"? As in even if the render target has stencil enabled this flag can be set to false to disable it's use?

@Mugen87
Copy link
Collaborator Author

Mugen87 commented Apr 9, 2024

The flag is only relevant if you use a stencil buffer (when stencilBuffer is set to true) and only when doing RTT with multisampling. If you set resolveStencilBuffer to false, it disables the resolve meaning stencil data won't be transferred into the multisampled draw buffer. So it just controls the blit operation. You can still use stencil during the actual render pass.

@Mugen87 Mugen87 merged commit b6ab3c4 into mrdoob:dev Apr 10, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants