Limited availability
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
Note: This feature is available in Web Workers.
The setStencilReference()
method of the GPURenderPassEncoder
interface sets the stencil reference value using during stencil tests with the "replace"
stencil operation (as set in the descriptor of the GPUDevice.createRenderPipeline()
method, in the properties defining the various stencil operations).
setStencilReference(reference)
Parameters
reference
A number representing the new stencil reference value to set for the render pass.
Note: If a setStencilReference()
call is not made, the stencil reference value defaults to 0 for each render pass.
None (Undefined
).
// â¦
const passEncoder = commandEncoder.beginRenderPass(renderPassDescriptor);
passEncoder.setPipeline(renderPipeline);
passEncoder.setVertexBuffer(0, vertexBuffer);
passEncoder.setStencilReference(1);
passEncoder.draw(3);
passEncoder.end();
// â¦
Specifications Browser compatibility See also
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4