2

I am trying to create an OpenGL fragment shader that converts a normal image to an image that contains fish eye effect. This is what i mean by fish eye affect (http://www.marcofolio.net/photoshop/create_a_fish_eye_lens_effect_in_photoshop.html).

By normal image i mean a rendered image taken from a virtual camera in a 3d interactive environment, not an image taken from a real camera, but i guess that doesnt really make much difference in terms of this problem.

Does anyone have any idea how Photoshop does it, or where i can find material that explains the algorithm?

Thanks

JWWalker
  • 22,385
  • 6
  • 55
  • 76
Adham
  • 142
  • 1
  • 10

1 Answers1

2

You don't really even need a shader in this case. From the sound of things, you have your original image as a bitmap of some sort. If that's so, just use it as a texture, and attach it to a sphere.

Of course, you can use a shader (or pair of shaders, really), but unless you're going to do more than you've described, doing so won't gain you much (if anything).

Jerry Coffin
  • 476,176
  • 80
  • 629
  • 1,111
  • The source image is not a bitmap but the output of the framebuffer (FBO). Does that make a difference? – Adham Nov 25 '10 at 18:42
  • @Adham: It simplifies things a bit. With an FBO you render to a texture, so instead of having to load a bitmap into a texture, you'll just use the texture from the FBO. (Technically, you can also use an FBO to render to a renderBuffer, but in this case you probably don't want to). – Jerry Coffin Nov 25 '10 at 18:49
  • ok, now what i wanted the image to fill the screen and not just circular, like this for example ( http://idea.hosting.lv/a/gfx/quakeshots.html ) – Adham Nov 25 '10 at 18:55
  • @Adham: Same basic idea -- just your sphere is larger than the viewport, so it gets clipped at the edges. – Jerry Coffin Nov 25 '10 at 18:58