http://goo.gl/3eW9r
Alpha test is perhaps the simplest Direct3D 9 functionality to emulate. It does not require the user to set a alpha blend state. Instead the user can simply choose to discard a pixel based upon its alpha value. The following pixel shader does not draw the pixel if the alpha value is less than 0.5.
//
// PS for rendering with alpha test
//
float4 PSAlphaTestmain(PSSceneIn input) : COLOR0
{
float4 color = tex2D( g_samLinear, g_txDiffuse, input.tex ) * input.colorD;
if( color.a < 0.5 )
discard;
return color;
}
반응형
'그래픽스(Graphics) > Shader' 카테고리의 다른 글
웹에서 셰이더 보기 웹 GLSL (0) | 2013.06.03 |
---|---|
SSAO( Screen Space Ambient Occlusion ) (0) | 2013.05.20 |
반투명처리하기위해서 켜야하는 옵션 (0) | 2013.04.16 |
기초 : 스카이박스(Adding a Skybox to RenderMonkey) (0) | 2013.01.19 |
랜던값을 필셀 셰이더에서 얻는 방법 (0) | 2013.01.18 |