mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 08:34:40 +00:00
vec3 variants for toLinear and toGamma
This commit is contained in:
parent
79f8b819ea
commit
07224ecd97
4 changed files with 96 additions and 2 deletions
|
|
@ -304,6 +304,15 @@ vec4 toGamma(vec4 tex)
|
|||
{
|
||||
return tex;
|
||||
}
|
||||
vec3 toLinear(vec3 tex)
|
||||
{
|
||||
return tex;
|
||||
}
|
||||
// Encodes gamma.
|
||||
vec3 toGamma(vec3 tex)
|
||||
{
|
||||
return tex;
|
||||
}
|
||||
#else
|
||||
// Sample in linear space. Decodes gamma.
|
||||
vec4 toLinear(vec4 tex)
|
||||
|
|
@ -315,6 +324,16 @@ vec4 toGamma(vec4 tex)
|
|||
{
|
||||
return vec4(pow(abs(tex.rgb), vec3(1.0/2.2)), tex.a);
|
||||
}
|
||||
// Sample in linear space. Decodes gamma.
|
||||
vec3 toLinear(vec3 tex)
|
||||
{
|
||||
return pow(abs(tex), vec3(2.2));
|
||||
}
|
||||
// Encodes gamma.
|
||||
vec3 toGamma(vec3 tex)
|
||||
{
|
||||
return pow(abs(tex), vec3(1.0/2.2));
|
||||
}
|
||||
#endif //
|
||||
|
||||
#endif // _TORQUE_GLSL_
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue