Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just recently started learning the art of shading, but I can't give an outline width to 2D, concave geometry when restrained to a single vertex/pixel shader technique (thanks to XNA).

the shape I need to give an outline to has smooth, per-vertex coloring, as well as opacity. The outline, which has smooth, per-vertex coloring, variable width, and opacity cannot interfere with the original shape's colors.

A pixel depth border detection algorithm won't work because pixel depth isn't a 3.0 semantic.
expanding geometry / redrawing won't work because it interferes with the original shape's colors.

I'm wondering if I can do something with the stencil/depth buffer outside of the shader functions since I have access to that through the graphics device. But I don't believe I'm able to manipulate actual values.

How might I do this?

share|improve this question
What do you mean with 'cannot interfere with the original shape's colors'? If you draw the outline first and then draw the shape on top of it the shape's colors aren't affected, unless if you set a weird blend mode. – Roy T. Sep 24 '12 at 7:58
@RoyT. If the shape isn't 100% opaque, there will be a problem – Griffin Sep 24 '12 at 19:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.