Advertisement

ATI's fglrx linux driver and the depthbuffer

Started by July 26, 2004 11:29 AM
5 comments, last by Ravuya 20 years, 6 months ago
Hi, I recently managed to get the driver working on a nForce2 board and an ATI Radeon 9600XT. Question: Did anyone ever try to read a value from the depthbuffer with this driver ? I wonder if it's only my setup, but under windows it works fine ... The issue is that when I try to read a depthbuffer value with glReadPixels(), it returns a wrong value everytime. For example, on a freshly cleared depthbuffer with ranges from [0, 1] it should return a "1" at every location, but nope, it returns something like 0.0396... . It also returns wrong values if I read back the whole depthbuffer. So if anyone could be so kind who has the 3.7.6 or 3.7.9 drivers from ATI installed to read back a single value ;)

#include <iostream>
using namespace std;

#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>

void idle( void ) {}
void reshape( int w, int h ) {}
void display( void )
{
  float val;
  glClearDepth( 1 );
  glClear( GL_DEPTH_BUFFER_BIT );
  glReadPixels( 0, 0, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &val );
  cout << "Read: " << val << endl;
  exit( 0 );
}

int main( int argc, char **argv )
{
  glutInit( &argc, argv );
  glutInitWindowPosition( 100, 100 );
  glutInitWindowSize( 256, 256 );
  glutInitDisplayMode( GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH );
  glutCreateWindow( "depth test" );
  glutReshapeFunc( reshape );
  glutDisplayFunc( display );
  glutIdleFunc( idle );
  glutMainLoop();
}

The program is written from scratch for testing purposes and compiles. It should return "Read: 1.0" but returns 0.0369...and so forth.
Visit my website now, at http://www.vanbirk.de !
shouldn't you call glFlush or glFinish before trying to read from the graphics memory?
our new version has many new and good features. sadly, the good ones are not new and the new ones are not good
Advertisement
Hey could you post a link or something to tell us how you got ATI's driver to work on an nForce2 in Linux? You will be my personal hero!
Quote:
Original post by 666_1337
shouldn't you call glFlush or glFinish before trying to read from the graphics memory?

No, there's no need for that.
ATi's fglrx drivers suck ASS. They're releasing a revamped version eventually, but compared to nVidia's, they suck.
_________________Politics is the ability to foretell what is going to happen tomorrow, next week, next month and next year. And to have the ability afterwards to explain why it didn't happen. -- Winston ChurchillGDNet-0.2 - rate users the easy way with this nifty Firefox extension. Updated with new features.
Quote:
Original post by Drevay
ATi's fglrx drivers suck ASS. They're releasing a revamped version eventually, but compared to nVidia's, they suck.


I concur. It's nice to see the expensive video card you have get reduced to nothing more than a cheap framebuffer; ATI's drivers suck so much on 3D acceleration it's not funny.

This topic is closed to new replies.

Advertisement