mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-16 08:39:42 +00:00
ensure distortion is only rendered once
This commit is contained in:
parent
45362e0ede
commit
4d7e9bae73
1 changed files with 7 additions and 0 deletions
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
#include <osg/FrameBufferObject>
|
#include <osg/FrameBufferObject>
|
||||||
|
|
||||||
|
#include "postprocessor.hpp"
|
||||||
|
|
||||||
namespace MWRender
|
namespace MWRender
|
||||||
{
|
{
|
||||||
void DistortionCallback::drawImplementation(
|
void DistortionCallback::drawImplementation(
|
||||||
|
@ -10,6 +12,11 @@ namespace MWRender
|
||||||
osg::State* state = renderInfo.getState();
|
osg::State* state = renderInfo.getState();
|
||||||
size_t frameId = state->getFrameStamp()->getFrameNumber() % 2;
|
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);
|
mFBO[frameId]->apply(*state);
|
||||||
|
|
||||||
const osg::Texture* tex
|
const osg::Texture* tex
|
||||||
|
|
Loading…
Reference in a new issue