I was using trunk.
Here is how I define the render target.
Code: Select all
video::IRenderTarget* renderTargetAllSubimages = 0;
video::ITexture* renderTargetTex = 0;
scene::ICameraSceneNode* fixedCam = 0;
renderTargetTex = videoDriver->addRenderTargetTexture(core::dimension2d<u32>(initialParametres->widthOfRenderzoneByPixel, initialParametres->heightOfRenderzoneByPixel), "RTT1", video::ECF_A8R8G8B8);
video::ITexture* renderTargetDepth = videoDriver->addRenderTargetTexture(core::dimension2d<u32>(initialParametres->widthOfRenderzoneByPixel, initialParametres->heightOfRenderzoneByPixel), "DepthStencil", video::ECF_D24S8);
renderTargetAllSubimages = videoDriver->addRenderTarget();
renderTargetAllSubimages->setTexture(renderTargetTex, renderTargetDepth);
Code: Select all
void savetex(ITexture *texture, std::string filename, IVideoDriver* videoDriver) {
video::IImage* image = videoDriver->createImageFromData(
texture->getColorFormat(),
texture->getSize(),
texture->lock(irr::video::E_TEXTURE_LOCK_MODE::ETLM_READ_WRITE),
true //copy mem
);
videoDriver->writeImageToFile(image, path(filename.c_str()));
texture->unlock();
}
Code: Select all
savetex(renderTargetTex, "SingleFrameRenderingResult.png", videoDriver);
I ran some test and it appears that it can still work well until 7680*4320.
Cannot help but wondering, is that the problem caused by the file format or irrlicht? (I also tried bmp, and it looks almost the same except the size of the output file, which was reasonable. And I tried using SingleFrameRenderingResult.tif as the file name to use tiff format, but it appeared that the file cannot be recognized.)
Any ideas?