Jelajahi Sumber

WebGPURenderer: Honor `polygonOffset` with WebGPU backend. (#30496)

Michael Herzog 11 bulan lalu
induk
melakukan
2061c3e186
1 mengubah file dengan 8 tambahan dan 0 penghapusan
  1. 8 0
      src/renderers/webgpu/utils/WebGPUPipelineUtils.js

+ 8 - 0
src/renderers/webgpu/utils/WebGPUPipelineUtils.js

@@ -188,6 +188,14 @@ class WebGPUPipelineUtils {
 
 
 			}
 			}
 
 
+			if ( material.polygonOffset === true ) {
+
+				depthStencil.depthBias = material.polygonOffsetUnits;
+				depthStencil.depthBiasSlopeScale = material.polygonOffsetFactor;
+				depthStencil.depthBiasClamp = 0; // three.js does not provide an API to configure this value
+
+			}
+
 			pipelineDescriptor.depthStencil = depthStencil;
 			pipelineDescriptor.depthStencil = depthStencil;
 
 
 		}
 		}

粤ICP备19079148号