FAQ FAQ   Search Search  Register Register   Login Login  
   Main Site   Wiki  



Post new topic Reply to topic  [ 4 posts ] 

Author Message
 PostPosted: Sun Feb 19, 2006 1:16 am  Post subject: GL_POINT_DISTANCE_ATTENUATION
Offline
A Brave Victim
User avatar

Joined: Thu Feb 03, 2005 12:50 am
Posts: 3356
Location: Not really lurking anymore
I was playing a bit with points, but I just can't figure this out. As soon as I change any of the values the slightest bit, my points render at (near?) zero size.

For example:
Code:
GLfloat distance_attenuation[3] = {1.0f, 0.0f, 0.0f};
glPointParameterfv(GL_POINT_DISTANCE_ATTENUATION, distance_attenuation);
glPointSize(32.0f);
glBegin(GL_POINTS);
glVertex2f(0.0f, 0.0f);
glEnd();

renders a 32x32 block in the middle.
Code:
GLfloat distance_attenuation[3] = {1.001f, 0.0f, 0.0f};
glPointParameterfv(GL_POINT_DISTANCE_ATTENUATION, distance_attenuation);
glPointSize(32.0f);
glBegin(GL_POINTS);
glVertex2f(0.0f, 0.0f);
glEnd();

renders a single pixel in the middle. Smooth points don't show up at all, even without blending.

I checked for errors, but of course OpenGL reported none.


Top
Profile
 
 PostPosted: Mon Sep 06, 2010 7:53 pm  Post subject: Re: GL_POINT_DISTANCE_ATTENUATION
Offline

Joined: Mon Sep 06, 2010 7:47 pm
Posts: 1
You have to set the minSize and maxSize of points before using distance attenuation. The driver looks at this instead of pointsize when your values aren't the default { 1.0, 0.0 0.0 }.


Top
Profile
 
 PostPosted: Mon Sep 06, 2010 9:19 pm  Post subject: Re: GL_POINT_DISTANCE_ATTENUATION
Offline
Shutout Match Winner
User avatar

Joined: Fri Aug 28, 2009 5:53 pm
Posts: 945
Location: OMGLAGville
Over 2000 views and only one possibly helpful tip :P

_________________
Boxed


Top
Profile
 
 PostPosted: Mon Sep 06, 2010 10:22 pm  Post subject: Re: GL_POINT_DISTANCE_ATTENUATION
Offline
A Brave Victim
User avatar

Joined: Thu Feb 03, 2005 12:50 am
Posts: 3356
Location: Not really lurking anymore
Wow, it's been so long I forgot what I was doing there. But thank you for your help.

_________________
ˌɑrməˈɡɛˌtrɑn


Top
Profile
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by two camels and phpBB © 2000, 2002, 2005, 2007 phpBB Group