mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-12-12 17:21:08 -05:00
66 lines
1.2 KiB
Text
66 lines
1.2 KiB
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 SurfaceOutput {
|
|
vec3 Albedo;
|
|
vec3 Normal;
|
|
vec3 Emission;
|
|
float Specular;
|
|
float Gloss;
|
|
float Alpha;
|
|
};
|
|
struct appdata_full {
|
|
vec4 vertex;
|
|
vec4 tangent;
|
|
vec3 normal;
|
|
vec4 texcoord;
|
|
vec4 texcoord1;
|
|
vec4 color;
|
|
};
|
|
struct LeafSurfaceOutput {
|
|
vec3 Albedo;
|
|
vec3 Normal;
|
|
vec3 Emission;
|
|
vec3 Translucency;
|
|
float Specular;
|
|
float Gloss;
|
|
float Alpha;
|
|
};
|
|
struct v2f {
|
|
vec4 pos;
|
|
vec2 uv;
|
|
vec3 color;
|
|
};
|
|
uniform float _HalfOverCutoff;
|
|
uniform sampler2D _MainTex;
|
|
vec4 frag( in v2f i );
|
|
vec4 frag( in v2f i ) {
|
|
vec4 col;
|
|
col = texture2D( _MainTex, i.uv);
|
|
col.xyz *= (i.color * 2.00000);
|
|
col.w *= (2.00000 * _HalfOverCutoff);
|
|
xll_clip( (col.w - 1.00000) );
|
|
return col;
|
|
}
|
|
void main() {
|
|
vec4 xl_retval;
|
|
v2f xlt_i;
|
|
xlt_i.pos = vec4(0.0);
|
|
xlt_i.uv = vec2( gl_TexCoord[0]);
|
|
xlt_i.color = vec3( gl_TexCoord[1]);
|
|
xl_retval = frag( xlt_i);
|
|
gl_FragData[0] = vec4( xl_retval);
|
|
}
|