mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 09:08:22 -05:00
34 lines
718 B
Text
34 lines
718 B
Text
|
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 vertex;
|
||
|
vec4 uv;
|
||
|
};
|
||
|
|
||
|
v2f vert( in vec4 vertex, in vec2 uv );
|
||
|
v2f vert( in vec4 vertex, in vec2 uv ) {
|
||
|
v2f o;
|
||
|
float scale = 1.00000;
|
||
|
o.vertex = ( gl_ModelViewProjectionMatrix * vertex );
|
||
|
o.uv.xy = ((vec2( o.vertex.x , (o.vertex.y * scale)) + o.vertex.w ) * 0.500000);
|
||
|
o.uv.zw = o.vertex.zw ;
|
||
|
return o;
|
||
|
}
|
||
|
void main() {
|
||
|
v2f xl_retval;
|
||
|
xl_retval = vert( vec4(gl_Vertex), vec2(gl_MultiTexCoord0));
|
||
|
gl_Position = vec4( xl_retval.vertex);
|
||
|
gl_TexCoord[0] = vec4( xl_retval.uv);
|
||
|
}
|