Merge branch 'ripply-doll' into 'master'

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

See merge request OpenMW/openmw!4390
pull/3236/head
Alexei Kotov 3 months ago
commit 56e200f8ac

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

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

Loading…
Cancel
Save