How Use DirectX Draw a 2D Polygon which have a hole?

In C# We can Use SetClip() To draw 2d polygon which have a hole,

But In Direct It's seem very hard to complete.




Answer this question

How Use DirectX Draw a 2D Polygon which have a hole?

  • davros-too

    If the hole is defined mathematically, you can use pixel shaders to clip() pixels that you don't want rendered. If it's defined by an artist, texturing is probably the way to go, combined with alpha blending or alphakill.


  • IanRich

    thank you!! I will try it.

  • Mister

    Since you have to define the polygon in terms of triangles anyway, just make a few more triangles to define the shape with the hole in it.

  • Sean Sexton

    Please tell me how to use pixel shaders to clip() pixels.thanks!!

  • How Use DirectX Draw a 2D Polygon which have a hole?