Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Outline effects in OpenGL

Tags:

In OpenGL, I can outline objects by drawing the object normally, then drawing it again as a wireframe, using the stencil buffer so the original object is not drawn over. However, this results in outlines with one solid color.

enter image description here

In this image, the pixels of the creature's outline seem to get more transparent the further they are from the creature they outline. How can I achieve a similar effect with OpenGL?

like image 718
dupersuper Avatar asked Oct 16 '12 22:10

dupersuper


1 Answers

They did not use wireframe for this. I guess it is heavily shader related and requires this:

  1. Rendering object to a stencil buffer
  2. Rendering stencil buffer with color of choice while applying blur
  3. Rendering model on top of it
like image 162
weltensturm Avatar answered Sep 21 '22 00:09

weltensturm