mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 16:44:36 +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
|
|
@ -41,6 +41,8 @@ uniform float3 g_fBlueShiftColor;
|
|||
uniform float g_fBloomScale;
|
||||
|
||||
uniform float g_fOneOverGamma;
|
||||
uniform float Brightness;
|
||||
uniform float Contrast;
|
||||
|
||||
|
||||
float4 main( PFXVertToPix IN ) : COLOR0
|
||||
|
|
@ -90,6 +92,12 @@ float4 main( PFXVertToPix IN ) : COLOR0
|
|||
|
||||
// Apply gamma correction
|
||||
sample.rgb = pow( abs(sample.rgb), g_fOneOverGamma );
|
||||
|
||||
// Apply contrast
|
||||
sample.rgb = ((sample.rgb - 0.5f) * Contrast) + 0.5f;
|
||||
|
||||
// Apply brightness
|
||||
sample.rgb += Brightness;
|
||||
|
||||
return sample;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,6 +42,8 @@ uniform vec3 g_fBlueShiftColor;
|
|||
uniform float g_fBloomScale;
|
||||
|
||||
uniform float g_fOneOverGamma;
|
||||
uniform float Brightness;
|
||||
uniform float Contrast;
|
||||
|
||||
out vec4 OUT_col;
|
||||
|
||||
|
|
@ -93,6 +95,12 @@ void main()
|
|||
|
||||
// Apply gamma correction
|
||||
_sample.rgb = pow( abs(_sample.rgb), vec3(g_fOneOverGamma) );
|
||||
|
||||
// Apply contrast
|
||||
_sample.rgb = ((_sample.rgb - 0.5f) * Contrast) + 0.5f;
|
||||
|
||||
// Apply brightness
|
||||
_sample.rgb += Brightness;
|
||||
|
||||
OUT_col = _sample;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue