Render the same scene many times

hi,



we are trying to render the same scene within two canvas. The problem is that the textures in the second canvas aren’t correctly drawn:







The purpose in our application is to see the same situation from different points of view, like in 3d-editing-tools like 3DSMax.



For creating a quick test I changed RenControlEditor. You can use this patch to reproduce it.



Do you have any ideas why the textures are broken?



thanks in advance

It is likely thinking that a given renderstate is already applied because it does not know you are switching contexts.  Try adding something like this before your render takes place:


        // Clear the states.
        Spatial.clearCurrentStates();
        Spatial.applyDefaultStates();


No, that didn't work  :frowning:



It seems that only the second texture of the terrain is applied in the second canvas. The first texture of the same texture state isn't applied.  :?

The problem is that you have two Contexts and they don't share textures, etc. So when the second ControlImplementor is built, the textures it pulls from TextureManager are cached with ids that are only applicable to the first context.  Clearing the TextureManager cache at the end of ControlImplementor.simpleSetup() solves this problem (I've tested with your patch)


TextureManager.clearCache();

Yeah, that worked :wink:



thank you