HLSL pixel shader: possible to not set output color?

Is it possible to somehow not set the output color in a HLSL pixel shader without getting an error message? It is possible with a CG shader. The effect is a transparent surface at pixels where the output color is not set/computed.
NicoTongue Tied
[317 byte] By [NicoRi] at [2008-2-15]
# 1
No, you must generate a colour. If you want to kill the pixel, use texkill.
TomForsyth at 2007-9-9 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: Graphics...
# 2
Hm, does something like texkill exist in HLSL? Otherwise it is not that useful to me. Also at a first glance on the texkill dx documentation it seems to only kill the pixel if its tex coords are less than zero. But I like to use an arbitrary if statement to mask the pixel.
NicoRi at 2007-9-9 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: Graphics...
# 3
My suggestion is, if you can carefully arrange the rendering order and enable blending, then set the alpha value to zero should achieve what you want.
Ludovic_han at 2007-9-9 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: Graphics...
# 4
Thanks for your suggestion. Smile Maybe I will try that some time. At the moment I just render one object, so I simply set the output color to the background color.
NicoRi at 2007-9-9 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: Graphics...
# 5
The HLSL equivalent of texkill is "clip".
TomForsyth at 2007-9-9 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: Graphics...