Error when reading DepthTexture of RenderTargetTexture

[.WebGL-00004DFC00141C00] GL_INVALID_OPERATION: Mismatch between texture format and sampler type (signed/unsigned/float/shadow).

Bringing up the latest from the thread on github:

In your case you are creating a comparison sampler or shadow sampler but use it as a depth sampler:

@sebavan sebavan closed this 19 minutes ago



GoodLuckIce commented 39 seconds ago

thank you very much.
But I actually want to get the correct depth value, but the obtained depth value is equal

I need to use depth to determine the final result of the two rendering results, but the value of depth is equal, which is an error.

@Luck_Good I am not sure to understand what you are trying to do here. Could you detail a bit more your use case ?

I have different types of models that require different rendering modes to render. Then I merge the final results together.
such as:
Use forge (Forge | RCDB)
The rendering mode of the engine renders the BIM model
Use Cesium (Cesium Demo)
The rendering mode of the engine renders the 3dTiles model.
Combine the final rendering results together.
I am going to try to implement these rendering modes in babylonjs. Unfortunately, when I first started to implement this idea, I ran into the problem of ==> depth acquisition error
I really hope to get help to keep me going.

Is this an engine bug? @sebavan

It has only been 1 hour since your message, and I think it is mostly a setup error here.

You need to let time to the community to answer. I bet you ll have one by tomorrow.

It looks like an angle issue as comparison samplers are fine:

But not in read mode:

You should try to create a chromium issue for it ?

It is a setup issue in your PG as you are setting the depth texture in linear and only nearest is allowed.

We added a guard in engine for that.

Thank you very much, I have learned the correct setting method