mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 16:14:38 +00:00
diffuse/albedo texture linearization
http://http.developer.nvidia.com/GPUGems3/gpugems3_ch24.html
This commit is contained in:
parent
51b6469922
commit
ce2964d2d0
31 changed files with 396 additions and 107 deletions
|
|
@ -28,6 +28,8 @@ uniform sampler2D backBuffer;
|
|||
uniform sampler1D colorCorrectionTex;
|
||||
|
||||
uniform float OneOverGamma;
|
||||
uniform float Brightness;
|
||||
uniform float Contrast;
|
||||
|
||||
in vec2 uv0;
|
||||
|
||||
|
|
@ -45,5 +47,11 @@ void main()
|
|||
// Apply gamma correction
|
||||
color.rgb = pow( abs(color.rgb), vec3(OneOverGamma) );
|
||||
|
||||
// Apply contrast
|
||||
color.rgb = ((color.rgb - 0.5f) * Contrast) + 0.5f;
|
||||
|
||||
// Apply brightness
|
||||
color.rgb += Brightness;
|
||||
|
||||
OUT_col = color;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue