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

@ -178,11 +178,12 @@ enum GFXFormat
// 24 bit texture formats...
GFXFormatR8G8B8,// first in group...
GFXFormatR8G8B8_SRGB,
// 32 bit texture formats...
GFXFormatR8G8B8A8,// first in group...
GFXFormatR8G8B8X8,
GFXFormatB8G8R8A8,
GFXFormatR8G8B8A8_SRGB,
GFXFormatR32F,
GFXFormatR16G16,
GFXFormatR16G16F,
@ -192,9 +193,6 @@ enum GFXFormat
GFXFormatD24S8,
GFXFormatD24FS8,
// sRGB formats
GFXFormatR8G8B8A8_SRGB,
// Guaranteed RGBA8 (for apis which really dont like bgr)
GFXFormatR8G8B8A8_LINEAR_FORCE,
@ -205,12 +203,16 @@ enum GFXFormat
// 128 bit texture formats...
GFXFormatR32G32B32A32F,// first in group...
// unknown size...
GFXFormatDXT1,// first in group...
GFXFormatDXT2,
GFXFormatDXT3,
GFXFormatDXT4,
GFXFormatDXT5,
// unknown size...Block compression
GFXFormatBC1, //dxt1
GFXFormatBC2, //dxt2/3
GFXFormatBC3, //dxt4/5
GFXFormatBC4, //3dc+ / ati1
GFXFormatBC5, //3dc / ati2
// compressed sRGB formats
GFXFormatBC1_SRGB,
GFXFormatBC2_SRGB,
GFXFormatBC3_SRGB,
GFXFormat_COUNT,
@ -220,7 +222,7 @@ enum GFXFormat
GFXFormat_32BIT = GFXFormatR8G8B8A8,
GFXFormat_64BIT = GFXFormatR16G16B16A16,
GFXFormat_128BIT = GFXFormatR32G32B32A32F,
GFXFormat_UNKNOWNSIZE = GFXFormatDXT1,
GFXFormat_UNKNOWNSIZE = GFXFormatBC1
};
/// Returns the byte size of the pixel for non-compressed formats.