Skip to content

Instantly share code, notes, and snippets.

@voidproc
Last active August 31, 2016 03:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save voidproc/14ed210f8067d22c8f3d3ceaf423ea36 to your computer and use it in GitHub Desktop.
Save voidproc/14ed210f8067d22c8f3d3ceaf423ea36 to your computer and use it in GitHub Desktop.
Simple blinking effect using Siv3D PixelShader
Texture2D texture0 : register( t0 );
SamplerState sampler0 : register( s0 );
cbuffer CB : register(b1)
{
float strength;
float reserved1;
float reserved2;
float reserved3;
};
struct VS_OUTPUT
{
float4 position : SV_POSITION;
float2 tex : TEXCOORD0;
float4 color : COLOR0;
};
float4 PS(VS_OUTPUT input) : SV_Target
{
float4 srcColor = texture0.Sample(sampler0, input.tex);
srcColor.rgb += (float3(1.0, 1.0, 1.0) - srcColor.rgb) * strength;
return srcColor * input.color;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment