bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Sepiatone_Effect-in.txt
2012-10-07 20:41:18 -07:00

35 lines
800 B
Plaintext

struct v2f_vertex_lit {
vec2 uv;
vec4 diff;
vec4 spec;
};
struct v2f_img {
vec4 pos;
vec2 uv;
};
struct appdata_img {
vec4 vertex;
vec2 texcoord;
};
uniform sampler2D _MainTex;
vec4 frag( in v2f_img i );
vec4 frag( in v2f_img i ) {
vec4 original;
float Y;
vec4 sepiaConvert = vec4( 0.191000, -0.0540000, -0.221000, 0.000000);
vec4 xlat_var_output;
original = texture2D( _MainTex, i.uv);
Y = dot( vec3( 0.299000, 0.587000, 0.114000), original.xyz );
xlat_var_output = (sepiaConvert + Y);
xlat_var_output.w = original.w ;
return xlat_var_output;
}
void main() {
vec4 xl_retval;
v2f_img xlt_i;
xlt_i.pos = vec4(0.0);
xlt_i.uv = vec2( gl_TexCoord[0]);
xl_retval = frag( xlt_i);
gl_FragData[0] = vec4( xl_retval);
}