PeapBoy

[SOLVED] Trouble with renderTargetTexture clone function

Recommended Posts

Hello,

When cloning a material - say, a BABYLON.StandardMaterial -, everything is fine except for renderTargetTexture.

PG: https://playground.babylonjs.com/#BLG0FL

material.clone() function calls renderTargetTexture.clone() function. But renderTargetTexture.clone() function creates a new empty RenderTargetTexture with the same properties.
Btw, I'm sure that adding "scene.customRenderTargetTextures.push()" at the end of the clone function would resolve this issue. But I don't think that people want to create a new RTT each time they clone a material (it would kill the app, especially on iOS devices).

Not sure about which behaviour adopt here, any idea ?

Thanks !

Share this post


Link to post
Share on other sites

First I wanted to add a new propertyType to handle this but we cannot anticipate if a diffuse/reflection/whatever texture will be - or not - a RTT. So I just check sourceProperty.isRenderTarget in clone function.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Recently Browsing   0 members

    No registered users viewing this page.