PDA

View Full Version : Problems with pointsize using POINT_SPRITE_ARB in a paritclesystem



Green Mamba
11-08-2004, 06:29 AM
Hello,

im new here in this forum. :)
I want to build a particle system in opengl, and i fount the extension GL_POINT_SPRITE_ARB. Now, i want the particles in specific sizes related to the viewing distance.
If i call glPointSize (..) betwenn the glBegin (GL_POINTS) and glEnd() i got an runtime-error. If i call the glPointSize befor the glBegin, the it runs fine.
The problem is that if i have to call for every point glBegin and glEnd, i do min. 3 funktion calls per point, e.g.

glBegin (GL_POINTS);
glVertex3f (x,y,z);
glEnd();I am looking for a trick, so i can adjust the pointsize more easy, and effizient. :)
Another Problem is, that in this way i also have to calculate the point size on the cpu, perhaps it is also possible to do that on the gpu!?
At this time, i get the GL_MODELVIEW_MATRIX, and multiply every Point whith this matrix to get the z-distance.

Sorry for my bad english, i hope you understand my problem. If you have problems understanding my thread, please ask me! ;)

Greez from germany,

Timo

ScottManDeath
11-08-2004, 07:21 AM
Either you calculate them by yourself using GL_ARB_vertex_program or using GLSL.
Or you look into the GL_ARB_point_parameters extension (IIRC also part of OpenGL 1.4). The latter enables calculation of point size attenuation based on the eye-space z-distance.

btw, Cross posting (http://www.forum-3dcenter.org/vbulletin/showthread.php?t=181997) is a bad habit ;)

RigidBody
11-08-2004, 07:43 AM
schnueffler... :p

Green Mamba
11-08-2004, 10:57 AM
Thank you very much for this Info!
And sorry for cross-posting, but how you can see, i got a better chance for an answer. ;)
Tomorrow i will test this extension, i hope i make it.
I think it not seems easy to read the extension-explanations. :(