glPointPerameterf glext libs and OpenGL
hello all
i am writing a particle engine in C++/OpenGL and i am using point sprites (oooh clever). everythign works fine, but i can't get the attenuation (particles vary in size according to distance from camera) to work. As far as i can gather i need glext to use the extensions contained within that library. i have included it and i have linked to it from my Makefile with the flag -lglext to no avail. i have looked in /usr/include/GL and glext is there with the stuff i need in it, but i have looked in /usr/lib and there is no libglext or anything like it. maybe i should post this on a linux forum, but if youre reading this its too late :P. in short, how can i get point sprite attenuation to work. thankyou to any replies, helpful, funny or just plain annoying, as there is NO documentation on this. another thing, in this closed post http://www.gamedev.net/community/for...opic_id=403529 it talks about this, but there is no evidence of an extension library being used. can enyone enlighten me? all the same problem really james waples, 14 |
Afaik opengl extensions don't have a library, only header file. If extension is supported by your driver, then function is declared within opengl library (-lopengl), without separate library.
If you want to be able to use extensions easily (and want code to be portable to windows), you should use ether GLEE or GLEW. However, you can work without them - you simply need to #include glext.h AND #define corresponding GL_VERSION level before that include. This is not portable and won't work on Windows(because OpenGL support on windows is crap - by default windows libopengl library (or opengl32.lib) has support for OpenGL 1.1 functions only(which is problem) - so you won't get anywhere without extension library on windows - you'll need to do a lot of wglGetProcAddress calls(you can see that in exapmle)). Note that glPointParameter is part of OpenGL standard since version 1.4 and normally (on linux) don't need extension. To use it on linux either use Code:
#define GL_VERSION_1_4 or use glee or glew library (see which has better license). Either of them won't work if your videocard/driver doesn't support OpenGL 1.4 or corresponding extension. Personally, I prefer "billboards" (camera aligned squares with textures - using shaders(which is better) or manually(which is slower)) to pointsprites, because point-spirtes has maximum size limitation, there will be a trouble if you change camera FOV (you'll need to recalculate attenuation), you can't rotate them (clockwise/counterclockwise) and when I worked with pointsprites last time (few years ago, on DirectX) ATI cards (Radeon 9000 at that time) had buggy pointsprite support so they didn't support attenutations at all with certain techniques. Also, you don't need extensions to create billboards - every card with texturing support will do. On other hand, managing pointsprites is easier and you can get rid of attenuations by writing vertex shader which will calculate point size according to current projection matrix, point size and position. Unfortunately I haven't done that in OpenGL, so I simply don't remember if pointsize is available within shader (in OpenGL) and can be changed by shader or not. Also, although such shader is possible, it won't solve all possible problems with pointsprites - AFAIK pointsprite is always square which can be a problem. Also, GLSL (shader language) requires OpenGL 2.0 or 1.5 with extensions, which can be too much for basic application. In short - if you want to use GL extensions in easy/portable way - use either GLEE or GLEW library. |
i have managed to get everything working with GLee - someone on GameDev.net pointed it out to me. your point with point sprites (pun intended) exactly what i have done, although i am thinking about looking into shaders. thankyou for your time and help
james |
All times are GMT -5. The time now is 08:32 PM. |