32 , mGroundPasses(std::vector<
Ogre::Pass*>())
43 GroundPass->setVertexProgram(
"SkyX_Ground_VP");
46 GroundPass->setFragmentProgram(
"SkyX_Ground_LDR_FP");
50 GroundPass->setFragmentProgram(
"SkyX_Ground_HDR_FP");
53 GroundPass->getVertexProgramParameters()->setNamedConstant(
"uSkydomeRadius", AtmosphereRadius*10);
55 GroundPass->setLightingEnabled(
false);
57 GroundPass->setDepthCheckEnabled(
true);
58 GroundPass->setDepthWriteEnabled(
false);
60 GroundPass->setSceneBlending(SBT);
70 Ogre::String fp_name =
"SkyX_Ground_HDR_FP";
74 fp_name =
"SkyX_Ground_LDR_FP";
86 ->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setHardwareGammaEnabled(gammaCorrection);
89 static_cast<Ogre::MaterialPtr
>(Ogre::MaterialManager::getSingleton().getByName(
getMoonMaterialName()))
90 ->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setHardwareGammaEnabled(gammaCorrection);
91 static_cast<Ogre::MaterialPtr
>(Ogre::MaterialManager::getSingleton().getByName(
getMoonMaterialName()))
92 ->getTechnique(0)->getPass(0)->getTextureUnitState(1)->setHardwareGammaEnabled(gammaCorrection);
106 Ogre::GpuProgramParametersSharedPtr Parameters;
112 Parameters =
mSkydomeMaterial->getTechnique(0)->getPass(0)->getVertexProgramParameters();
118 Parameters =
mSkydomeMaterial->getTechnique(0)->getPass(0)->getFragmentProgramParameters();
123 Parameters->setNamedConstant(Name, Value);
125 if (!UpdateGroundPasses)
130 std::vector<Ogre::Pass*>::iterator PassIt;
144 Parameters = (*PassIt)->getVertexProgramParameters();
150 Parameters = (*PassIt)->getFragmentProgramParameters();
155 Parameters->setNamedConstant(Name, Value);
166 Ogre::GpuProgramParametersSharedPtr Parameters;
172 Parameters =
mSkydomeMaterial->getTechnique(0)->getPass(0)->getVertexProgramParameters();
178 Parameters =
mSkydomeMaterial->getTechnique(0)->getPass(0)->getFragmentProgramParameters();
183 Parameters->setNamedConstant(Name, Value);
185 if (!UpdateGroundPasses)
190 std::vector<Ogre::Pass*>::iterator PassIt;
204 Parameters = (*PassIt)->getVertexProgramParameters();
210 Parameters = (*PassIt)->getFragmentProgramParameters();
215 Parameters->setNamedConstant(Name, Value);
226 Ogre::GpuProgramParametersSharedPtr Parameters;
232 Parameters =
mSkydomeMaterial->getTechnique(0)->getPass(0)->getVertexProgramParameters();
238 Parameters =
mSkydomeMaterial->getTechnique(0)->getPass(0)->getFragmentProgramParameters();
243 float Value_[2] = {Value.x, Value.y};
245 Parameters->setNamedConstant(Name, Value_, 1, 2);
247 if (!UpdateGroundPasses)
252 std::vector<Ogre::Pass*>::iterator PassIt;
266 Parameters = (*PassIt)->getVertexProgramParameters();
272 Parameters = (*PassIt)->getFragmentProgramParameters();
277 Parameters->setNamedConstant(Name, Value_, 1, 2);
288 Ogre::GpuProgramParametersSharedPtr Parameters;
294 Parameters =
mSkydomeMaterial->getTechnique(0)->getPass(0)->getVertexProgramParameters();
300 Parameters =
mSkydomeMaterial->getTechnique(0)->getPass(0)->getFragmentProgramParameters();
305 Parameters->setNamedConstant(Name, Value);
307 if (!UpdateGroundPasses)
312 std::vector<Ogre::Pass*>::iterator PassIt;
326 Parameters = (*PassIt)->getVertexProgramParameters();
332 Parameters = (*PassIt)->getFragmentProgramParameters();
337 Parameters->setNamedConstant(Name, Value);
350 Ogre::TexturePtr tex = Ogre::TextureManager::getSingleton().getByName(n);
356 if (!tex->isHardwareGammaEnabled())
358 tex->setHardwareGammaEnabled(
true);
364 if (tex->isHardwareGammaEnabled())
366 tex->setHardwareGammaEnabled(
false);