Merge branch 'first_person_mesh_distortion' into 'master'

Fix distortion breaking in first person meshes

See merge request OpenMW/openmw!4231
pull/3236/head
psi29a 6 months ago
commit e8c422697f

@ -2,6 +2,8 @@
#include <osg/FrameBufferObject>
#include "postprocessor.hpp"
namespace MWRender
{
void DistortionCallback::drawImplementation(
@ -10,6 +12,11 @@ namespace MWRender
osg::State* state = renderInfo.getState();
size_t frameId = state->getFrameStamp()->getFrameNumber() % 2;
PostProcessor* postProcessor = dynamic_cast<PostProcessor*>(renderInfo.getCurrentCamera()->getUserData());
if (!postProcessor || bin->getStage()->getFrameBufferObject() != postProcessor->getPrimaryFbo(frameId))
return;
mFBO[frameId]->apply(*state);
const osg::Texture* tex

@ -37,7 +37,8 @@ namespace SceneUtil
osg::StateSet* stateset = node.getOrCreateStateSet();
stateset->setRenderBinDetails(14, "Distortion", osg::StateSet::OVERRIDE_RENDERBIN_DETAILS);
stateset->setNestRenderBins(false);
stateset->setRenderBinDetails(14, "Distortion", osg::StateSet::OVERRIDE_PROTECTED_RENDERBIN_DETAILS);
stateset->addUniform(new osg::Uniform("distortionStrength", distortionStrength));
stateset->setAttributeAndModes(depth, osg::StateAttribute::ON);

Loading…
Cancel
Save