Rendering solid and wire at once

Started by
0 comments, last by Promethium 12 years, 5 months ago
Hi, I was wondering if the only way to display an object solid and wire is to render it twice, first with GL_FILL and then with GL_WIRE. Or maybe there are some shaders that can do that in one pass? Thanks
Advertisement
Sure, you need to calculate the distance from the edge of the triangle to the current fragment in the fragment shader and the change the color of the fragment based on that distance. This page and paper describes a method that gives good results: Wireframe Drawing.

This topic is closed to new replies.

Advertisement