Engine change to frame pushing / z buffer?

Hello, it’s been several months since I was last working in PlayCanvas and looks like something changed with the rendering. We have a product configurator set up to push frames as needed. Currently, it looks like the canvas is not getting scrubbed between new frames getting drawn. But, it looks z buffer related because pixels for closer objects will paint over pixels for further objects.

The scene looks normal, but once I move the camera you seen the craziness below.

Any ideas? xD Visually it looks very interesting, but not quite what we’re going for.

Made progress telling the graphicsDevice to clear before pushing a new frame. I thought the camera did this automatically, but not a big deal if it’s working again.

this.app.renderNextFrame = true;

The screenshot below shows the scene almost fixed, there’s another renderer for the water surface that I will also need to fix.

Can you check against version 1.38.0 of the engine build please? We have done some render refactoring in 1.39.0 that could have affected this.

Sure, I’ll get back to you.

Okay, after testing each release. It works in v1.39.0. It breaks in v1.39.1.

Thanks! We take a look tomorrow at this, I think it be one for @mvaligursky

1 Like

Do you use multiple cameras? Any additional layers? Postprocessing?

For the water we have some refraction + reflection effects. I think it’s using a separate rendering device. For, everything else we aren’t using post-processing though. And we’re just using a single main camera. Though, the reflection might be doing something with a special camera, I’m not 100% sure how it works.
We don’t do anything crazy with layers, but we do have about a dozen layers.

could you please from code set app.scene.layers.logRenderActions to true and post the logs you get in console … it should look similar to screenshot here:

It logged twice, this is the second time:

and here is the first time it logged if it helps:

I try disabling every sub-layer except for World, but I’m getting the same result.

try getting your world layer

var worldLayer = app.scene.layers.getLayerByName("World");

and setting clearColorBuffer, clearDepthBuffer and clearStencilBuffer to true on it.

Setting clearDepthBuffer to true removed the buggy effect, though the floor is missing.

It looks like that effect still is on the renderer for the water

in the same way, try enabling depth clean on the Water layer … but not sure about this, depends on how the water is getting rendered.

Ah okay, clearing the depth buffer on the refraction layer fixed the water too.

1 Like

I’ve a very simular looking display error :upside_down_face: But only with one of my three cams. Every cam has other posteffects. The cam with problems has the FXAA on it. Could there be a relation? Before the update everything worked well…

Please post more details … screenshots, explanation of what it’s rendering, logs as mentioned above. It’s likely the same solution applies to you too.

The issue is postphoned to sometime later :slight_smile:

with FXAA shader

without FXAA shader

Btw, untoggling “Preserve Drawing Buffer” in the project settings fixed the issue for the main camera. I had it toggled on for screenshots.
Because of the issue with the floor disappearing with the clearDepthBuffer and running that on more layers made everything slowly disappear, I’m just going to try to work around having “Preserve Drawing Buffer” untoggled instead.