Jump to content
  • Advertisement
Sign in to follow this  

OpenGL Lens Distortion

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

Hello, the projection of opengl is that of a pinhole camera, so I want to simulate the behaviour of a planeconvex lens. I want to do the following: Render scene to a texture (bound to fbo). Then I want to transform this texture in a fragment shader. What is the common way to do this in a shader program ? (Having a great texture (e.g. 2048²), I want a destination image of size 1024² with the filtered texture image) So how would I retrieve the destination image? Would I bind the texture, draw a quad filling the whole screen? The for each fragment the fragment shader would fetch the right texels and put it on the framebuffer? Then I will read it back? For doing some sort of interpolation or decimation, like having a 1024x1024 texture/image and wanting a destination 8x1 image. Can I do for-looping in a shader ? Or how would I handle different sizes ? Thanks!

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!