-
Notifications
You must be signed in to change notification settings - Fork 513
AlphaTestEffect
This is a native Direct3D 11 implementation of the built-in AlphaTestEffect from XNA Game Studio 4 which supports per-pixel alpha testing.
See also Effects
#include <Effects.h>
Construction requires a Direct3D 11 device.
std::unique_ptr<AlphaTestEffect> effect;
effect = std::make_unique<AlphaTestEffect>(device);
For exception safety, it is recommended you make use of the C++ RAII pattern and use a std::unique_ptr
or std::shared_ptr
AlphaTestEffect supports IEffect, IEffectMatrices, and IEffectFog
This effect requires SV_Position
and TEXCOORD0
. It also requires COLOR
if per-vertex colors are enabled,
-
SetVertexColorEnabled: Enables per-vertex color. Defaults to false. Modifying this setting requires recreating associated input layouts, and enabling it requires
COLOR
. -
SetTexture: Associates a texture shader resource view with the effect. Can be set to nullptr to remove a reference.
-
SetAlphaFunction: Sets the alpha comparison function. See D3D11_COMPARISON_FUNC.
-
SetReferenceAlpha: Sets the alpha reference value for the test.
All content and source code for this package are subject to the terms of the MIT License.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.
- Universal Windows Platform apps
- Windows desktop apps
- Windows 11
- Windows 10
- Windows 8.1
- Xbox One
- x86
- x64
- ARM64
- Visual Studio 2022
- Visual Studio 2019 (16.11)
- clang/LLVM v12 - v18
- MinGW 12.2, 13.2
- CMake 3.20