mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-11 00:44:33 +00:00
ensure distortion is only rendered once
This commit is contained in:
parent
45362e0ede
commit
4d7e9bae73
@ -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…
x
Reference in New Issue
Block a user