Hello,
I have a problem with a material which uses a texture for it’s opacity map. I made a simple example and this the result (THERE IS A WHITE OUTLINE AROUND THE CIRCLE WHICH SHOULDN’T BE THERE):
There are two planes. One for the floor:
let mat = new pc.StandardMaterial();
mat.diffuse.set(0, 0, 0);
mat.emissive.set(0.75, 1, 1);
mat.useLighting = false;
mat.update();
let floor = new pc.Entity();
floor.addComponent("mode", {
type: "plane",
material: mat
});
floor.setLocalScale(4, 1, 4);
app.root.addChild(floor);
And one for the circle:
mat = new pc.StandardMaterial();
mat.blendType = pc.BLEND_NORMAL;
mat.diffuse.set(0, 0, 0);
mat.emissive.fromString("#99cccc");
mat.opacityMap = texture;
mat.useLighting = false;
mat.update();
let circle = new pc.Entity();
circle.addComponent("model", {
type: "plane",
material: mat
});
circle.setPosition(0, 0.015, 0);
circle.setLocalScale(0.75, 1, 0.75);
app.root.addChild(circle);
The material for the circle use a texture as it’s opacity map. The texture is just a 64x64 black circle with smooth edge.
I do not use Playcanvas Editor. I use just the engine. If I do the same inside the editor, the white outline around the circle will disappear.
I tried to download the material from the editor and load it as an asset and use it instead of my own coded material, but the result is exactly the same.
This the result from the editor (as you can see there isn’t the white outline around the circle):
Does anybody know why there is a white outline around the circle? Thanks.