mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-01 04:20:20 +00:00
Added a uniform to indicate whether rendering is occurring in a reflection
This commit is contained in:
parent
bf0865d03d
commit
df7d2e46c0
@ -173,6 +173,7 @@ namespace MWRender
|
|||||||
stateset->addUniform(new osg::Uniform("far", 0.f));
|
stateset->addUniform(new osg::Uniform("far", 0.f));
|
||||||
stateset->addUniform(new osg::Uniform("skyBlendingStart", 0.f));
|
stateset->addUniform(new osg::Uniform("skyBlendingStart", 0.f));
|
||||||
stateset->addUniform(new osg::Uniform("screenRes", osg::Vec2f{}));
|
stateset->addUniform(new osg::Uniform("screenRes", osg::Vec2f{}));
|
||||||
|
stateset->addUniform(new osg::Uniform("isReflection", false));
|
||||||
if (mUsePlayerUniforms)
|
if (mUsePlayerUniforms)
|
||||||
{
|
{
|
||||||
stateset->addUniform(new osg::Uniform("windSpeed", 0.0f));
|
stateset->addUniform(new osg::Uniform("windSpeed", 0.0f));
|
||||||
|
@ -351,6 +351,9 @@ public:
|
|||||||
camera->setName("ReflectionCamera");
|
camera->setName("ReflectionCamera");
|
||||||
camera->addCullCallback(new InheritViewPointCallback);
|
camera->addCullCallback(new InheritViewPointCallback);
|
||||||
|
|
||||||
|
// Inform the shader that we're in a reflection
|
||||||
|
camera->getOrCreateStateSet()->addUniform(new osg::Uniform("isReflection", true));
|
||||||
|
|
||||||
// XXX: should really flip the FrontFace on each renderable instead of forcing clockwise.
|
// XXX: should really flip the FrontFace on each renderable instead of forcing clockwise.
|
||||||
osg::ref_ptr<osg::FrontFace> frontFace(new osg::FrontFace);
|
osg::ref_ptr<osg::FrontFace> frontFace(new osg::FrontFace);
|
||||||
frontFace->setMode(osg::FrontFace::CLOCKWISE);
|
frontFace->setMode(osg::FrontFace::CLOCKWISE);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user