Skip to content

Commit

Permalink
Added 'stencil' property to renderer system for enabling stencil buff…
Browse files Browse the repository at this point in the history
…er on GL context (#5509)

Co-authored-by: Noeri Huisman <mrxz@users.noreply.github.com>
  • Loading branch information
mrxz and mrxz committed Apr 5, 2024
1 parent b61d7c5 commit 863c0e6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/components/renderer.md
Expand Up @@ -40,6 +40,7 @@ It also configures presentation attributes when entering WebVR/WebXR.
| logarithmicDepthBuffer | Whether to use a logarithmic depth buffer. | auto |
| precision | Fragment shader [precision][precision] : low, medium or high. | high |
| alpha | Whether the canvas should contain an alpha buffer. | true |
| stencil | Whether the canvas should contain a stencil buffer. | false |
| toneMapping | Type of toneMapping to use, one of: 'no', 'ACESFilmic', 'linear', 'reinhard', 'cineon' | 'no' |
| exposure | When any toneMapping other than "no" is used this can be used to make the overall scene brighter or darker | 1 |
| anisotropy | Default anisotropic filtering sample rate to use for textures | 1 |
Expand Down
4 changes: 4 additions & 0 deletions src/core/scene/a-scene.js
Expand Up @@ -640,6 +640,10 @@ class AScene extends AEntity {
rendererConfig.alpha = rendererAttr.alpha === 'true';
}

if (rendererAttr.stencil) {
rendererConfig.stencil = rendererAttr.stencil === 'true';
}

if (rendererAttr.multiviewStereo) {
rendererConfig.multiviewStereo = rendererAttr.multiviewStereo === 'true';
}
Expand Down
1 change: 1 addition & 0 deletions src/systems/renderer.js
Expand Up @@ -24,6 +24,7 @@ module.exports.System = registerSystem('renderer', {
sortTransparentObjects: {default: false},
colorManagement: {default: true},
alpha: {default: true},
stencil: {default: false},
foveationLevel: {default: 1}
},

Expand Down

0 comments on commit 863c0e6

Please sign in to comment.