Skip to content

Commit

Permalink
WebGPUPipelineUtils: Fix blending with premultiplied alpha. (#29100)
Browse files Browse the repository at this point in the history
* WebGPUPipelineUtils: Fix additive blending with premultiplied alpha.

* WebGPUPipelineUtils: Fix normal blending as well.
  • Loading branch information
Mugen87 committed Aug 9, 2024
1 parent 9b6e790 commit 2d6bf90
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/renderers/webgpu/utils/WebGPUPipelineUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,11 @@ class WebGPUPipelineUtils {
switch ( blending ) {

case NormalBlending:
setBlend( GPUBlendFactor.SrcAlpha, GPUBlendFactor.OneMinusSrcAlpha, GPUBlendFactor.One, GPUBlendFactor.OneMinusSrcAlpha );
setBlend( GPUBlendFactor.One, GPUBlendFactor.OneMinusSrcAlpha, GPUBlendFactor.One, GPUBlendFactor.OneMinusSrcAlpha );
break;

case AdditiveBlending:
setBlend( GPUBlendFactor.SrcAlpha, GPUBlendFactor.One, GPUBlendFactor.One, GPUBlendFactor.One );
setBlend( GPUBlendFactor.One, GPUBlendFactor.One, GPUBlendFactor.One, GPUBlendFactor.One );
break;

case SubtractiveBlending:
Expand Down

0 comments on commit 2d6bf90

Please sign in to comment.