Hi all,
I started from the example three.js examples to have the animated sprite feature thanks to the SpriteNodeMaterial.
The first thing I wanted was to have the background of the sprite transparent, I updated the .PNG texture to add an alpha channel but the background remains black with NormalBlending.
I tried with CustomBlending with many blendSrc and blendDst factors but the result is never the expected one…
My update to test CustomBlending instead of the default NormalBlending:
walkingManTexture.premultiplyAlpha = true; sprite1.material.transparent = true; //sprite1.material.alphaTest = 0.5; sprite1.material.blending = THREE[ "CustomBlending" ]; sprite1.material.blendSrc = THREE[ "OneFactor" ]; sprite1.material.blendDst = THREE[ "OneMinusSrcAlphaFactor" ]; sprite1.material.blendEquation = THREE.AddEquation;
I don’t have the problem with a MeshBasicMaterial in NormalBlending, seems to be because of SpriteNodeMaterial.
My code: Transparency problem with SpriteNodeMaterial - JSFiddle - Code Playground
Thanks