Skip to content

Commit 6c8ff24

Browse files
WebGPURenderer: Override alpha channel to 1 for opaque materials (#28646)
* override diffuse.a to opaque material * add blending and alpha condition
1 parent 1485992 commit 6c8ff24

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

examples/jsm/nodes/materials/NodeMaterial.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Material } from 'three';
1+
import { Material, NormalBlending } from 'three';
22
import { getNodeChildren, getCacheKey } from '../core/NodeUtils.js';
33
import { attribute } from '../core/AttributeNode.js';
44
import { output, diffuseColor, varyingProperty } from '../core/PropertyNode.js';
@@ -294,6 +294,12 @@ class NodeMaterial extends Material {
294294

295295
}
296296

297+
if ( this.transparent === false && this.blending === NormalBlending && this.alphaToCoverage === false ) {
298+
299+
diffuseColor.a.assign( 1.0 );
300+
301+
}
302+
297303
}
298304

299305
setupVariants( /*builder*/ ) {

0 commit comments

Comments
 (0)