summaryrefslogtreecommitdiffstats
path: root/res/effectlib/fileTexture.glsllib
diff options
context:
space:
mode:
Diffstat (limited to 'res/effectlib/fileTexture.glsllib')
-rw-r--r--res/effectlib/fileTexture.glsllib17
1 files changed, 17 insertions, 0 deletions
diff --git a/res/effectlib/fileTexture.glsllib b/res/effectlib/fileTexture.glsllib
new file mode 100644
index 0000000..76a71ee
--- /dev/null
+++ b/res/effectlib/fileTexture.glsllib
@@ -0,0 +1,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 );
+}