Ajout transparence buggé
This commit is contained in:
38
enginecustom/transparent.ps
Normal file
38
enginecustom/transparent.ps
Normal file
@@ -0,0 +1,38 @@
|
||||
/////////////
|
||||
// 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;
|
||||
}
|
||||
Reference in New Issue
Block a user