layering

hmmm k… ive gone through the stuff wot ur tellin. ll try it out.

Thank u.

hello…
i tried the FBO stuff… the code is getting compiled… but the thing is during execution an exception is gettin raised…
wot to do for this…?

Thank u

hello…
when wglMakeCurrent function is called, m getting an empty screen.!
can anybody help…

Thank u.

Debug it! Post a short test program so folks can help! For max portability, use GLUT.

hmmmm iv debugged… but not getting.k ll post ma program.

#include<glew.h>
#include<wglew.h>

include <GL/glut.h>

include <stdlib.h>

include <math.h>

include <string.h>

static GLfloat spin = 360.0 ;
static float r_min=1 , r_max=8 ;

define dtheta 0.1

GLuint color_tex;
GLuint fb;
GLuint depth_rb;
int width=512;
int height=512;

void init(void)
{

    glShadeModel(GL_FLAT) ;
	glClearColor(0.0f, 0.0f, 0.2f, 0.5f);
	glClearDepth(1.0f);					
    glEnable(GL_DEPTH_TEST);			
    glDepthFunc(GL_LEQUAL);				
    glViewport(0,0,800,600);

    glGenFramebuffersEXT(1, &fb);
    glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
	glGenRenderbuffersEXT(1, &depth_rb);
	glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, depth_rb);
	glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT24, 256, 256);


	glGenTextures(1, &color_tex);
	glBindTexture(GL_TEXTURE_2D,color_tex);
	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8,  width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
	glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
	glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
	glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
	glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);

	glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, color_tex, 0);
	glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, depth_rb);

	GLenum status;
	status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
	if(status != GL_FRAMEBUFFER_COMPLETE_EXT)
	exit(1);

	glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);

}

void display(void)
{

glColor3f(1.0 , 1.0 , 1.0) ;

glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);

glPushAttrib(GL_VIEWPORT_BIT);
glViewport(0,0,512,512);

glColor4f(0.0 , 1.0 , 0.0, 0.1) ;
glBegin(GL_POLYGON) ;
	glVertex2f(0.0 , 0.0) ;
	glVertex2f(r_max*cos(0.0) , r_max*sin(0.0)) ;
	glVertex2f(r_max*cos(dtheta) , r_max*sin(dtheta)) ;
glEnd() ;
glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();

glPopAttrib();

glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glClearColor(0.0f, 0.0f, 0.2f, 0.5f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);	
glLoadIdentity();
glBindTexture(GL_TEXTURE_2D,color_tex);

glutSwapBuffers() ;

}

void reshape(int w , int h)
{
glViewport(0 , 0 , (GLsizei)w , (GLsizei)h) ;
glMatrixMode(GL_PROJECTION) ;
glLoadIdentity() ;
glOrtho(-r_max , r_max , -r_max , r_max , -1.0 , 1.0) ;
glMatrixMode(GL_MODELVIEW);
glLoadIdentity() ;
}

void ShutDown(void)
{
glDeleteFramebuffersEXT(1, &fb);
glDeleteRenderbuffersEXT(1, &depth_rb);
glDeleteTextures(1,&color_tex);
}

void keyboard(unsigned char key,int x,int y)
{
switch(key)
{
case 27: // When Escape Is Pressed…
ShutDown();
exit(0); // Exit The Program
break;
default:
break;
}
}

int main(int argc , char* argv[])
{
glutInit(&argc , argv) ;
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB) ;
glutInitWindowSize(750 , 750) ;
glutInitWindowPosition(0,0) ;
glutCreateWindow(“fbo”) ;
init() ;
glutDisplayFunc(display);
glutReshapeFunc(reshape);
glutKeyboardFunc(keyboard) ;
glutMainLoop() ;
return 0 ;
}

Well, as it looks like you found out (or almost found out), your framebuffer status returned from glCheckFramebufferStatus is GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS.

The problem being you’re trying to configure an FBO with a 512x512 color buffer but a 256x256 depth buffer. Make them the same resolution.

hello…

thanks for ur suggestion. but still m gettin an exception while runnin ma program…!

then i tried including these statements…

switch(status)
{
case GL_FRAMEBUFFER_COMPLETE_EXT:
printf(“good”);
default:
HANDLE_THE_ERROR;
}

m getting the error like, HANDLE_THE_ERROR undeclared identifier… wot to do…?

And iv tried that overlay planes also… can u please tell me how to check whether my platform supports overlays…? if it doesn’t support wot should be done…?

Thank u.

Define exception. If you fixed that bug I mentioned, then you shouldn’t be getting an exception. I get no exception here on the latest NVidia drivers, and a valgrind run on this app is clean. The window comes up and runs fine.

then i tried including these statements…

switch(status)
  {
     case GL_FRAMEBUFFER_COMPLETE_EXT:
       printf("good");
     default:
       HANDLE_THE_ERROR;
  }
m getting the error like, HANDLE_THE_ERROR undeclared identifier... wot to do...?

You forgot the break after printf.

And iv tried that overlay planes also… can u please tell me how to check whether my platform supports overlays…? if it doesn’t support wot should be done…?

What’s your GPU and OS? Most GPUs don’t have overlay planes AFAIK. In the NVidia world, only non-NVS Quadros do (per the NVidia driver README).

hmmm… i tried putting break after printf. but still m gettin the same exception…!
i think ma platform is not supporting…!
m using WindowsXP version 2002(service pack3)…!
and ma GPU is INTEL® G33/G31 Express Chipset family…
will this support both FBO and overlay planes…?
if not wot should be done…?
DO i need to upgrade this version…?

Thank u…

hello…
Does quadro4 500 GoGL support overlay planes…?

hello…
I gottu know that there is nothin to worry about GPUs and all. If we have the whole OpenGL package we can implement overlay planes… Is that true…? If so, can you please tell me how to get the OpenGL full package…

Thank you.

No.
http://www.opengl.org/wiki/Getting_started

hello…
Can anybody tell me wot driver will support Overlay planes for Intel GMA 950 chipset…

Thank u.

None.

So do i need to get another graphics card…? which one…?

hello…
hmmm finally i completed 80 percent of my display part…
the remaining thing is i need to display the target movement.
for every 8 secs the target position should be changed… can any body tell me how to do this…? is there any special openGL function…?

Thank u.

Use a timer system, for example if you use Glut you have glutTimerFunc which allow to schedule a function call in a future time.

hello…
i have a doubt
The concept of overlay planes was introduced in 90’s…then how come that only Nvidia Quadro support overlay planes…!!!as it is a recent invention…

Because it is not something Joe-gamer needs. So it’s used as a feature to distinguish the Quadro line, which is typically bought by folks that have more money than Joe gamer.

GeForce = Joe gamer
Quadro = Workstation/CAD/DCC user