Implementation of sRGB image support. Overhauls the linearization setup to utilize the sRGB image types, as well as refactors the use of ColorF and ColorI to be properly internally consistent. ColorIs are used only for front-facing/editing/UI settings, and ColorFs, now renamed to LinearColorF to reduce confusion of purpose, are used for color info in the engine itself. This avoids confusing and expensive conversions back and forth between types and avoids botches with linearity. Majority work done by @rextimmy

This commit is contained in:
Areloch 2017-06-23 11:36:20 -05:00
parent 8943c673fb
commit 0801a3cca8
294 changed files with 3894 additions and 2813 deletions

View file

@ -378,7 +378,7 @@ F32 TimeOfDay::_calcAzimuth( F32 lat, F32 dec, F32 mer )
return mAtan2( mSin(mer), mCos(mer) * mSin(lat) - mTan(dec) * mCos(lat) ) + M_PI_F;
}
void TimeOfDay::_getSunColor( ColorF *outColor ) const
void TimeOfDay::_getSunColor( LinearColorF *outColor ) const
{
const COLOR_TARGET *ct = NULL;
@ -451,8 +451,8 @@ void TimeOfDay::_initColors()
// NOTE: The elevation targets represent distances
// from PI/2 radians (strait up).
ColorF c;
ColorF bc;
LinearColorF c;
LinearColorF bc;
// e is for elevation
F32 e = M_PI_F / 13.0f; // (semicircle in radians)/(number of color target entries);
@ -495,7 +495,7 @@ void TimeOfDay::_initColors()
_addColorTarget(M_PI_F, c, 1.0f, c); // Midnight at equanox.
}
void TimeOfDay::_addColorTarget( F32 ele, const ColorF &color, F32 bandMod, const ColorF &bandColor )
void TimeOfDay::_addColorTarget( F32 ele, const LinearColorF &color, F32 bandMod, const LinearColorF &bandColor )
{
COLOR_TARGET newTarget;