Skip to content

Commit 863c0e6

Browse files
authored
Added 'stencil' property to renderer system for enabling stencil buffer on GL context (#5509)
Co-authored-by: Noeri Huisman <mrxz@users.noreply.github.com>
1 parent b61d7c5 commit 863c0e6

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

docs/components/renderer.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ It also configures presentation attributes when entering WebVR/WebXR.
4040
| logarithmicDepthBuffer | Whether to use a logarithmic depth buffer. | auto |
4141
| precision | Fragment shader [precision][precision] : low, medium or high. | high |
4242
| alpha | Whether the canvas should contain an alpha buffer. | true |
43+
| stencil | Whether the canvas should contain a stencil buffer. | false |
4344
| toneMapping | Type of toneMapping to use, one of: 'no', 'ACESFilmic', 'linear', 'reinhard', 'cineon' | 'no' |
4445
| exposure | When any toneMapping other than "no" is used this can be used to make the overall scene brighter or darker | 1 |
4546
| anisotropy | Default anisotropic filtering sample rate to use for textures | 1 |

src/core/scene/a-scene.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,10 @@ class AScene extends AEntity {
640640
rendererConfig.alpha = rendererAttr.alpha === 'true';
641641
}
642642

643+
if (rendererAttr.stencil) {
644+
rendererConfig.stencil = rendererAttr.stencil === 'true';
645+
}
646+
643647
if (rendererAttr.multiviewStereo) {
644648
rendererConfig.multiviewStereo = rendererAttr.multiviewStereo === 'true';
645649
}

src/systems/renderer.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ module.exports.System = registerSystem('renderer', {
2424
sortTransparentObjects: {default: false},
2525
colorManagement: {default: true},
2626
alpha: {default: true},
27+
stencil: {default: false},
2728
foveationLevel: {default: 1}
2829
},
2930

0 commit comments

Comments
 (0)