Skip to content

DefaultShaders.SimpleFragmentShaderHLSL Field

Definition

Namespace: Brine2D.Rendering.SDL.Shaders

Simple fragment shader in HLSL (reference only). The actual shader is compiled from Shaders/fragment.hlsl at build time. Outputs the interpolated color.

public const string SimpleFragmentShaderHLSL = "
struct PSInput
{
    float4 Position : SV_Position;
    float4 Color    : COLOR;
    float2 TexCoord : TEXCOORD0;
};

Texture2D Texture : register(t0, space2);
SamplerState Sampler : register(s0, space2);

float4 main(PSInput input) : SV_Target
{
    float4 texColor = Texture.Sample(Sampler, input.TexCoord);
    return texColor * input.Color;
}
";

Field Value

System.String