Does anyone have docu for the dynamic lighting gadget?
Posted: 01 Dec 2012, 18:45
See topic.
Open Source Realtime Strategy Game Engine
https://springrts.com/phpbb/
Code: Select all
void DecayColors() {
const bool expAmbientDecay = (decayFunctionType.x != 0.0f);
const bool expDiffuseDecay = (decayFunctionType.y != 0.0f);
const bool expSpecularDecay = (decayFunctionType.z != 0.0f);
if (expAmbientDecay) {
ambientColor *= ambientDecayRate;
} else {
ambientColor -= ambientDecayRate;
}
if (expDiffuseDecay) {
diffuseColor *= diffuseDecayRate;
} else {
diffuseColor -= diffuseDecayRate;
}
if (expSpecularDecay) {
specularColor *= specularDecayRate;
} else {
specularColor -= specularDecayRate;
}
}