I didn’t set any stencil parameters. I guess render order cause the problem, in the iframePlane.js code there is such a material:
this._css3Plane = new pc.Css3Plane(element, this.entity, this.pixelsPerUnit);
var 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();
this.entity.render.material = material;
I found that all models created after the material was created will be rendered and cover the hole, while models that were added to the scene before the material was created will be rendered normally(thrown out when depthtest). How should I do to properly dig holes?
Had a look, it is a render order problem as both the css3 plane and the box are on the same layer, the order is defined by the material for the opaque layer.
Creating a new layer (Before World) and moving that to render before the World layer, setting the plane to render on Before World solves this issue as it’s rendering first.
There were too many issues with iframe alignment and touch/mouse events across browsers that it wasn’t worth the time of support for the small number of use cases.
In your particular case, it won’t work for VR because it still uses a HTML DOM element for the iframe.
I wasn’t asking this particular question for VR as I understand dom element won’t render for VR unless brought in webGL context, I was asking in general in case the project posed any major flaw or something.
Got it now, thanks @yaustar .
Nooo! OMG PlayCanvas is amazing not only for games. It’s a good engine for Web 3D and Metaverses, and all of these kind of projects NEEDS iframes to work. All our projects use iframe inside playcanvas!
Does Playcanvas have any plans to reopen the project? I need it for web 3D and metaverse as well. I think it will be an essential feature not only for me, but for all future PlayCanvas users.