mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-29 02:55:36 -05:00
47 lines
1.4 KiB
Text
47 lines
1.4 KiB
Text
|
#version 300 es
|
||
|
layout(location=0) out mediump vec4 _glesFragData[4];
|
||
|
uniform sampler2D _MainTex;
|
||
|
uniform sampler2D _Curve;
|
||
|
uniform highp float _RangeScale;
|
||
|
in highp vec2 xlv_TEXCOORD0;
|
||
|
void main ()
|
||
|
{
|
||
|
highp float newLum_1;
|
||
|
highp vec3 cie_2;
|
||
|
highp vec4 color_3;
|
||
|
lowp vec4 tmpvar_4;
|
||
|
tmpvar_4 = texture (_MainTex, xlv_TEXCOORD0);
|
||
|
color_3 = tmpvar_4;
|
||
|
highp vec3 Yxy_5;
|
||
|
highp vec3 tmpvar_6;
|
||
|
tmpvar_6 = (mat3(0.514136, 0.265068, 0.0241188, 0.323879, 0.670234, 0.122818, 0.160364, 0.0640916, 0.844427) * color_3.xyz);
|
||
|
Yxy_5.x = tmpvar_6.y;
|
||
|
Yxy_5.yz = (tmpvar_6.xy / dot (vec3(1.0, 1.0, 1.0), tmpvar_6));
|
||
|
cie_2.yz = Yxy_5.yz;
|
||
|
highp vec2 tmpvar_7;
|
||
|
tmpvar_7.y = 0.5;
|
||
|
tmpvar_7.x = (tmpvar_6.y * _RangeScale);
|
||
|
lowp float tmpvar_8;
|
||
|
tmpvar_8 = texture (_Curve, tmpvar_7).x;
|
||
|
newLum_1 = tmpvar_8;
|
||
|
cie_2.x = newLum_1;
|
||
|
highp vec3 XYZ_9;
|
||
|
XYZ_9.x = ((newLum_1 * Yxy_5.y) / Yxy_5.z);
|
||
|
XYZ_9.y = cie_2.x;
|
||
|
XYZ_9.z = ((newLum_1 * (
|
||
|
(1.0 - Yxy_5.y)
|
||
|
- Yxy_5.z)) / Yxy_5.z);
|
||
|
color_3.xyz = (mat3(2.5651, -1.0217, 0.0753, -1.1665, 1.9777, -0.2543, -0.3986, 0.0439, 1.1892) * XYZ_9);
|
||
|
_glesFragData[0] = color_3;
|
||
|
}
|
||
|
|
||
|
|
||
|
// stats: 12 alu 2 tex 0 flow
|
||
|
// inputs: 1
|
||
|
// #0: xlv_TEXCOORD0 (high float) 2x1 [-1]
|
||
|
// uniforms: 1 (total size: 0)
|
||
|
// #0: _RangeScale (high float) 1x1 [-1]
|
||
|
// textures: 2
|
||
|
// #0: _MainTex (low 2d) 0x0 [-1]
|
||
|
// #1: _Curve (low 2d) 0x0 [-1]
|