forked from mirror/openmw-tes3mp
Merge pull request #68 from OpenMW/master
Use a shader to render the simple water, ensuring that fog is applied…
This commit is contained in:
commit
ae00f12c87
1 changed files with 9 additions and 0 deletions
|
@ -23,6 +23,7 @@
|
|||
|
||||
#include <components/resource/resourcesystem.hpp>
|
||||
#include <components/resource/imagemanager.hpp>
|
||||
#include <components/resource/scenemanager.hpp>
|
||||
|
||||
#include <components/sceneutil/waterutil.hpp>
|
||||
|
||||
|
@ -507,6 +508,14 @@ void Water::createSimpleWaterStateSet(osg::Node* node, float alpha)
|
|||
node->setUpdateCallback(controller);
|
||||
|
||||
stateset->setTextureAttributeAndModes(0, textures[0], osg::StateAttribute::ON);
|
||||
|
||||
// use a shader to render the simple water, ensuring that fog is applied per pixel as required.
|
||||
// this could be removed if a more detailed water mesh, using some sort of paging solution, is implemented.
|
||||
Resource::SceneManager* sceneManager = mResourceSystem->getSceneManager();
|
||||
bool oldValue = sceneManager->getForceShaders();
|
||||
sceneManager->setForceShaders(true);
|
||||
sceneManager->recreateShaders(node);
|
||||
sceneManager->setForceShaders(oldValue);
|
||||
}
|
||||
|
||||
void Water::createShaderWaterStateSet(osg::Node* node, Reflection* reflection, Refraction* refraction)
|
||||
|
|
Loading…
Reference in a new issue