Advertisement Jump to content
Sign in to follow this  
roos

OpenGL Best way to add fog to 2D game

This topic is 4911 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've used fog in OpenGL before for 3D stuff, but never thought about using it for 2D though. Would this work? I don't see why not but I just wanted to check if anyone thinks I'm running blind into a wall, or if there might be a more efficient way :) I think vertex based fog is pretty efficient though afaik, much more so than, say, alpha blending a quad over the entire screen. Of course the fog will be uniform over the screen since there's no depth information but that's fine, I'm just going for an overall thick fog effect. Thanks roos

Share this post


Link to post
Share on other sites
Advertisement
Yes, I think it would work fine. For more interesting effects, you could check out glFogCoord (available as an extension and in 1.4, if I recall correctly).
The less efficient way you mention (blending a quad over the screen) might be worth it if the quad has a nice texture. Like Perlin noise, for example.

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!