35 lines
762 B
C
Raw Normal View History

2016-05-28 18:18:23 +02:00
#include "shaders_common.h"
2016-06-08 05:26:33 +02:00
static const char *stock_cg_gl_program = CG(
2016-05-28 18:18:23 +02:00
struct input
{
float2 tex_coord;
float4 color;
float4 vertex_coord;
uniform float4x4 mvp_matrix;
uniform sampler2D texture;
};
struct vertex_data
{
float2 tex;
float4 color;
};
void main_vertex
(
out float4 oPosition : POSITION,
input IN,
out vertex_data vert
)
{
oPosition = mul(IN.mvp_matrix, IN.vertex_coord);
vert = vertex_data(IN.tex_coord, IN.color);
}
float4 main_fragment(input IN, vertex_data vert, uniform sampler2D s0 : TEXUNIT0) : COLOR
{
2016-05-29 03:48:08 +02:00
return vert.color * tex2D(s0, vert.tex);
2016-05-28 18:18:23 +02:00
}
);