Hi, I’m trying to do MSAA in OpenGL ES 2. Here’s my setup
Renderer: Mesa Intel(R) UHD Graphics 630 (CML GT2)
GL VERSION: OpenGL ES 3.2 Mesa 22.2.0-devel (git-08da37035f)
GLSL VERSION: OpenGL ES GLSL ES 3.20
i setup the MSAA FBO which renders into a renderbuffer like this
/*
numOfSamples = 16
surfaceWidth = 1920
surfaceHeight = 1080
*/
glGenFramebuffers( 1, fbo );
glBindFramebuffer(GL_FRAMEBUFFER, *fbo);
glGenRenderbuffers( 1, colorRenderBuffer );
glBindRenderbuffer(GL_RENDERBUFFER, *colorRenderBuffer);
glRenderbufferStorageMultisampleEXT(
GL_RENDERBUFFER,
numOfSamples,
GL_RGBA8_OES,
surfaceWidth, surfaceHeight
);
glBindRenderbuffer(GL_RENDERBUFFER, 0);
glFramebufferRenderbuffer(
GL_FRAMEBUFFER,
GL_COLOR_ATTACHMENT0,
GL_RENDERBUFFER, *colorRenderBuffer
);
The drawing is handled like this
struct eglContext* pEglContext = &pClientObj->mpEglContext;
struct GlState* pGlState = &pClientObj->mGlState;
glBindFramebuffer(GL_FRAMEBUFFER, pClientObj->mGlState.msaaFBO);
GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
if( status != GL_FRAMEBUFFER_COMPLETE )
{
printf("Failed to Setup FBO errorcode : %d at %d\n", status, __LINE__);
}
drawTriangle(
pClientObj, time,
pTriangleMesh->vertex_positions, pTriangleMesh->vertex_texcoords, pTriangleMesh->vertex_colors
);
glBindFramebuffer(GL_READ_FRAMEBUFFER_NV, pClientObj->mGlState.msaaFBO);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER_NV, 0);
status = glCheckFramebufferStatus(GL_READ_FRAMEBUFFER_NV);
if( status != GL_FRAMEBUFFER_COMPLETE )
{
printf("Failed to Setup READ FBO errorcode : %d at %d\n", status, __LINE__);
}
status = glCheckFramebufferStatus(GL_DRAW_FRAMEBUFFER_NV);
if( status != GL_FRAMEBUFFER_COMPLETE )
{
printf("Failed to Setup DRAW FBO errorcode : %d at %d\n", status, __LINE__);
}
glClearColor( 0.0, 0.0, 0.0, 1.0 );
glClear( GL_COLOR_BUFFER_BIT );
glBlitFramebufferNV(
0, 0, surfaceWidth, surfaceHeight,
0, 0, surfaceWidth, surfaceHeight,
GL_COLOR_BUFFER_BIT,
GL_NEAREST
);
I get only Black Image and i get the following error in the debug messenger,
GL_INVALID_OPERATION in unsupported function called (unsupported extension or deprecated function?)
if i comment the glBlitFramebufferNV call, i don’t get this error message.
So, i used glGetString(GL_EXTENSIONS) to check for available extensions, and the extensions that define the functions glBlitFramebufferNV and glRenderbufferStorageMultisampleEXT
GL_NV_framebuffer_blit
GL_EXT_multisampled_render_to_texture
Both of these extensions are not available in my system.
If these extensions are not available how can i be able to get the function pointers for the two of those functions.
If those functions are not available, how can i achieve MSAA in OpenGL ES 2