I have created a semi transparent cube(opacity 0.5) which acts as a pointer. When the user taps the screen, the cube and the material are cloned and the opacity is set to 1. I’m using blendType pc.BLEND_NORMAL.
After placing a cube, when I move the pointer around the placed cube sometimes gets occluded. When the pointer is infront of the cube, it works as expected, but when the pointer is halfway through the cube, it gets occluded.
Hmm, not sure if it’s a bug with a blending mode and the transparent canvas … what are your camera’s near/far planes? Try narrowing their margin (increase near plane / decrease far plane) just in case it’s a sorting issue.
This is how I’m creating the semi-transparent pointer:
var material = cube.model.meshInstances.material;
material.opacity = 0.5;
material.blendType = pc.BLEND_NORMAL;
And this is how I’m creating the opaque cube:
var cubeclone = this.object.clone(); //this.object is the original cube
var materialclone = this.object.model.material.clone();
cubeclone.model.meshInstances.material = materialclone;
materialclone.opacity = 1;
Unfortunately, it seems the issue still persists. Now whenever I hover the semi-transparent pointer over the opaque cube, the opaque cube also becomes semi transparent. You can see the wooden floor when my pointer is over the opaque cube.