I am starting my Three.js script on Node.js headless server. And I want to make transparent backgroud. So I type smth like that:
scene.getObjectByName("Circle").material.transparent = true;
scene.getObjectByName("Circle").material.alphaTest = 0.5;
const texture = new THREE.Texture(image);
texture.minFilter = THREE.LinearFilter;
texture.needsUpdate = true;
texture.flipY = false;
scene.getObjectByName("Circle").material.map = texture;
And I expect smth like on pic. 1 (it’s screenshot from common js version of my script, not node js version) — transparent picture on black scene background. But instead I have the one from second screenshot (pic. 2). I mean transparancy doesn’t work in node js version of threejs. Or it does?
https://i.stack.imgur.com/88CDG.png — pic. 1
https://i.stack.imgur.com/5qvkA.png — pic. 2
And this is my server script — server.rar - Google Drive — you should run scripts/app2.js there.
And my client script — client.rar - Google Drive — it’s php file that sends an image to server and returns render of scene with this image used as texture…