Thanks Xmas for you feedback. I will in the future put SDK specific questions to the correct address.
When working with OpenGL | ES 2.0 I want to render to a texture but get’s framebuffer incomplete, incomplete attachment.
// Setup FBO texture
glGenTextures(1, &settings->fboTexture);
glBindTexture(GL_TEXTURE_2D, settings->fboTexture);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
// Generate FBO
glGenFramebuffers(1, &settings->fbo);
// bind the framebuffer
glBindFramebuffer(GL_FRAMEBUFFER, settings->fbo);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, settings->fboTexture, 0);
checkFramebufferStatus();
// run shader program
drawQuad(512, 512, 512, 512, program1);
glBindFramebuffer(GL_FRAMEBUFFER, 0);
Must I have a render buffer attached? Can’t i render direct to a texture?
best regards,
Fredrik