mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-03 13:09:40 +00:00
only enable soft particles when enabled in settings
This commit is contained in:
parent
11d1a54626
commit
a0265ffb89
3 changed files with 8 additions and 0 deletions
|
@ -548,6 +548,7 @@ namespace MWRender
|
|||
|
||||
mPostProcessor = new PostProcessor(*this, viewer, mRootNode, resourceSystem->getVFS());
|
||||
resourceSystem->getSceneManager()->setOpaqueDepthTex(mPostProcessor->getTexture(PostProcessor::Tex_OpaqueDepth, 0), mPostProcessor->getTexture(PostProcessor::Tex_OpaqueDepth, 1));
|
||||
resourceSystem->getSceneManager()->setSoftParticles(mPostProcessor->softParticlesEnabled());
|
||||
resourceSystem->getSceneManager()->setSupportsNormalsRT(mPostProcessor->getSupportsNormalsRT());
|
||||
|
||||
// water goes after terrain for correct waterculling order
|
||||
|
|
|
@ -198,6 +198,9 @@ namespace Resource
|
|||
void setSupportsNormalsRT(bool supports) { mSupportsNormalsRT = supports; }
|
||||
bool getSupportsNormalsRT() const { return mSupportsNormalsRT; }
|
||||
|
||||
void setSoftParticles(bool enabled) { mSoftParticles = enabled; }
|
||||
bool getSoftParticles() const { return mSoftParticles; }
|
||||
|
||||
private:
|
||||
|
||||
Shader::ShaderVisitor* createShaderVisitor(const std::string& shaderPrefix = "objects");
|
||||
|
@ -216,6 +219,7 @@ namespace Resource
|
|||
bool mConvertAlphaTestToAlphaToCoverage;
|
||||
bool mSupportsNormalsRT;
|
||||
std::array<osg::ref_ptr<osg::Texture>, 2> mOpaqueDepthTex;
|
||||
bool mSoftParticles = false;
|
||||
|
||||
osg::ref_ptr<Resource::SharedStateManager> mSharedStateManager;
|
||||
mutable std::mutex mSharedStateMutex;
|
||||
|
|
|
@ -20,6 +20,9 @@ namespace SceneUtil
|
|||
{
|
||||
void ProcessExtraDataVisitor::setupSoftEffect(osg::Node& node, float size, bool falloff)
|
||||
{
|
||||
if (!mSceneMgr->getSoftParticles())
|
||||
return;
|
||||
|
||||
const int unitSoftEffect = mSceneMgr->getShaderManager().reserveGlobalTextureUnits(Shader::ShaderManager::Slot::OpaqueDepthTexture);
|
||||
static const osg::ref_ptr<SceneUtil::AutoDepth> depth = new SceneUtil::AutoDepth(osg::Depth::LESS, 0, 1, false);
|
||||
|
||||
|
|
Loading…
Reference in a new issue