Thanks @ferdinand, I don't expect you to do everything :)
But I've reached a point where I've tried everything I can think of. I've spent too long going around in circles at this point. Here's what I'd like to get:
A MultipassBitmap that I can pass to RenderDocument() that will give me
- 1 layer for RGB (32bit)
- 1 layer for alpha (32bit) <-- yes, I want a separate alpha layer
- 1 layer for depth (32bit)
for use with the standard renderer. For now, I must have these 3 layers.
Here's some code I've experimented with to try and show you where I've been:
MultipassBitmap *multi = MultipassBitmap::Alloc(width,height,COLORMODE_RGBf);
if(multi)
{
MultipassBitmap *colourMap = multi->GetLayerNum(0);
MultipassBitmap *alphaMap = multi->AddAlpha(nullptr,COLORMODE_GRAYf);
if(alphaMap)
{
alphaMap->SetParameter(MPBTYPE_NAME,String("Alpha"));
alphaMap->SetParameter(MPBTYPE_USERID,VPBUFFER_ALPHA);
alphaMap->SetParameter(MPBTYPE_SAVE,TRUE);
alphaMap->SetParameter(MPBTYPE_SHOW,TRUE);
}
MultipassBitmap *depthMap = multi->AddAlpha(alphaMap,COLORMODE_GRAYf,FALSE);
if(depthMap)
{
depthMap->SetParameter(MPBTYPE_NAME,String("Depth"));
depthMap->SetParameter(MPBTYPE_USERID,VPBUFFER_DEPTH);
depthMap->SetParameter(MPBTYPE_SAVE,TRUE);
depthMap->SetParameter(MPBTYPE_SHOW,TRUE);
}
if(RenderDocument(doc,rdata,nullptr,nullptr,multi,RENDERFLAGS_0,nullptr) == RENDERRESULT_OK)
{
ShowBitmap(multi);
}
}
I've tried all sorts of variations of this, none of which produce the same as the Render to Picture Viewer command. Which is why I mentioned having that as an example would be useful.
How do we do this?
WP.