Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/webgpu_instance_sprites.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@

// material

material = new THREE.SpriteNodeMaterial( { sizeAttenuation: true, map, alphaMap: map, alphaTest: 0.1, transparent: true } );
material = new THREE.SpriteNodeMaterial( { sizeAttenuation: true, map, alphaMap: map, alphaTest: 0.1 } );
material.color.setHSL( 1.0, 0.3, 0.7, THREE.SRGBColorSpace );
material.positionNode = instancedBufferAttribute( positionAttribute );
material.rotationNode = time.add( instanceIndex ).sin();
Expand Down
1 change: 0 additions & 1 deletion examples/webgpu_particles.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@
smokeNodeMaterial.positionNode = offsetRange.mul( lifeTime );
smokeNodeMaterial.scaleNode = scaleRange.mul( lifeTime.max( 0.3 ) );
smokeNodeMaterial.depthWrite = false;
smokeNodeMaterial.transparent = true;

const smokeInstancedSprite = new THREE.Mesh( new THREE.PlaneGeometry( 1, 1 ), smokeNodeMaterial );
smokeInstancedSprite.scale.setScalar( 400 );
Expand Down
2 changes: 1 addition & 1 deletion examples/webgpu_postprocessing_afterimage.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@

// material and TSL

const material = new THREE.SpriteNodeMaterial( { blending: THREE.AdditiveBlending, depthWrite: false, transparent: true } );
const material = new THREE.SpriteNodeMaterial( { blending: THREE.AdditiveBlending, depthWrite: false } );

const localTime = instancedBufferAttribute( timeAttribute ).add( time.mul( 0.1 ) );
const modTime = mod( localTime, 1.0 );
Expand Down
1 change: 0 additions & 1 deletion examples/webgpu_sprites.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
material.colorNode = textureNode.mul( uv() ).mul( 2 ).saturate();
material.opacityNode = textureNode.a;
material.rotationNode = userData( 'rotation', 'float' ); // get value of: sprite.userData.rotation
material.transparent = true;

for ( let a = 0; a < amount; a ++ ) {

Expand Down
2 changes: 1 addition & 1 deletion examples/webgpu_tsl_compute_attractors_particles.html
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
// particles

const count = Math.pow( 2, 18 );
const material = new THREE.SpriteNodeMaterial( { transparent: true, blending: THREE.AdditiveBlending, depthWrite: false } );
const material = new THREE.SpriteNodeMaterial( { blending: THREE.AdditiveBlending, depthWrite: false } );

const attractorMass = uniform( Number( `1e${7}` ) );
const particleGlobalMass = uniform( Number( `1e${4}` ) );
Expand Down
1 change: 0 additions & 1 deletion examples/webgpu_tsl_galaxy.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
// galaxy

const material = new THREE.SpriteNodeMaterial( {
transparent: true,
depthWrite: false,
blending: THREE.AdditiveBlending
} );
Expand Down
4 changes: 2 additions & 2 deletions examples/webgpu_tsl_vfx_flames.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@

// flame 1 material

const flame1Material = new THREE.SpriteNodeMaterial( { transparent: true, side: THREE.DoubleSide } );
const flame1Material = new THREE.SpriteNodeMaterial( { side: THREE.DoubleSide } );

flame1Material.colorNode = Fn( () => {

Expand Down Expand Up @@ -129,7 +129,7 @@

// flame 2 material

const flame2Material = new THREE.SpriteNodeMaterial( { transparent: true, side: THREE.DoubleSide } );
const flame2Material = new THREE.SpriteNodeMaterial( { side: THREE.DoubleSide } );

flame2Material.colorNode = Fn( () => {

Expand Down
1 change: 0 additions & 1 deletion examples/webgpu_tsl_vfx_linkedparticles.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@
const particleGeom = new THREE.PlaneGeometry( particleQuadSize, particleQuadSize );

const particleMaterial = new THREE.SpriteNodeMaterial();
particleMaterial.transparent = true;
particleMaterial.blending = THREE.AdditiveBlending;
particleMaterial.depthWrite = false;
particleMaterial.positionNode = particlePositions.toAttribute();
Expand Down
8 changes: 8 additions & 0 deletions src/materials/nodes/SpriteNodeMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ class SpriteNodeMaterial extends NodeMaterial {
*/
this.scaleNode = null;

/**
* In Sprites, the transparent property is enabled by default.
*
* @type {Boolean}
* @default true
*/
this.transparent = true;

this.setDefaultValues( _defaultValues );

this.setValues( parameters );
Expand Down