mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-12-04 21:31:11 -05:00
34 lines
930 B
Text
34 lines
930 B
Text
|
struct v2f {
|
||
|
highp vec4 vertex;
|
||
|
lowp vec4 color;
|
||
|
mediump vec2 texcoord;
|
||
|
};
|
||
|
struct appdata_t {
|
||
|
highp vec4 vertex;
|
||
|
lowp vec4 color;
|
||
|
highp vec2 texcoord;
|
||
|
};
|
||
|
uniform highp vec4 _MainTex_ST;
|
||
|
uniform highp mat4 glstate_matrix_mvp;
|
||
|
v2f xlat_main( in appdata_t v );
|
||
|
v2f xlat_main( in appdata_t v ) {
|
||
|
v2f o;
|
||
|
o.vertex = ( glstate_matrix_mvp * v.vertex );
|
||
|
o.color = v.color;
|
||
|
o.texcoord = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
|
||
|
return o;
|
||
|
}
|
||
|
varying lowp vec4 xlv_COLOR;
|
||
|
varying mediump vec2 xlv_TEXCOORD0;
|
||
|
void main() {
|
||
|
v2f xl_retval;
|
||
|
appdata_t xlt_v;
|
||
|
xlt_v.vertex = highp vec4( gl_Vertex);
|
||
|
xlt_v.color = lowp vec4( gl_Color);
|
||
|
xlt_v.texcoord = highp vec2( gl_MultiTexCoord0);
|
||
|
xl_retval = xlat_main( xlt_v);
|
||
|
gl_Position = highp vec4( xl_retval.vertex);
|
||
|
xlv_COLOR = lowp vec4( xl_retval.color);
|
||
|
xlv_TEXCOORD0 = mediump vec2( xl_retval.texcoord);
|
||
|
}
|