Jelajahi Sumber

Set the stencil reference value

Popov72 4 tahun lalu
induk
melakukan
80cca4a37c
1 mengubah file dengan 5 tambahan dan 1 penghapusan
  1. 5 1
      src/Engines/webgpuEngine.ts

+ 5 - 1
src/Engines/webgpuEngine.ts

@@ -3609,7 +3609,11 @@ export class WebGPUEngine extends Engine {
         const bindGroups = this._getBindGroupsToRender();
         this._setRenderBindGroups(bindGroups);
 
-        if (this._alphaState.alphaBlend && this._alphaState._isBlendConstantsDirty) {
+        if (this._stencilState.stencilTest) {
+            this._getCurrentRenderPass().setStencilReference(this._stencilState.stencilFuncRef);
+        }
+
+        if (this._alphaState.alphaBlend/* && this._alphaState._isBlendConstantsDirty*/) {
             // TODO WebGPU. should use renderPass.
             this._getCurrentRenderPass().setBlendColor(this._alphaState._blendConstants as any);
         }