Advertisement Jump to content
Sign in to follow this  

OpenGL Image-Based Line Stylization

This topic is 5169 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

I'm doing a simple image based NPR rendering project and I'm stuck right now trying to figure out some nice line stylizations to use. I have some ideas based on depth values for a given pixel, but the part that's got me stuck right now is trying to make a line squiggly, or some similar distortion; regardless of depth value. Right now I'm calculating lines in a shader and attempting to stylize the lines while doing this. I think I may need to calculate the lines in one pass, then go through again and distort the lines afterward. However; since it's per-pixel operations anyway, it seems like I should be able to avoid this overhead. Does anyone have any ideas for a neat line stylization effect that could work in a single shader? [edit] Okay, I got my squiggly line shader going. I just take the window x coordinate, then define an offset such that: offset = extent*sin(extent); where extent is a user defined value. A value of about 64 generally produces nice curvy lines. It's a cool effect! I still want other effects though; something totally different even! It's possible to get "angry" lines by using a modulus function instead of sine, but beyond that I don't really know. [Edited by - OpenGLAaron on November 26, 2004 5:00:10 PM]

Share this post

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

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. 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!