RenderTargetTexture changed? Multipass examples are broken

I just noticed that the two bottom examples of Render Target Texture With Multiple Passes | Babylon.js Documentation are broken. They seem to use setMaterialForRendering, which the docs say:

Since v5.0 it’s very easy to use a different material than the regular material ( mesh.material ) when a mesh is rendered into a render target texture: simply use RenderTargetTexture.setMaterialForRendering(meshOrMeshes, material) .

I love the feature and it makes the code much cleaner (is there a performance gain too?) but the demos don’t work on the playground anymore: renderTarget.setMaterialForRendering is not a function. Is it not released yet?

1 Like

Maybe something that @Evgeni_Popov can check

The PR is not merged yet. See:

Yes there’s a performance gain because you don’t have to switch the materials anymore, which is bad for perf because some internal structures have to be recreated when doing that.

3 Likes