1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-06 06:15:32 +00:00

Merge branch 'ripply-doll' into 'master'

Fix inventory doll when non-compute-shader ripples are used with FFP

See merge request OpenMW/openmw!4390
This commit is contained in:
Alexei Kotov 2024-10-02 08:43:41 +00:00
commit 56e200f8ac
2 changed files with 17 additions and 5 deletions

View file

@ -206,8 +206,14 @@ namespace MWRender
};
// PASS: Blot in all ripple spawners
mProgramBlobber->apply(state);
state.apply(frameState.mStateset);
state.pushStateSet(frameState.mStateset);
state.apply();
state.applyAttribute(mProgramBlobber);
for (const auto& [name, stack] : state.getUniformMap())
{
if (!stack.uniformVec.empty())
state.getLastAppliedProgramObject()->apply(*(stack.uniformVec.back().first));
}
if (mUseCompute)
{
@ -225,8 +231,12 @@ namespace MWRender
}
// PASS: Wave simulation
mProgramSimulation->apply(state);
state.apply(frameState.mStateset);
state.applyAttribute(mProgramSimulation);
for (const auto& [name, stack] : state.getUniformMap())
{
if (!stack.uniformVec.empty())
state.getLastAppliedProgramObject()->apply(*(stack.uniformVec.back().first));
}
if (mUseCompute)
{
@ -242,6 +252,8 @@ namespace MWRender
state.applyTextureAttribute(0, mTextures[1]);
osg::Geometry::drawImplementation(renderInfo);
}
state.popStateSet();
}
osg::Texture* RipplesSurface::getColorTexture() const

View file

@ -239,7 +239,7 @@ namespace Debug
group->push(state);
lastAppliedStack.push_back(group);
}
if (!(lastAppliedStack.back() == this))
if (lastAppliedStack.empty() || !(lastAppliedStack.back() == this))
{
push(state);
lastAppliedStack.push_back(this);