Ajout transparence buggé

This commit is contained in:
GolfOcean334
2024-04-09 13:03:26 +02:00
parent cae1fa326f
commit 1b4762940c
10 changed files with 711 additions and 5 deletions

View 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;
}