Canvas: Image depth refers to the amount of depth slices, not the bit depth

This commit is contained in:
Fernando García Liñán 2021-08-31 18:04:39 +02:00
parent 5c4bbc7552
commit 2371065375

View File

@ -330,7 +330,7 @@ namespace canvas
if (!_screenshotCallback) {
// no draw callback yet
osg::Image* shot = new osg::Image();
shot->allocateImage(getSizeX(), getSizeY(), 24, GL_RGB, GL_UNSIGNED_BYTE);
shot->allocateImage(getSizeX(), getSizeY(), 1, GL_RGB, GL_UNSIGNED_BYTE);
camera->attach(osg::Camera::COLOR_BUFFER, shot);
camera->setFinalDrawCallback(new CanvasImageCallback(shot));
SG_LOG(SG_GENERAL,SG_INFO,"CanvasImage: attached image and draw callback to camera " << camera << " for canvas " << canvasname << ". Ready for subscriber now.");