   Gradient background color
  Hi there! I am developing an application that allows you to view the effects of different real time lighting models on different 3d meshes. I am trying to get a gradient background color like something you would see in Zbrush. Here is how I am currently trying to do thisvoid TestGLCanvas::Render(){wxPaintDC dc(this);#ifndef __WXMOTIF__if (!GetContext()) return;#endif//wxGLCanvas::sSetCurrent();// Init OpenGL once, but after SetCurrentif (!m_init){InitGL();m_init = true;}glMatrixMode(GL_PROJECTION);glLoadIdentity();glFrustum(-0.5f, 0.5f, -0.5f, 0.5f, 1.5f, 15.0f);//1glMatrixMode(GL_MODELVIEW);/* clear color and depth buffers */glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);//==========================================//Gradient backgroundglMatrixMode (GL_MODELVIEW); glPushMatrix (); glLoadIdentity ();glMatrixMode (GL_PROJECTION);glPushMatrix (); glLoadIdentity ();glDisable(GL_LIGHTING);glDisable(GL_DEPTH_TEST);glBegin (GL_QUADS);glColor3f(0.0,1.0,0.0);glVertex3f (-1.0f, -1.0f, -1.0f); glVertex3f (1.0f, -1.0f, -1.0f); glColor3f(1.0,1.0,0.0);glVertex3f (1.0f, 1.0f, -1.0f); glVertex3f (-1.0f, 1.0f, -1.0f); glEnd ();glEnable(GL_LIGHTING);glEnable(GL_DEPTH_TEST);glPopMatrix (); glMatrixMode (GL_MODELVIEW); glPopMatrix ();//================================//draw our meshglPushMatrix();drawmodel();glPopMatrix();glFlush();SwapBuffers();}It just doesn't seem to work and ends up looking weird like thishttp://tinypic.com/view.php?pic=200rbsk&s=5I am using GLSL! maybe this is messing things up!Any help would be appreciated!!!!!![Edited by - ciranmc on April 10, 2010 10:42:54 AM]
  Try:-Do your usual clear-Set a 2D mode-Draw a fullscreen quad at the far clip plane with your gradient.-Set a 3D perspective mode-Continue as usual   