2016-08-01 22:43:51 +02:00
|
|
|
#include "shaders_common.h"
|
|
|
|
|
|
|
|
static const char *stock_hlsl_program = CG(
|
|
|
|
void main_vertex
|
|
|
|
(
|
2021-09-25 23:19:45 +01:00
|
|
|
float3 position : POSITION,
|
2016-08-01 22:43:51 +02:00
|
|
|
float4 color : COLOR,
|
2021-09-25 23:19:45 +01:00
|
|
|
float2 texCoord : TEXCOORD0,
|
2016-08-01 22:43:51 +02:00
|
|
|
|
|
|
|
uniform float4x4 modelViewProj,
|
|
|
|
|
|
|
|
out float4 oPosition : POSITION,
|
|
|
|
out float4 oColor : COLOR,
|
|
|
|
out float2 otexCoord : TEXCOORD
|
|
|
|
)
|
|
|
|
{
|
2021-09-25 23:19:45 +01:00
|
|
|
oPosition = mul(modelViewProj, float4(position, 1.0f));
|
2016-08-01 22:43:51 +02:00
|
|
|
oColor = color;
|
|
|
|
otexCoord = texCoord;
|
|
|
|
}
|
|
|
|
|
2016-08-01 22:45:07 +02:00
|
|
|
struct output
|
2016-08-01 22:43:51 +02:00
|
|
|
{
|
|
|
|
float4 color: COLOR;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct input
|
|
|
|
{
|
|
|
|
float2 video_size;
|
|
|
|
float2 texture_size;
|
|
|
|
float2 output_size;
|
|
|
|
float frame_count;
|
|
|
|
float frame_direction;
|
|
|
|
float frame_rotation;
|
|
|
|
};
|
|
|
|
|
2020-09-07 10:08:07 +08:00
|
|
|
output main_fragment(float4 color : COLOR, float2 texCoord : TEXCOORD0,
|
2016-08-01 22:43:51 +02:00
|
|
|
uniform sampler2D decal : TEXUNIT0, uniform input IN)
|
|
|
|
{
|
|
|
|
output OUT;
|
2020-09-07 10:08:07 +08:00
|
|
|
OUT.color = color * tex2D(decal, texCoord);
|
2016-08-01 22:43:51 +02:00
|
|
|
return OUT;
|
|
|
|
}
|
|
|
|
);
|