Skip to content

Commit

Permalink
WebGPURenderer: Honor polygonOffset with WebGPU backend. (#30496)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mugen87 authored Feb 10, 2025
1 parent d2ff73c commit 2061c3e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/renderers/webgpu/utils/WebGPUPipelineUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

}
Expand Down

0 comments on commit 2061c3e

Please sign in to comment.