mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-12-11 00:31:28 -05:00
33 lines
894 B
Text
33 lines
894 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 = vec4( gl_Vertex);
|
|
xlt_v.color = vec4( gl_Color);
|
|
xlt_v.texcoord = vec2( gl_MultiTexCoord0);
|
|
xl_retval = xlat_main( xlt_v);
|
|
gl_Position = vec4( xl_retval.vertex);
|
|
xlv_COLOR = vec4( xl_retval.color);
|
|
xlv_TEXCOORD0 = vec2( xl_retval.texcoord);
|
|
}
|