How to create a high-resolution offscreen fragment shader?
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 开发者_JAVA百科a lot more pixels for rendering?
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 :)
精彩评论