Indeed, I'm getting a format of D3DFMT_X8R8G8B8, which doesn't promise to deliver an alpha, and the values are 0.
SVN 1641 adds a check for that format and the presented alpha in the first pixel, and if necessary, forces each pixel's alpha to 255 (ouch). Suggestions for a better solution would be gratefully received.
The other issue is that the D3D9 screenshot process is excruciatingly slow, and this fix certainly won't help.
Heh, it looks like Burning screenshots are spannered as well. The alpha on the background is fine, but it appears to be 0 for any rendered pixels. That'll need looking at independently.
Test app follows. Verification that this fixes it for D3D8 and D3D9 would be much appreciated. Thanks for the report and investigation.
- Code: Select all
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
#pragma comment(lib, "Irrlicht.lib")
#pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup")
bool runTestWithDriver(E_DRIVER_TYPE driverType)
IrrlichtDevice *device = createDevice( driverType, dimension2d<s32>(640, 480));
IVideoDriver* driver = device->getVideoDriver();
ISceneManager * smgr = device->getSceneManager();
IAnimatedMeshSceneNode * node = smgr->addAnimatedMeshSceneNode(smgr->getMesh("../../media/dwarf.x"));
smgr->addCameraSceneNode(0, vector3df(0, 20, -30));
driver->beginScene(true, true, SColor(255,100,101,140));
IImage * screenshot = driver->createScreenShot();
bool result = true;
filename += ".png";
result = driver->writeImageToFile(screenshot, filename.c_str());
openFile += filename;
openFile += "\"";
bool passed = true;
passed &= runTestWithDriver(EDT_NULL);
passed &= runTestWithDriver(EDT_SOFTWARE);
passed &= runTestWithDriver(EDT_BURNINGSVIDEO);
passed &= runTestWithDriver(EDT_OPENGL);
passed &= runTestWithDriver(EDT_DIRECT3D8);
passed &= runTestWithDriver(EDT_DIRECT3D9);
return passed ? 0 : 1;