41 lines
811 B
HLSL
41 lines
811 B
HLSL
#include "res/shaders/common.hlsl"
|
|
|
|
struct {
|
|
SamplerState sampler0;
|
|
Texture2D texture0;
|
|
} globals;
|
|
|
|
cbuffer constants : register(b0)
|
|
{
|
|
float4x4 projection;
|
|
};
|
|
|
|
struct vs_input {
|
|
float4 pos : POSITION;
|
|
float2 uv : TEXCOORD;
|
|
float4 tint_srgb : COLOR;
|
|
};
|
|
|
|
struct ps_input {
|
|
float4 pos : SV_POSITION;
|
|
float2 uv : TEXCOORD;
|
|
float4 tint_lin : COLOR;
|
|
};
|
|
|
|
ps_input vs_main(vs_input input)
|
|
{
|
|
ps_input output;
|
|
|
|
output.pos = mul(projection, float4(input.pos.xy, 0.f, 1.f));
|
|
output.uv = input.uv;
|
|
output.tint_lin = linear_from_srgb(input.tint_srgb);
|
|
|
|
return output;
|
|
}
|
|
|
|
float4 ps_main(ps_input input) : SV_TARGET
|
|
{
|
|
float4 color = globals.texture0.Sample(globals.sampler0, input.uv) * input.tint_lin;
|
|
return color;
|
|
}
|