Fish
28-06-2009 21:44:40
Here is a zip containing some of the Caelum 0.4 shaders converted to GLSL. It looks like the final 0.4 shaders are a little different from the ones we converted, but they should work anyway. We also had to change two lines of code in SkyDome.cpp to work with the GLSL shaders:
line 150 from:
to:
I can't guarantee that these converted shaders will work for everyone, but hopefully it will relieve some pain when you try to free yourself from the Cg dependency.
-Fish
[attachment=0]Caelum0_4_GLSL.zip[/attachment]
line 150 from:
Ogre::Pass *pass = mMaterial->getTechnique (0)->getPass (0);
if (value) {
pass->setFragmentProgram("CaelumSkyDomeFP");
} else {
pass->setFragmentProgram("CaelumSkyDomeFP_NoHaze");
}
Ogre::GpuProgramParametersSharedPtr params = pass->getFragmentProgramParameters();
params->setIgnoreMissingParams(true);
to:
Ogre::Pass *pass = mMaterial->getTechnique (0)->getPass (0);
if (value) {
pass->setFragmentProgram("CaelumSkyDomeFP_glsl");
} else {
pass->setFragmentProgram("CaelumSkyDomeFP_NoHaze_glsl");
}
Ogre::GpuProgramParametersSharedPtr params = pass->getFragmentProgramParameters();
params->setIgnoreMissingParams(true);
}
I can't guarantee that these converted shaders will work for everyone, but hopefully it will relieve some pain when you try to free yourself from the Cg dependency.
-Fish
[attachment=0]Caelum0_4_GLSL.zip[/attachment]