mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-05 15:40:10 +00:00
Merge branch 'osgshadow-test-vdsm' into osgshadow-test-vdsm-sky-method-two
This commit is contained in:
commit
b0c0c88201
@ -206,7 +206,7 @@ namespace MWRender
|
|||||||
|
|
||||||
osgShadow::ShadowSettings* settings = shadowedScene->getShadowSettings();
|
osgShadow::ShadowSettings* settings = shadowedScene->getShadowSettings();
|
||||||
settings->setLightNum(0);
|
settings->setLightNum(0);
|
||||||
settings->setCastsShadowTraversalMask(Mask_Scene|Mask_Actor|Mask_Player);
|
settings->setCastsShadowTraversalMask(Mask_Scene|Mask_Actor|Mask_Player|Mask_Terrain);
|
||||||
settings->setReceivesShadowTraversalMask(~0u);
|
settings->setReceivesShadowTraversalMask(~0u);
|
||||||
|
|
||||||
//settings->setShadowMapProjectionHint(osgShadow::ShadowSettings::PERSPECTIVE_SHADOW_MAP);
|
//settings->setShadowMapProjectionHint(osgShadow::ShadowSettings::PERSPECTIVE_SHADOW_MAP);
|
||||||
@ -268,7 +268,7 @@ namespace MWRender
|
|||||||
mViewer->setLightingMode(osgViewer::View::NO_LIGHT);
|
mViewer->setLightingMode(osgViewer::View::NO_LIGHT);
|
||||||
|
|
||||||
osg::ref_ptr<osg::LightSource> source = new osg::LightSource;
|
osg::ref_ptr<osg::LightSource> source = new osg::LightSource;
|
||||||
//source->setNodeMask(Mask_Lighting);
|
source->setNodeMask(Mask_Lighting);
|
||||||
mSunLight = new osg::Light;
|
mSunLight = new osg::Light;
|
||||||
source->setLight(mSunLight);
|
source->setLight(mSunLight);
|
||||||
mSunLight->setDiffuse(osg::Vec4f(0,0,0,1));
|
mSunLight->setDiffuse(osg::Vec4f(0,0,0,1));
|
||||||
@ -315,8 +315,7 @@ namespace MWRender
|
|||||||
mViewer->getCamera()->setComputeNearFarMode(osg::Camera::DO_NOT_COMPUTE_NEAR_FAR);
|
mViewer->getCamera()->setComputeNearFarMode(osg::Camera::DO_NOT_COMPUTE_NEAR_FAR);
|
||||||
mViewer->getCamera()->setCullingMode(cullingMode);
|
mViewer->getCamera()->setCullingMode(cullingMode);
|
||||||
|
|
||||||
//mViewer->getCamera()->setCullMask(~(Mask_UpdateVisitor|Mask_SimpleWater));
|
mViewer->getCamera()->setCullMask(~(Mask_UpdateVisitor|Mask_SimpleWater));
|
||||||
mViewer->getCamera()->setCullMask(~(Mask_Lighting));
|
|
||||||
|
|
||||||
mNearClip = Settings::Manager::getFloat("near clip", "Camera");
|
mNearClip = Settings::Manager::getFloat("near clip", "Camera");
|
||||||
mViewDistance = Settings::Manager::getFloat("viewing distance", "Camera");
|
mViewDistance = Settings::Manager::getFloat("viewing distance", "Camera");
|
||||||
|
@ -18,7 +18,7 @@ namespace MWRender
|
|||||||
"void main(void) \n"
|
"void main(void) \n"
|
||||||
"{ \n"
|
"{ \n"
|
||||||
#if 1
|
#if 1
|
||||||
" float f = texture2D( texture, gl_TexCoord[0] ).r; \n"
|
" float f = texture2D( texture, gl_TexCoord[0].xy ).r; \n"
|
||||||
" \n"
|
" \n"
|
||||||
" f = 256.0 * f; \n"
|
" f = 256.0 * f; \n"
|
||||||
" float fC = floor( f ) / 256.0; \n"
|
" float fC = floor( f ) / 256.0; \n"
|
||||||
@ -45,7 +45,7 @@ namespace MWRender
|
|||||||
" \n"
|
" \n"
|
||||||
" gl_FragColor = vec4( fS + fH * color, 1 ); \n"
|
" gl_FragColor = vec4( fS + fH * color, 1 ); \n"
|
||||||
#else
|
#else
|
||||||
" gl_FragColor = texture2D(texture, gl_TexCoord[0]); \n"
|
" gl_FragColor = texture2D(texture, gl_TexCoord[0].xy); \n"
|
||||||
" //gl_FragColor = vec4(1.0, 0.5, 0.5, 1.0); \n"
|
" //gl_FragColor = vec4(1.0, 0.5, 0.5, 1.0); \n"
|
||||||
#endif
|
#endif
|
||||||
"} \n";
|
"} \n";
|
||||||
|
@ -51,6 +51,12 @@ void TerrainDrawable::cull(osgUtil::CullVisitor *cv)
|
|||||||
if (osg::isNaN(depth))
|
if (osg::isNaN(depth))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (cv->getCurrentCamera()->getName() == "ShadowCamera")
|
||||||
|
{
|
||||||
|
cv->addDrawableAndDepth(this, &matrix, depth);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
bool pushedLight = mLightListCallback && mLightListCallback->pushLightState(this, cv);
|
bool pushedLight = mLightListCallback && mLightListCallback->pushLightState(this, cv);
|
||||||
|
|
||||||
for (PassVector::const_iterator it = mPasses.begin(); it != mPasses.end(); ++it)
|
for (PassVector::const_iterator it = mPasses.begin(); it != mPasses.end(); ++it)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user