mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-28 09:41:34 +00:00
Do not create a depth buffer for the global map 2d rendering
This commit is contained in:
parent
8e3bc981a2
commit
b840c68f0c
1 changed files with 9 additions and 4 deletions
|
@ -266,6 +266,9 @@ namespace MWRender
|
||||||
camera->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT, osg::Camera::PIXEL_BUFFER_RTT);
|
camera->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT, osg::Camera::PIXEL_BUFFER_RTT);
|
||||||
camera->attach(osg::Camera::COLOR_BUFFER, mOverlayTexture);
|
camera->attach(osg::Camera::COLOR_BUFFER, mOverlayTexture);
|
||||||
|
|
||||||
|
// no need for a depth buffer
|
||||||
|
camera->setImplicitBufferAttachmentMask(osg::DisplaySettings::IMPLICIT_COLOR_BUFFER_ATTACHMENT);
|
||||||
|
|
||||||
if (cpuCopy)
|
if (cpuCopy)
|
||||||
{
|
{
|
||||||
// Attach an image to copy the render back to the CPU when finished
|
// Attach an image to copy the render back to the CPU when finished
|
||||||
|
@ -286,10 +289,12 @@ namespace MWRender
|
||||||
{
|
{
|
||||||
osg::ref_ptr<osg::Geometry> geom = createTexturedQuad(srcLeft, srcTop, srcRight, srcBottom);
|
osg::ref_ptr<osg::Geometry> geom = createTexturedQuad(srcLeft, srcTop, srcRight, srcBottom);
|
||||||
osg::ref_ptr<osg::Depth> depth = new osg::Depth;
|
osg::ref_ptr<osg::Depth> depth = new osg::Depth;
|
||||||
depth->setFunction(osg::Depth::ALWAYS);
|
depth->setWriteMask(0);
|
||||||
geom->getOrCreateStateSet()->setAttributeAndModes(depth, osg::StateAttribute::ON);
|
osg::StateSet* stateset = geom->getOrCreateStateSet();
|
||||||
geom->getOrCreateStateSet()->setTextureAttributeAndModes(0, texture, osg::StateAttribute::ON);
|
stateset->setAttribute(depth);
|
||||||
geom->getOrCreateStateSet()->setMode(GL_LIGHTING, osg::StateAttribute::OFF);
|
stateset->setTextureAttributeAndModes(0, texture, osg::StateAttribute::ON);
|
||||||
|
stateset->setMode(GL_LIGHTING, osg::StateAttribute::OFF);
|
||||||
|
stateset->setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF);
|
||||||
osg::ref_ptr<osg::Geode> geode = new osg::Geode;
|
osg::ref_ptr<osg::Geode> geode = new osg::Geode;
|
||||||
geode->addDrawable(geom);
|
geode->addDrawable(geom);
|
||||||
camera->addChild(geode);
|
camera->addChild(geode);
|
||||||
|
|
Loading…
Reference in a new issue