GL_POINT problem on Mac Intel

Stoneking
Unregistered
 
Post: #1
Hi All,

I have a problem with GL_POINTS on a Mac mini (Intel Core Duo CPU, GMA 950 GPU, OSX 10.4.8). I have code that works fine on my G4 PowerBook and G5 iMac (both PowerPCs). I ported it to my new Mac mini, and built it from source, and it does everything right except draw points. Is this a known bug? Do I need to update some library somewhere?

Here's the code that builds display lists for drawing a starfield:

glPointSize(1.0);
for(k=0;k<32;k++) {
StarList[k] = glGenLists(1);
glNewList(StarList[k],GL_COMPILE);
glBegin(GL_POINTS);
for(i=0;i<N[k];i++) {
j=ID[k][i];
glMaterialfv(GL_FRONT,GL_EMISSION,Color[j]);
glVertex4fv(r[j]);
}
glEnd();
glMaterialfv(GL_FRONT,GL_EMISSION, Black);
glEndList();
}

It works fine on my other platforms, but on the Mac mini I get blank sky. I've played around with glPointSize, with no luck. As an experiment, I modified the code thus:

glPointSize(1.0);
for(k=0;k<32;k++) {
StarList[k] = glGenLists(1);
glNewList(StarList[k],GL_COMPILE);
//glBegin(GL_POINTS);
glBegin(GL_TRIANGLES);
for(i=0;i<N[k];i++) {
j=ID[k][i];
glMaterialfv(GL_FRONT,GL_EMISSION,Color[j]);
glVertex4fv(r[j]);
r[j][0] += 0.01;
glVertex4fv(r[j]);
r[j][1] += 0.01;
glVertex4fv(r[j]);
}
glEnd();
glMaterialfv(GL_FRONT,GL_EMISSION, Black);
glEndList();
}

The result is, as I expected, a bunch of little triangles. So I'm guessing that the problem is isolated to the GL_POINTS call, somehow. Help?

Other possibly relevant factiods... I'm compiling from a bash command line, using gcc (i686-apple-darwin8-gcc-4.0.1). I'm linking with these frameworks: GLUT, OpenGL, System, and Carbon. I'm using glut for window management. GL_POINT_SMOOTH is enabled.

Thanks,
-Eric
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
Pretty sure the GMA 950 can't draw antialiased points. Try disabling POINT_SMOOTH.

In general, you should ignore POINTS and LINES other than for debugging, since implementation quality varies so greatly. If you want antialiased points, draw small textured quads.
Quote this message in a reply
Stoneking
Unregistered
 
Post: #3
> Pretty sure the GMA 950 can't draw antialiased points. Try disabling
> POINT_SMOOTH.

That did it. Thanks for the help.
Quote this message in a reply
Sage
Posts: 1,234
Joined: 2002.10
Post: #4
GMA 950 Does support AA points, so this seems like a driver bug.

I'm curious why you're coloring stars with materials instead of glColor?
Quote this message in a reply
Stoneking
Unregistered
 
Post: #5
> GMA 950 Does support AA points, so this seems like a driver [url=https://
> bugreport.apple.com]bug[/url].

Thanks.

> I'm curious why you're coloring stars with materials instead of glColor?

Two-part answer:

1) I'm self-taught, and don't know any better.

2) Taking your question as a hint that there may be a better way, I performed the experiment. When I use glColor instead of glMaterial, I get blank sky (on PPC as well as the Intel). If glColor is a better way to draw stars, I must have something set goofy somewhere. I'm open to suggestions (always), but I'm presently focused on another problem.

Regards,
-Eric
Quote this message in a reply
Member
Posts: 749
Joined: 2003.01
Post: #6
If you want to use glColor with lighting you need to glEnable(GL_COLOR_MATERIAL)

©h€ck øut µy stuƒƒ åt ragdollsoft.com
New game in development Rubber Ninjas - Mac Games Downloads
Quote this message in a reply
Sage
Posts: 1,234
Joined: 2002.10
Post: #7
Right, I was really asking why you are trying to light a starfield. Using emissive materials isn't going to make the stars emit light... :/

Try glDisable(GL_LIGHTING) with the AA points and see if that works.
Quote this message in a reply
Post Reply