How to render .png texture


I am using the following code :

new THREE.TextureLoader().load( “…/uploads/assettype/xxx.png”);

Everything, is working fine except the image rendered is having a white background. The image itself doesn’t have any white background.

I want the background to be transparent.

Any help will be appreciated.

Thanks And Regards,
Rupak Banerjee.

I think

new THREE.MeshBasicMaterial({ map: THREE.TextureLoader().load( “…/uploads/assettype/xxx.png”), transparent: true,  }));

Instead of making the material transparent, you can also just configure alphaTest for producing an alpha cutout.

1 Like
const material = new THREE.PointsMaterial( {  size: 128, sizeAttenuation: true,map:pointtexture, transparent: true  } );

Doesn’t work. It shows a white background.

A short working live code example, that demonstrates the issue, will be helpful. jsfiddle, codepen, codesandbox etc.

I am having texture at top of another texture. When, my icons are coming over other texture, the background is coming as white.

1 Like

have the same problem as you