1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-19 22:53:53 +00:00

Merge branch 'particles_fix' into 'master'

Create a stateset for every particle system to create its own defineMap

Closes #7304

See merge request OpenMW/openmw!3162

(cherry picked from commit 558b3cbf60)

a08d921c Create a stateset for every particle system to create its own defineMap
This commit is contained in:
psi29a 2023-06-21 14:35:13 +00:00
parent 6ea1c2b422
commit 95da78ace0

View file

@ -848,6 +848,11 @@ namespace Shader
{ {
bool needPop = drawable.getStateSet() || mRequirements.empty(); bool needPop = drawable.getStateSet() || mRequirements.empty();
// We need to push and pop a requirements object because particle systems can have
// different shader requirements to other drawables, so might need a different shader variant.
if (!needPop && dynamic_cast<osgParticle::ParticleSystem*>(&drawable))
needPop = true;
if (needPop) if (needPop)
{ {
pushRequirements(drawable); pushRequirements(drawable);