how to render in the viewport display of more than?
how to render in the viewport display of more than? for example GLES20.glViewport (0, 0, 5000, 5000);
I think the wiki page on Frame Buffer Objects is what you are looking for, they allow you to render to textures where the size is independent of the application window size (but still subject to certain size limits).
If that is not what you are looking for, please provide more details on what you are trying to do and where you are running into problems.
Originally Posted by carsten neumann
I need to use to get the picture and glReadPixels 5000 to 5000, without the use of textures
GLES20.glViewport(0, 0, wi, he);
Matrix.orthoM(mProjMatrix, 0, -wi/2,wi/2 , -he/2, he/2, 1, 10);
frame = new int;
GLES20.glGenFramebuffers(1, frame, 0);
int fboId = frame;
int renderbuffers = new int;
GLES20.glGenRenderbuffers(1, renderbuffers, 0);
GLES20.glRenderbufferStorage(GLES20.GL_RENDERBUFFE R, GLES20.GL_RGBA4 , wi,he);
GLES20.glFramebufferRenderbuffer(GLES20.GL_FRAMEBU FFER, GLES20.GL_DEPTH_ATTACHMENT, GLES20.GL_RENDERBUFFER, renderbuffers);
//mPixelBuf - Houses the picture 5000x5000
GLES20.glReadPixels(0, 0,wi, hi, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, mPixelBuf);
Please use [code][/code] around source code to preserve formatting, thanks.
Your FBO only has a depth attachment, you also need a color attachment where the actual picture you are rendering is stored - before calling glReadPixels() use glReadBuffer() to select your color attachment as the source.
The renderbuffer allocated in the code has format RGBA4, so it would not be valid as a depth attachment. This renderbuffer was probably supposed to be attached as a color attachment. The second argument to glFramebufferRenderbuffer() will have to be GL_COLOR_ATTACHMENT0 instead of GL_DEPTH_ATTACHMENT in this case.
If a depth attachment is needed as well, that one will have to be allocated with a format of GL_DEPTH_COMPONENT16.
Also, 5000x5000 is a large size. Since ES 2.0 is used, I figure we're talking about mobile devices. Many of them will have size limits on the render target that are smaller than this.
Last edited by Argonaft; 06-25-2014 at 10:48 AM.