Hi folks,
I would like to share some observations and issues I have encountered while using this fork: PlayCanvas 3D HTML5 Game Engine
During my usage of this project, I experienced a weird behavior.
When I dynamically uploaded a GLB and then switched to the launched page, the added GLB appears to penetrate the plane.
I’ve created a simplified version for reproduction purposes. Please take a look: Editor Demo
I’ve discovered that after setting up the plane,
const material = new pc.StandardMaterial();
material.depthWrite = true;
material.redWrite = false;
material.greenWrite = false;
material.blueWrite = false;
material.alphaWrite = false;
material.blendType = pc.BLEND_NONE;
material.opacity = 0;
material.update();
the upcoming new material
AddNewMaterial.prototype.initialize = function() {
// Create new material after plane material created
setTimeout(() => {
this.createNewMaterial();
console.log("Create New Material.")
}, 1000);
};
AddNewMaterial.prototype.createNewMaterial = function() {
const material = new pc.StandardMaterial();
material.diffuse = new pc.Color().fromString('#0015ff');
material.update();
this.entity.render.material = material;
};
will cause the penetration issue to occur.
Your assistance in addressing this matter would be greatly appreciated.