MRCS project showing some weird extra geometry on volumetric capture

Hi I’m using the mrcs demo project which I forked from PlayCanvas 3D HTML5 Game Engine . I added in the holovideoobject script as well as fixed some outdated api calls so it would work. But for some reason when I test some volumetric captures (which work fine in other apps like the 8thwall mrcs demo) I seem to be getting some weird geo.

Here’s an example of what it looks like when its being weird Volumetric Viewer - PLAYCANVAS (Ijust made a build that loads the url in from the url parameters for testing reasons)

For reference its not every single model that looks funky. This 8thwall placeholder capture looked fine Volumetric Viewer - PLAYCANVAS .

And here’s the link to the project I’m using to test (which is basically just the forked sample project) PlayCanvas 3D HTML5 Game Engine

I’m still looking into it, but we think its either how the model is exported, or how the sample project seems to take the meshdata from it. But we need a little bit of help figuring it out.

Just had a quick look at the holo-video-player.js. The Holo SDK tells us how many vertices a mesh needs, and how many indices. And then each frame their SDK writes data to our vertex and index buffer directly. So I suspect the issues might be in their SDK, as we do nothing here.

It’s possible the number of indices could change per frame, and that could explain this issue, but I do not see any code that changes that per frame, so not sure. I consider this not likely though, as it seems only a few triangles are incorrect, but in a case like this I would expect many more typically.

I assumed the issue could be possibly like that (like the mesh is made for the max size, and some of the frames have some leftover vertices that are getting distorted). Do you know a good way I can check? I’ve tried printing out the vertex/index buffers every frame, but those give me consistent values since I’m guessing theyre both printing out the max size, not necessarily the current amount.

I did try making the mesh like 100 vertices smaller, and that actually gets rid of the weird geo (unfortunately along with the top of his head). So wherever these are coming from, theyre definitely from the “end” of the vertices in each frame.

Okay I think I fixed the issue, and it was exactly what you said. Basically I just now adjust the primitive count of the mesh every frame, since it appears we get it from the current frame info. I guess each frame was just “pretty close” in vertex count, but not exactly the same, which is why the issue wasnt affecting as many vertices as we may have thought.

Here’s the one line I added to the update loop if it’s useful to anyone in the future.

if (this.hvo.updateBuffers()) {

            this.mesh.primitive[0].count = this.hvo.currentFrameInfo.primCount; //this line
            const min = this.hvo.currentFrameInfo.bboxMin;
            const max = this.hvo.currentFrameInfo.bboxMax;

            this.aabb = new pc.BoundingBox();
                new pc.Vec3(min[0], min[1], min[2]),
                new pc.Vec3(max[0], max[1], max[2]));

            this.mesh.aabb = this.aabb;