Changeset 55 for osgVisual/src/sky_Silverlining
- Timestamp:
- May 29, 2010, 11:52:47 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
osgVisual/src/sky_Silverlining/skySilverLining_skyDrawable.cpp
r53 r55 87 87 void skySilverLining_skyDrawable::setSceneFog(SilverLining::Atmosphere *atmosphere) const 88 88 { 89 //glEnable(GL_FOG);90 // glFogi(GL_FOG_MODE, GL_EXP);91 92 ////float hazeR, hazeG, hazeB;93 ////double hazeDepth, hazeDensity;94 ////atmosphere->GetHaze(hazeR, hazeG, hazeB, hazeDepth, hazeDensity);95 96 // //hazeDensity = 1.0 / 40000;97 ////hazeDensity = 0;98 //float hazeDensity = 1.0 / atmosphere->GetConditions()->GetVisibility();99 100 // // Decrease fog density with altitude, to avoid fog effects through the vacuum of space.101 // static const double H = 8435.0; // Pressure scale height of Earth's atmosphere102 // double isothermalEffect = exp(-(atmosphere->GetConditions()->GetLocation().GetAltitude() / H));103 // if (isothermalEffect <= 0) isothermalEffect = 1E-9;104 // if (isothermalEffect > 1.0) isothermalEffect = 1.0;105 // hazeDensity *= isothermalEffect;106 107 // bool silverLiningHandledTheFog = false;108 109 // if (atmosphere->GetFogEnabled())110 // {111 // float density, r, g, b;112 // // Note, the fog color returned is already lit113 // atmosphere->GetFogSettings(&density, &r, &g, &b);114 115 // if (density > hazeDensity)116 // {117 // glFogf(GL_FOG_DENSITY, density);118 119 // GLfloat fogColor[4] = {r, g, b, 1.0};120 // glFogfv(GL_FOG_COLOR, fogColor);121 122 // silverLiningHandledTheFog = true;123 // }124 // }125 //126 // if (!silverLiningHandledTheFog)127 // {128 // GLfloat fogColor[4];129 // //atmosphere->GetHorizonColor(yaw, &fogColor[0], &fogColor[1], &fogColor[2]); // New version of this call: SL_1.94 /** \todo transmit the yaw value of the center channel to all slaves for consistent fog color. */130 // atmosphere->GetHorizonColor( 0, &fogColor[0], &fogColor[1], &fogColor[2]);131 // glFogfv(GL_FOG_COLOR, fogColor);132 133 // glFogf(GL_FOG_DENSITY, hazeDensity);134 // }135 136 137 138 139 140 141 89 osg::ref_ptr<osg::Fog> fog = new osg::Fog; 142 90 fog->setMode(osg::Fog::EXP);
Note: See TracChangeset
for help on using the changeset viewer.