PeapBoy Posted October 13, 2017 Share Posted October 13, 2017 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 ! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 13, 2017 Share Posted October 13, 2017 Actually we should not clone the renderTargetTexture and let the use do it manually. So perhaps the fix here is just to block the clone of the RTT Thoughts? Quote Link to comment Share on other sites More sharing options...
PeapBoy Posted October 13, 2017 Author Share Posted October 13, 2017 I agree. I could do this on monday if you want. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 13, 2017 Share Posted October 13, 2017 please Quote Link to comment Share on other sites More sharing options...
PeapBoy Posted October 16, 2017 Author Share Posted October 16, 2017 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. Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted October 16, 2017 Share Posted October 16, 2017 @PeapBoy Nice catch, sorry to complain, but my OCD hurts my brain when switch cases aren't ordered from lowest to highest Quote Link to comment Share on other sites More sharing options...
PeapBoy Posted October 16, 2017 Author Share Posted October 16, 2017 Is it better like this ? aWeirdo 1 Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted October 16, 2017 Share Posted October 16, 2017 Much, cheers Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.