forked from speed-dreams/speed-dreams-code
- fix bug on OsgGraph with little rain
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@7062 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 02a58f3caf555c514aa6c406f81311098be23b24 Former-commit-id: 96598159364cf6af483163c9645713db4db86f09
This commit is contained in:
parent
61b93cf8d7
commit
826085435e
2 changed files with 8 additions and 7 deletions
|
@ -107,8 +107,9 @@ SDRender::SDRender(void) :
|
||||||
|
|
||||||
SDSunDeclination = 0.0f;
|
SDSunDeclination = 0.0f;
|
||||||
SDMoonDeclination = 0.0f;
|
SDMoonDeclination = 0.0f;
|
||||||
SDMax_Visibility = 12000.0f;
|
SDMax_Visibility = 20000.0f;
|
||||||
SDVisibility = 0.0f;
|
SDVisibility = 20000.0f;
|
||||||
|
SDRain = 0;
|
||||||
NStars = 0;
|
NStars = 0;
|
||||||
NPlanets = 0;
|
NPlanets = 0;
|
||||||
sol_angle = 0.0;
|
sol_angle = 0.0;
|
||||||
|
@ -364,7 +365,7 @@ void SDRender::Init(tTrack *track)
|
||||||
|
|
||||||
osg::ref_ptr<osgParticle::PrecipitationEffect> precipitationEffect = new osgParticle::PrecipitationEffect;
|
osg::ref_ptr<osgParticle::PrecipitationEffect> precipitationEffect = new osgParticle::PrecipitationEffect;
|
||||||
|
|
||||||
if (SDVisibility < 2000)
|
if (SDRain > 0)
|
||||||
{
|
{
|
||||||
sceneGroup->addChild(precipitationEffect.get());
|
sceneGroup->addChild(precipitationEffect.get());
|
||||||
}
|
}
|
||||||
|
@ -412,7 +413,8 @@ void SDRender::Init(tTrack *track)
|
||||||
stateSet = new osg::StateSet;
|
stateSet = new osg::StateSet;
|
||||||
stateSet = m_scene->getOrCreateStateSet();
|
stateSet = m_scene->getOrCreateStateSet();
|
||||||
stateSet->setMode(GL_DEPTH_TEST, osg::StateAttribute::ON);
|
stateSet->setMode(GL_DEPTH_TEST, osg::StateAttribute::ON);
|
||||||
if (SDVisibility < 2000)
|
|
||||||
|
if (SDRain > 0)
|
||||||
stateSet->setAttributeAndModes(precipitationEffect->getFog());
|
stateSet->setAttributeAndModes(precipitationEffect->getFog());
|
||||||
|
|
||||||
float emis = 0.5f * sky_brightness;
|
float emis = 0.5f * sky_brightness;
|
||||||
|
@ -854,8 +856,6 @@ void SDRender::weather(void)
|
||||||
cloudsTextureIndex2 = SDTrack->local.clouds2;
|
cloudsTextureIndex2 = SDTrack->local.clouds2;
|
||||||
cloudsTextureIndex3 = SDTrack->local.clouds3;
|
cloudsTextureIndex3 = SDTrack->local.clouds3;
|
||||||
|
|
||||||
unsigned int SDRain = 0;
|
|
||||||
|
|
||||||
switch (SDTrack->local.rain)
|
switch (SDTrack->local.rain)
|
||||||
{
|
{
|
||||||
case TR_RAIN_NONE:
|
case TR_RAIN_NONE:
|
||||||
|
|
|
@ -78,6 +78,7 @@ private:
|
||||||
float SDMoonDeclination;
|
float SDMoonDeclination;
|
||||||
float SDMax_Visibility;
|
float SDMax_Visibility;
|
||||||
double SDVisibility;
|
double SDVisibility;
|
||||||
|
unsigned int SDRain;
|
||||||
unsigned ShadowIndex;
|
unsigned ShadowIndex;
|
||||||
unsigned TexSizeIndex;
|
unsigned TexSizeIndex;
|
||||||
unsigned QualityIndex;
|
unsigned QualityIndex;
|
||||||
|
|
Loading…
Reference in a new issue