PBuffer Surface with FSAA mode

Hi.

I use PBuffer Surface to bind a texture in WindowSurface.
It’s no problem.
But, When I set FSAA mode in WindowSurface. like this…

EGL_SAMPLE_BUFFERS, 1;
EGL_SAMPLES, 4;

I was faced with these problems.
PBuffer Texture pixels cutted and
texture mapping position was changed.

My OMAP2430(MBX-Lite) device PBuffer setting is like this…

EGLConfig EglConfig = 0;
EGLint i32ConfigID;
int i32BufferSize;
EGLDisplay eglDisplay = eglGetCurrentDisplay();
eglQueryContext(eglDisplay, eglGetCurrentContext(), EGL_CONFIG_ID, &i32ConfigID);
eglGetConfigAttrib(eglDisplay, (EGLConfig) i32ConfigID, EGL_BUFFER_SIZE,&i32BufferSize);
EGLint i32ConfigNo;
EGLint conflist[] =
{
   EGL_CONFIG_CAVEAT, EGL_NONE,
	EGL_BUFFER_SIZE, i32BufferSize,
	EGL_DEPTH_SIZE, 16,
	EGL_SURFACE_TYPE, EGL_PBUFFER_BIT,
	EGL_BIND_TO_TEXTURE_RGB, EGL_TRUE,
	EGL_NONE
};

eglChooseConfig(m_EGLDisplay, conflist, &EglConfig, 1, &i32ConfigNo) || i32ConfigNo != 1)

EGLint list[]=
{
	EGL_WIDTH, 512,
	EGL_HEIGHT, 512,
	EGL_TEXTURE_TARGET, EGL_TEXTURE_2D,
	EGL_TEXTURE_FORMAT, EGL_TEXTURE_RGB,
	EGL_NONE
};

m_EGLPbuffer = eglCreatePbufferSurface(m_EGLDisplay, EglConfig, list);

Could you please describe these issues in more detail?

Note that the 4 sample antialiasing mode on MBX Lite is acutally 2x2 supersampling, i.e. for each pixel four texture samples are taken, and the positions of these texture samples are all slightly shifted compared to non-antialiased rendering. Maybe that explains your problem?

Our WindowSurface is 800480 and I created 512512 PBuffer Surface.
after eglMakeCurrent(); // from Winsurface to PBuffer.
I set view matrix and call glViewport(0,0,320,480) at PBuffer space
and I draw Something at PBuffer.
after I call eglBindTexImage() and eglMakeCurrent() //from PBuffer to WindowSuface.
And, I use this PBuffer texture at WindowSurface.

I set PBuffer texture UV coordinates like this…
because of glViewport(0,0,320,480).
U1 = 0.0f, V1 = (float)(480/512);
U2 = 0.0f, V2 = (float)0.0f;
U3 = (float)(320/512), V3 = (float)(480/512);
U4 = (float)(320/512) V4 = 0.0f;

Actually, PBuffer Texture accurately mapped at the right half of the screen.

Strangely, When I disable FSAA mode, this places where I intended.
But, when I enable FSAA mode, it shrinks to a quarter of its size, and shifts itself to left.

and It has no problem on PVR PC Emu… this only happens on the device.

Is FSAA mode related to glViewport()??

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.