Jump to content
  • Advertisement
Sign in to follow this  
Alessandro

Rendering solid and wire at once

This topic is 2584 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!