Hello again!
So I’m also trying to load external GLB files from a URL, the loading itself seems to be working fine but I need those GLBs to be occluded by a mask object (which is a .glb file loaded from inside the app)
This is what I use to mask 3D objects
var meshInstances = this.entity.model.meshInstances;
var mat;
for(var i = 0; i < meshInstances.length; i++) {
mat = meshInstances[i].material;
mat.redWrite = mat.greenWrite = mat.blueWrite = mat.alphaWrite = false; // don't render occluder to color
}
This works fine for .FBX files, but when I load in GLB files they seem to completely ignore the occluder, any ideas here?
I’ve set up a project here with a regular primitive where occlusion works and loaded in a free GLB that renders over the occluder, is there a material setting needed to be set on GLB loaded files?
(If you hit play mode in that project, you can move camera with left and right arrow keys to observe the occlusion)