SvenFrankson Posted August 9, 2017 Share Posted August 9, 2017 Hi everyone, I'd like to do the following : - Using a ReflectionProbe - Assign renderList and position - Render the cubeTexture - Assign cubeTexture to a given mesh - Dispose reflectionProbe / Use it for something else. To do so, I'd like to clone the renderered cubeTexture, like here : https://www.babylonjs-playground.com/#NPSPXA#1 (see lines 37 - 38) But cloning a cubeTexture gives odd results. Is there already a method to clone cubeTexture ? (actually, here it's a cubic RenderTargetTexture, maybe that's where my problem is ?) Thanks a lot for your inputs ! Have a nice day. Quote Link to comment Share on other sites More sharing options...
SvenFrankson Posted August 9, 2017 Author Share Posted August 9, 2017 Some other ideas : Alternatively, I think I could find a workaround by creating a Cubic Dynamic Texture, is it theoretically possible ? Or by creating a CubeTexture without provide file urls (like, from base64 data, or some pixel buffer), but I can't find methods to do that either... Thanks ! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 9, 2017 Share Posted August 9, 2017 Hello you are cloning a RenderTargetTexture, which will create a rendertargettexture you are not cloning the content. The new RTT will then get its content from the scene. You can still think about creating an empty CubeTexture: cubeTexture = new BABYLON.CubeTexture(null,scene) and then connect it to the internal webgl texture used by the rendertargettexture but this will not work as the next time the RTT will be updated your cube texture will be as well So my question is: why do you need this? why not creating multiple RTT? As long as you set the refreshRate to 0 it will only be updated once. Memory wise, you can call RTT.disposeFramebufferObjects() and thus the memory footprint will be the same as a regular cubetexture Quote Link to comment Share on other sites More sharing options...
SvenFrankson Posted August 10, 2017 Author Share Posted August 10, 2017 The use case is an room visualisation app. There is many static meshes, and I want to assign them a cubic environmentTexture. As it's nearly all static, the rendering has to be done only once, so I'd like to manage it to split it accross frames (generate the 30 environmentTexture accross 30 different frames). Using one probe moving from mesh to mesh seemed like easy to implement on my side, but it's obviously not the way to go with renderTargetTexture. I'll create multiple probes and sync them from a Manager object, it should be easier. GameMonetize 1 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.