mirror of
https://github.com/Phantop/LADXHD.git
synced 2025-01-09 20:36:59 +00:00
39 lines
767 B
HLSL
39 lines
767 B
HLSL
#if OPENGL
|
|
#define SV_POSITION POSITION
|
|
#define VS_SHADERMODEL vs_3_0
|
|
#define PS_SHADERMODEL ps_3_0
|
|
#else
|
|
#define VS_SHADERMODEL vs_4_0_level_9_1
|
|
#define PS_SHADERMODEL ps_4_0_level_9_1
|
|
#endif
|
|
|
|
Texture2D SpriteTexture;
|
|
|
|
sampler2D SpriteTextureSampler = sampler_state
|
|
{
|
|
Texture = <SpriteTexture>;
|
|
};
|
|
|
|
struct VertexShaderOutput
|
|
{
|
|
float4 Position : SV_POSITION;
|
|
float4 Color : COLOR0;
|
|
float2 TextureCoordinates : TEXCOORD0;
|
|
};
|
|
|
|
float4 MainPS(VertexShaderOutput input) : COLOR
|
|
{
|
|
float4 color = tex2D(SpriteTextureSampler,input.TextureCoordinates);
|
|
// replace pink with the color
|
|
if (color.r == 1 && color.g == 0 && color.b)
|
|
return input.Color;
|
|
return color;
|
|
}
|
|
|
|
technique SpriteDrawing
|
|
{
|
|
pass P0
|
|
{
|
|
PixelShader = compile PS_SHADERMODEL MainPS();
|
|
}
|
|
}; |