mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-11 22:54:34 +00:00
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:
parent
8780f83262
commit
25686ed4be
294 changed files with 3894 additions and 2813 deletions
|
|
@ -44,8 +44,8 @@ public:
|
|||
String diffuseMap;
|
||||
String normalMap;
|
||||
String specularMap;
|
||||
ColorF diffuseColor;
|
||||
ColorF specularColor;
|
||||
LinearColorF diffuseColor;
|
||||
LinearColorF specularColor;
|
||||
F32 specularPower;
|
||||
bool doubleSided;
|
||||
|
||||
|
|
@ -56,7 +56,7 @@ public:
|
|||
String getName() const { return name; }
|
||||
|
||||
void resolveFloat(const domCommon_float_or_param_type* value, F32* dst);
|
||||
void resolveColor(const domCommon_color_or_texture_type* value, ColorF* dst);
|
||||
void resolveColor(const domCommon_color_or_texture_type* value, LinearColorF* dst);
|
||||
|
||||
// Determine the material transparency
|
||||
template<class T> void resolveTransparency(const T shader, F32* dst)
|
||||
|
|
@ -66,7 +66,7 @@ public:
|
|||
resolveFloat(shader->getTransparency(), dst);
|
||||
|
||||
// Multiply the transparency by the transparent color
|
||||
ColorF transColor(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
LinearColorF transColor(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
if (shader->getTransparent() && shader->getTransparent()->getColor()) {
|
||||
const domCommon_color_or_texture_type::domColor* color = shader->getTransparent()->getColor();
|
||||
transColor.set(color->getValue()[0], color->getValue()[1], color->getValue()[2], color->getValue()[3]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue