mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 09:08:22 -05:00
48 lines
1,013 B
Text
48 lines
1,013 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 pos;
|
|
float fog;
|
|
vec4 color;
|
|
vec2 uv;
|
|
};
|
|
struct appdata_tree_billboard {
|
|
vec4 vertex;
|
|
vec4 color;
|
|
vec4 texcoord;
|
|
vec2 texcoord1;
|
|
};
|
|
uniform sampler2D _MainTex;
|
|
vec4 frag( in v2f xlat_var_input );
|
|
vec4 frag( in v2f xlat_var_input ) {
|
|
vec4 col;
|
|
col = texture2D( _MainTex, xlat_var_input.uv);
|
|
col.xyz *= xlat_var_input.color.xyz ;
|
|
xll_clip( col.w );
|
|
return col;
|
|
}
|
|
varying vec4 xlv_FOG;
|
|
void main() {
|
|
vec4 xl_retval;
|
|
v2f xlt_xlat_var_input;
|
|
xlt_xlat_var_input.pos = vec4(0.0);
|
|
xlt_xlat_var_input.fog = float( xlv_FOG);
|
|
xlt_xlat_var_input.color = vec4( gl_Color);
|
|
xlt_xlat_var_input.uv = vec2( gl_TexCoord[0]);
|
|
xl_retval = frag( xlt_xlat_var_input);
|
|
gl_FragData[0] = vec4( xl_retval);
|
|
}
|