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 8780f83262
commit 25686ed4be
294 changed files with 3894 additions and 2813 deletions

View file

@ -248,7 +248,7 @@ Precipitation::Precipitation()
mDropAnimateMS = 0;
mUseLighting = false;
mGlowIntensity = ColorF( 0,0,0,0 );
mGlowIntensity = LinearColorF( 0,0,0,0 );
mReflect = false;
@ -604,7 +604,7 @@ void Precipitation::initMaterials()
mDropShader = NULL;
mSplashShader = NULL;
if( dStrlen(pd->mDropName) > 0 && !mDropHandle.set(pd->mDropName, &GFXDefaultStaticDiffuseProfile, avar("%s() - mDropHandle (line %d)", __FUNCTION__, __LINE__)) )
if( dStrlen(pd->mDropName) > 0 && !mDropHandle.set(pd->mDropName, &GFXStaticTextureSRGBProfile, avar("%s() - mDropHandle (line %d)", __FUNCTION__, __LINE__)) )
Con::warnf("Precipitation::initMaterials - failed to locate texture '%s'!", pd->mDropName);
if ( dStrlen(pd->mDropShaderName) > 0 )
@ -625,7 +625,7 @@ void Precipitation::initMaterials()
}
}
if( dStrlen(pd->mSplashName) > 0 && !mSplashHandle.set(pd->mSplashName, &GFXDefaultStaticDiffuseProfile, avar("%s() - mSplashHandle (line %d)", __FUNCTION__, __LINE__)) )
if( dStrlen(pd->mSplashName) > 0 && !mSplashHandle.set(pd->mSplashName, &GFXStaticTextureSRGBProfile, avar("%s() - mSplashHandle (line %d)", __FUNCTION__, __LINE__)) )
Con::warnf("Precipitation::initMaterials - failed to locate texture '%s'!", pd->mSplashName);
if ( dStrlen(pd->mSplashShaderName) > 0 )
@ -1581,7 +1581,7 @@ void Precipitation::renderObject(ObjectRenderInst *ri, SceneRenderState *state,
// shader. Once the lighting and shadow systems
// are added into TSE we can expand this to include
// the N nearest lights to the camera + the ambient.
ColorF ambient( 1, 1, 1 );
LinearColorF ambient( 1, 1, 1 );
if ( mUseLighting )
{
const LightInfo *sunlight = LIGHTMGR->getSpecialLight(LightManager::slSunLightType);