Skip to content

Commit

Permalink
Ditherered transparency example - enable dorth write when dithering i…
Browse files Browse the repository at this point in the history
…s on (#6094)

Co-authored-by: Martin Valigursky <[email protected]>
  • Loading branch information
mvaligursky and Martin Valigursky authored Feb 28, 2024
1 parent 53d2ce4 commit 17866df
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,13 @@ assetListLoader.load(() => {
// apply the value to the material
material[propertyName] = value;

// turn on / off blending depending on the dithering of the color
if (propertyName === 'opacityDither') {

// turn on / off blending depending on the dithering of the color
material.blendType = value === pc.DITHER_NONE ? pc.BLEND_NORMAL : pc.BLEND_NONE;

// turn on / off depth write depending on the dithering of the color
material.depthWrite = value !== pc.DITHER_NONE;
}
material.update();
});
Expand Down

0 comments on commit 17866df

Please sign in to comment.