Jump to content
  • Advertisement
Sign in to follow this  

Need help with "Postprocessing" in OGL

This topic is 4574 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, tis' me first post on this lovely site and I'm a bit of a newbie so please bare with me. I'm making an old-school-gradius-style 2D shootemup in C++ using OpenGL and GLFW. My problem is that I want to use Postprocessing effects to create some nice picture distortions (water for example). What I'd really like to do is render the whole screen on to a 320x240 offscreen buffer and then use that to draw the screenbuffer. Also it would be nice if it were platform independent. I'd like to know if there's a good way to do this. Now, i didn't come rushing here at the first sight of trouble so, I did try solve this problem myself. So, I tried just copying my whole rendered scene to an ordninary texture(512*256) and then back on screen. This works fine when in native resolution but if I want to enlarge the window to, say 640x480, I'll have to make a larger texture (1024*512) and copy a larger portion of the screen on to it. It feels like a waste of resources to copy a section 4 times the size of the one I need when all I want is to have a larger window. My next try was to always set my viewport to native resolution before the render loop (no matter my window size), store the finished scene on a texture, do the postprocessing, restore the viewport and then draw the buffer to fit the window. This works pretty well but is slow and if for some reason, my window happens to be smaller than native res I can't render the scene properly. Using shaders have occured to me, but having never dealt with them I harldy know what they do and if they can be of any help at all. As you might have noticed, I'm a tad stumped over this and would be truly grateful for any help I can get. Thanks in advance! /Mekanikles

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!