[WebGPU] RenderTargetTexture take the last cameras active

Hello,

There seems to be a problem with RenderTargetTexture when using WebGPU.
With WebGL everything is fine.

It works in WebGPU if I reverse the order of the active cameras. But in WebGL I don’t need to do this.
Logically in Babylon it is the camera[0] which is always visible. But if I use RenderTargetTexture, the last camera in the list is displayed (in WebGPU, not WebGL).

I wouldn’t want to change the order of the cameras on my project.

Disable line 36 to see what’s happening in WebGPU.

Thanks for looking at this.

Oh, I think it’s because of the texture rendering working correctly in WebGL, but with WebGPU, the capture happens with the latest camera when you have more than one.

I compared the 2 rendering textures with webGL and WebGPU in the inspector.

Just to give a clue.

This PR will fix the problem:

1 Like