summaryrefslogtreecommitdiffstats
path: root/res/effectlib/fileTexture.glsllib
blob: 76a71ee0950acdeb38ea1828f787a0fbf6f19f83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
texture_return fileTexture( in sampler2D sampler, in vec3 colorOffset, in vec3 colorScale, in int monoSource, in texture_coordinate_info uvw
                          , in vec2 cropU, in vec2 cropV, in int wrapU, in int wrapV, in int gammaMode )
{
  vec4 t4 = texture( sampler, uvw.position.xy );
  vec3 t3 = colorOffset + colorScale * t4.xyz;

  // When we want to operate in linear color space uncomment the lines
  if ( gammaMode == gamma_srgb )
  {
    t3 = pow( t3, vec3( 2.2 ) );
  }

  texture_return tr;
  tr.tint = t3;
  tr.mono = monoChannel( vec4( t3, t4.w ), monoSource );
  return( tr );
}