Jump to content

  • Log In with Google      Sign In   
  • Create Account

Framebuffer Object


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 mullikine   Members   -  Reputation: 100

Like
0Likes
Like

Posted 13 May 2010 - 02:42 PM

Hi everyone, I need some help trying to set up a framebuffer object. I have this in my header:
	#define GL_GLEXT_PROTOTYPES

	#include <GL/gl.h>
	#include <GL/glu.h>
	#include <gl/glext.h>
	#include <gl/wglext.h>

I have this in my code:
	unsigned int myFBO;
	glGenFramebuffersEXT(1, &myFBO);

However, VC is giving me this error: unresolved external symbol _glGenFramebuffersECT@8 [Edited by - mullikine on May 17, 2010 1:22:00 AM]

Sponsor:

#2 karwosts   Members   -  Reputation: 840

Like
0Likes
Like

Posted 13 May 2010 - 02:47 PM

Do you have experience dealing with opengl function pointers? You can't just load a header file and start calling extensions.

I'll recommend that you go download/install GLEW, then you won't have to mess with querying the function pointers, you'll just be able to call glGenFramebuffers().


#3 mullikine   Members   -  Reputation: 100

Like
0Likes
Like

Posted 13 May 2010 - 03:11 PM

Thanks karwosts! This is pointed me in the right direction.

#4 mullikine   Members   -  Reputation: 100

Like
0Likes
Like

Posted 16 May 2010 - 07:16 PM

Now that I have the framebuffer working, I've run into a harder problem. I'm rendering a bunch of polygons and textures to a single texture via the framebuffer as follows.


glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, FBO);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, texture, 0);

glClearColor(0.0f, 0.0f, 1.0f, 0.0f);
glClear(GL_COLOR_BUFFER_BIT);

for (int i = 0; i < nbits; i++) {
bits[i]->draw();
}
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);




The problem is when I try to use this texture it disregards the alpha value of glClearColor and always comes out opaque. The code above will result in a texture which has a blue background for example. If I comment out bits[i]->draw(); I'll get a solid blue texture. First of all, is what I'm trying to accomplish even possible?

Thanks in advance

#5 lc_overlord   Members   -  Reputation: 435

Like
0Likes
Like

Posted 16 May 2010 - 11:20 PM

Could be one or more of tree things.

1. you might not have set the FBO texture to RGBA
2. you might not have used blending and the right blendfunc when rendering the FBO texture to something
3. you might have misunderstood how glClear actually works




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS