Hello Friends. I have a new problem.
I want to capture the screen from a 3D Scene. I am using the cool game engine HEAPS for this.
It is working, but I noticed I messed up the z-ordering, so I added a Depthbuffer. But now nothing is rendered at all, the png is empty. What did I do wrong?
override function render(e:Engine)
{
var renderTexture = new Texture(1024, 1024, [TextureFlags.Target]);
renderTexture.depthBuffer = new DepthBuffer(renderTexture.width, renderTexture.height);
engine.pushTarget(renderTexture);
s3d.render(e);
s2d.render(e);
var pixels = renderTexture.capturePixels();
File.saveBytes("test.png", pixels.toPNG());
Sys.exit(0);
}