Point sprite size
Hi,
I'm doing a particle system, and i would like to draw particles with point sprites instead of quads. But when i launch my program there's one really strange thing, when i'm far from the particles they are very very big, and when i approach the particles size is decreasing. And well this is not what I want :). This doesn't happen with quads so is there anyone here who can explain why this is happening, and how to get particles which keep the same size ?
You have to set the attenuation.
glPointParameterfvARB(GL_POINT_DISTANCE_ATTENUATION_ARB,quadratic)
glPointParameterfvARB(GL_POINT_THRESHOLD_SIZE_ARB, 60.0f)
set up max and min sizes too
set up tex env if you are using it
quadratic float[] = { 1.0f,0.0,0.01f}
you can change them but I really have not found much information on what those parameters exactly do and this works well in most cases.
There is a demo at code sampler you can download and look at. Only thing I do different is I use a VBO/array instead.
glPointParameterfvARB(GL_POINT_DISTANCE_ATTENUATION_ARB,quadratic)
glPointParameterfvARB(GL_POINT_THRESHOLD_SIZE_ARB, 60.0f)
set up max and min sizes too
set up tex env if you are using it
quadratic float[] = { 1.0f,0.0,0.01f}
you can change them but I really have not found much information on what those parameters exactly do and this works well in most cases.
There is a demo at code sampler you can download and look at. Only thing I do different is I use a VBO/array instead.
Hi,
thanks for help, but i tried it and well, it doesn't do the same effect as quads. Wether you're near or far, with quads you keep the volume aspect of the particle system. But with point sprites, when you approach the particles you can see each particles and you loose the volume effect.
It's quite hard to explain and my english isn't that good :/
It seems like i'm going to keep quads for the particle system because i really don't see anything on the net that solve that problem
thanks for help, but i tried it and well, it doesn't do the same effect as quads. Wether you're near or far, with quads you keep the volume aspect of the particle system. But with point sprites, when you approach the particles you can see each particles and you loose the volume effect.
It's quite hard to explain and my english isn't that good :/
It seems like i'm going to keep quads for the particle system because i really don't see anything on the net that solve that problem
You can always write a vertex program to adjust the size of each point. I tried the 1st reply's suggestion over the summer and found that the point sizes still didn't look right, because they don't completely mimic the gluPerspective camera model.
Huh, I don't understand. I did this and my results are almost exactly the same as using quads. There are only a few effects that can't use point sprites effectively.
Other guy, could you by chance pose a code snippet on how you attenuated the point sizes in the vertex program? I have been stuck on how that is done.
Other guy, could you by chance pose a code snippet on how you attenuated the point sizes in the vertex program? I have been stuck on how that is done.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement