I want to use Away3D to render (only) to a texture - which I’ll then composite in Starling.
So far I’ve read lots of posts which suggest things like:
view.renderer.swapBackBuffer = false; view.render(); view.stage3DProxy.context3D.drawToBitmapData(mainBmp.bitmapData); view.renderer.swapBackBuffer = true;
which don’t work - as swapBackBuffers appears to have disappeared recently.
view.renderer.queueSnapshot(bitmapData);
which doesn’t appear to do anything, and
view.stage3DProxy.context3D.setRenderToTexture(_texture.base)
which I expected to work but doesn’t.
So how do I do it. The closest I’ve got by just calling
view.render(); view.stage3DProxy.context3D.drawToBitmapData(mainBmp.bitmapData);
Which works, but still renders to the back buffer (I have to cover it with a vanity image) and halves my frame rate (although Flash is still only using 24% of my CPU).
Originally I was just trying to layer Starling and Away3D native renders ... and it works; except you can’t use blend modes between the libraries so my screen blend layer just made everything darker :(
Given that 90% of what I want to do is in Starling; I just want a single 3D character - I’d rather render to a texture, add that to my Starling and then keep everything else 2D.
Thoughts?
Rich