bgfx/3rdparty/glsl-optimizer/tests/fragment/unity-Nature_Vegetation_Two_Pass_unlit-in.txt
Branimir Karadzic dee3fe5266 Initial commit.
2012-04-03 20:30:07 -07:00

45 lines
841 B
Text

void xll_clip(float x) {
if ( x<0.0 ) discard;
}
struct v2f_vertex_lit {
vec2 uv;
vec4 diff;
vec4 spec;
};
struct v2f_img {
vec4 pos;
vec2 uv;
};
struct appdata_img {
vec4 vertex;
vec2 texcoord;
};
struct v2f {
vec4 vertex;
vec4 color;
vec2 texcoord;
};
struct appdata_t {
vec4 vertex;
vec4 color;
vec2 texcoord;
};
uniform vec4 _Color;
uniform float _Cutoff;
uniform sampler2D _MainTex;
vec4 frag( in v2f i );
vec4 frag( in v2f i ) {
vec4 col;
col = (_Color * texture2D( _MainTex, i.texcoord));
xll_clip( (col.w - _Cutoff) );
return col;
}
void main() {
vec4 xl_retval;
v2f xlt_i;
xlt_i.vertex = vec4(0.0);
xlt_i.color = vec4( gl_Color);
xlt_i.texcoord = vec2( gl_TexCoord[0]);
xl_retval = frag( xlt_i);
gl_FragData[0] = vec4( xl_retval);
}