2

I figured out my fragment shader is limited to the pixel dimensions of the OpenGL ES viewport.

Could I create an "offscreen fragment shader" or rendering environment which has a lot more pixels for rendering?

1 Answers1

7

Fragment shaders take values created by the rasterization after the vertex shader. What you need to do is to create a Texture (very large texture), bind it to a FBO (you can look at OGL's doc for that, it's not very complicated) and render to it. Before the offscreen render, use the

glViewPort

function to define the rendering width and height. Before this offscreen rendering, use your fragment shader and all will work fine. Good luck :)

Tuxer
  • 753
  • 1
  • 6
  • 20
  • 1
    I created a sample application which does this kind of rendering to an offscreen FBO using an OpenGL ES 2.0 shader program as part of my post [here](http://www.sunsetlakesoftware.com/2010/10/22/gpu-accelerated-video-processing-mac-and-ios), so the code I used there could be modified to handle a larger image as well. It demonstrates what you describe above. – Brad Larson Jul 26 '11 at 15:12
  • Thanks Tuxer & Brad! That's great! – SecretService - not really Jul 26 '11 at 21:17