I have a hole defined by mathematically,How can you use pixel shaders to clip() pixels that

I have a hole defined by mathematically,How can I use pixel shaders to clip() pixels that hole?
example,I want to draw a polygon which have a hole in it.
Someone can tell me? thanks!!
[191 byte] By [hackbabu] at [2007-12-23]
# 1
Option 1: Use stencil. Render the polygon setting stencil to 1, then render hole settings stencil to 0, then render the actual color testing that stencil == 1. Alternately, use increment/decrement.

Option 2: Use texkill (in asm shader) or clip() (in HLSL).

float4 ThePixelShader(PixelIn args) {
theColor = PolyColor(args);
float3 arg(1, 1, 1);
if (PixelIsHole(args)) {
arg.x = -1;
}
clip(arg);
return theColor;
}

JonWatte at 2007-8-30 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: DirectX 101...
# 2
thanks ,but Can you tell me which is the highest performance solution?
hackbabu at 2007-8-30 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: DirectX 101...