| 983 | | // Blit to the resolve framebuffer. |
| 984 | | // Note that (with nvidia 175.16 windows drivers at least) if the read |
| 985 | | // framebuffer is multisampled then the dimension arguments are ignored |
| 986 | | // and the whole framebuffer is always copied. |
| 987 | | fbo_ext->glBlitFramebuffer( |
| 988 | | 0, 0, static_cast<GLint>(_viewport->width()), static_cast<GLint>(_viewport->height()), |
| 989 | | 0, 0, static_cast<GLint>(_viewport->width()), static_cast<GLint>(_viewport->height()), |
| 990 | | blitMask, GL_NEAREST); |
| 991 | | |
| | 988 | if (blitMask) |
| | 989 | { |
| | 990 | // Blit to the resolve framebuffer. |
| | 991 | // Note that (with nvidia 175.16 windows drivers at least) if the read |
| | 992 | // framebuffer is multisampled then the dimension arguments are ignored |
| | 993 | // and the whole framebuffer is always copied. |
| | 994 | fbo_ext->glBlitFramebuffer( |
| | 995 | 0, 0, static_cast<GLint>(_viewport->width()), static_cast<GLint>(_viewport->height()), |
| | 996 | 0, 0, static_cast<GLint>(_viewport->width()), static_cast<GLint>(_viewport->height()), |
| | 997 | blitMask, GL_NEAREST); |
| | 998 | } |
| | 999 | |
| | 1000 | if (needToBlitColorBuffers) |
| | 1001 | { |
| | 1002 | for (FrameBufferObject::AttachmentMap::const_iterator |
| | 1003 | it = _resolveFbo->getAttachmentMap().begin(), |
| | 1004 | end =_resolveFbo->getAttachmentMap().end(); it != end; ++it) |
| | 1005 | { |
| | 1006 | osg::Camera::BufferComponent attachment = it->first; |
| | 1007 | if (attachment >=osg::Camera::COLOR_BUFFER0) |
| | 1008 | { |
| | 1009 | glReadBuffer(GL_COLOR_ATTACHMENT0_EXT + (attachment - osg::Camera::COLOR_BUFFER0)); |
| | 1010 | glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT + (attachment - osg::Camera::COLOR_BUFFER0)); |
| | 1011 | |
| | 1012 | fbo_ext->glBlitFramebuffer( |
| | 1013 | 0, 0, static_cast<GLint>(_viewport->width()), static_cast<GLint>(_viewport->height()), |
| | 1014 | 0, 0, static_cast<GLint>(_viewport->width()), static_cast<GLint>(_viewport->height()), |
| | 1015 | GL_COLOR_BUFFER_BIT, GL_NEAREST); |
| | 1016 | } |
| | 1017 | } |
| | 1018 | // reset the read and draw buffers? |
| | 1019 | // glReadBuffer(GL_COLOR_ATTACHMENT0_EXT); |
| | 1020 | // glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT); |
| | 1021 | } |
| | 1022 | |
| | 1023 | |