반응형

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; 


반응형

+ Recent posts