i want to implement SHADOW MAPPING and GLOW post processing using FBO and GLSL
for shadow mapping i use these fbo settings:
glGenFramebuffersEXT(1, &fbo);
//create depth textures
glGenTextures(1, &depth);
glBindTexture(GL_TEXTURE_2D, depth);
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, shadowMapWidth, shadowMapHeight, 0, GL_DEPTH_COMPONENT, GL_FLOAT, NULL);
//set texture quality
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
//bind fbo and attach depth texture to it
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_TEXTURE_2D, depth, 0);
glDrawBuffer(GL_NONE);
glReadBuffer(GL_NONE);
// my check routine
verifyFBO();
and everything is OK---> framebuffer is complete!
then i try to setup another fbo for POST PROCESSING, like this:
glGenFramebuffersEXT(1, &fbo2);
glGenTextures(2, color);
glBindTexture(GL_TEXTURE_2D, color[0]);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, offscreenSize, offscreenSize, 0,
GL_RGB, GL_UNSIGNED_BYTE, NULL);
glBindTexture(GL_TEXTURE_2D, color[1]);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, offscreenSize, offscreenSize, 0,
GL_RGB, GL_UNSIGNED_BYTE, NULL);
glGenRenderbuffersEXT(1, &depth2);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, depth2);
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, offscreenSize, offscreenSize);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo2);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
GL_TEXTURE_2D, color[0], 0);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT1_EXT,
GL_TEXTURE_2D, color[1], 0);
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, depth2);
verifyFBO();
but i get GL_FRAMEBUFFER_UNSUPPORTED_EXT error!!!!!!!!!!!!
my video card is GeForce 7800GT, Forceware 92.91, dx 9.0c
for shadow mapping i use these fbo settings:
glGenFramebuffersEXT(1, &fbo);
//create depth textures
glGenTextures(1, &depth);
glBindTexture(GL_TEXTURE_2D, depth);
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, shadowMapWidth, shadowMapHeight, 0, GL_DEPTH_COMPONENT, GL_FLOAT, NULL);
//set texture quality
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
//bind fbo and attach depth texture to it
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_TEXTURE_2D, depth, 0);
glDrawBuffer(GL_NONE);
glReadBuffer(GL_NONE);
// my check routine
verifyFBO();
and everything is OK---> framebuffer is complete!
then i try to setup another fbo for POST PROCESSING, like this:
glGenFramebuffersEXT(1, &fbo2);
glGenTextures(2, color);
glBindTexture(GL_TEXTURE_2D, color[0]);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, offscreenSize, offscreenSize, 0,
GL_RGB, GL_UNSIGNED_BYTE, NULL);
glBindTexture(GL_TEXTURE_2D, color[1]);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, offscreenSize, offscreenSize, 0,
GL_RGB, GL_UNSIGNED_BYTE, NULL);
glGenRenderbuffersEXT(1, &depth2);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, depth2);
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, offscreenSize, offscreenSize);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo2);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
GL_TEXTURE_2D, color[0], 0);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT1_EXT,
GL_TEXTURE_2D, color[1], 0);
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, depth2);
verifyFBO();
but i get GL_FRAMEBUFFER_UNSUPPORTED_EXT error!!!!!!!!!!!!
my video card is GeForce 7800GT, Forceware 92.91, dx 9.0c