mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 17:18:12 -05:00
33 lines
833 B
Text
33 lines
833 B
Text
struct v2f {
|
|
vec4 vertex;
|
|
vec4 color;
|
|
vec2 texcoord;
|
|
};
|
|
struct appdata_t {
|
|
vec4 vertex;
|
|
vec4 color;
|
|
vec2 texcoord;
|
|
};
|
|
uniform vec4 _MainTex_ST;
|
|
uniform 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 vec4 xlv_COLOR;
|
|
varying 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);
|
|
}
|