mirror of
https://github.com/cds-astro/aladin-lite.git
synced 2026-06-12 11:01:37 -07:00
26 lines
609 B
GLSL
26 lines
609 B
GLSL
#version 300 es
|
|
precision highp float;
|
|
|
|
in vec2 v_tc;
|
|
out vec4 color;
|
|
|
|
uniform sampler2D fbo_tex;
|
|
|
|
// 0-255 sRGB from 0-1 linear
|
|
vec3 srgb_from_linear(vec3 rgb) {
|
|
bvec3 cutoff = lessThan(rgb, vec3(0.0031308));
|
|
vec3 lower = rgb * vec3(3294.6);
|
|
vec3 higher = vec3(269.025) * pow(rgb, vec3(1.0 / 2.4)) - vec3(14.025);
|
|
return mix(higher, lower, vec3(cutoff));
|
|
}
|
|
|
|
// 0-255 sRGBA from 0-1 linear
|
|
vec4 srgba_from_linear(vec4 rgba) {
|
|
return vec4(srgb_from_linear(rgba.rgb), 255.0 * rgba.a);
|
|
}
|
|
|
|
void main() {
|
|
color = texture(fbo_tex, v_tc);
|
|
|
|
//color = srgba_from_linear(color) / 255.;
|
|
} |