38 lines
836 B
PostScript
38 lines
836 B
PostScript
/////////////
|
|
// GLOBALS //
|
|
/////////////
|
|
Texture2D shaderTexture : register(t0);
|
|
SamplerState SampleType : register(s0);
|
|
|
|
cbuffer TransparentBuffer
|
|
{
|
|
float blendAmount;
|
|
};
|
|
|
|
|
|
//////////////
|
|
// TYPEDEFS //
|
|
//////////////
|
|
struct PixelInputType
|
|
{
|
|
float4 position : SV_POSITION;
|
|
float2 tex : TEXCOORD0;
|
|
};
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
// Pixel Shader
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
float4 TransparentPixelShader(PixelInputType input) : SV_TARGET
|
|
{
|
|
float4 color;
|
|
|
|
|
|
// Sample the texture pixel at this location.
|
|
color = shaderTexture.Sample(SampleType, input.tex);
|
|
|
|
// Set the alpha value of this pixel to the blending amount to create the alpha blending effect.
|
|
color.a = blendAmount;
|
|
|
|
return color;
|
|
} |