Point Sprite trouble

Started by
4 comments, last by Basiror 20 years, 9 months ago
i don t know what i am doing wrong but the attenuation values i pass are the default values and by default the size of the sprite doesn t change when you move it around but in my application the sprites get bigger and bigger the further they are away from the cam eye position any idea what i am doing wrong?

	  float att[] =  { 1, 0, 0 };
    glPointParameterfvEXT( GL_DISTANCE_ATTENUATION_EXT, att );

    glPointParameterfEXT( GL_POINT_FADE_THRESHOLD_SIZE_EXT, 1 );

    glPointParameterfEXT( GL_POINT_SIZE_MIN_EXT, 16 );
    glPointParameterfEXT( GL_POINT_SIZE_MAX_EXT, 64 );
    glTexEnvf( GL_POINT_SPRITE_NV, GL_COORD_REPLACE_NV, GL_TRUE );


    glEnable( GL_POINT_SPRITE_NV );
	glBegin(GL_POINTS);
	glPointSize(32);
	for(int i=0;i<1024;i++)
	{
		
		glVertex3f(16*i,0,128);
	}
	glEnd();
	glDisable( GL_POINT_SPRITE_NV );   
http://www.8ung.at/basiror/theironcross.html
Advertisement
It happened to me. I think that when the "camera" gets closer to the sprites the sprites get smaller because they can''t be bigger than 64(?) pixels.

"C lets you shoot yourself in the foot rather easily. C++ allows you to reuse the bullet!"
Member of the Shove Pouya Off A Cliff club, SPOAC. (If you wish to join, add this line to your signature.)Member of "Un-Ban nes8bit" association, UNA (to join put this in your sig)"C lets you shoot yourself in the foot rather easily. C++ allows you to reuse the bullet!"
is there a way to keep their size? thats really annoying

[edited by - Basiror on July 3, 2003 3:07:31 AM]
http://www.8ung.at/basiror/theironcross.html
I wonder about that too, I think it''s a typical property of point sprites. I do know that you can change it''s size, so you could make them smaller when you''re further away from the point sprite, but that''s not an ideal solution. My particle engine uses them because they''re hardware-accelerated, but I''m also still looking for a function that stabilizes their size.
[www.LifeIsDigital.net - My open source projects and articles.
there doesn t seem to be any


the only thing you could do is setting the min and max size parameters for each sprite and calculate this parameter at runtime

thus you still have a little performance boost over the other billboarding methods with quads/triangles and so on

but you need to know the scale function

btw i have 25000 particles in a 2 sited linked list( next & prev)
when i update all of them my frame drop from 380 to 200

is that acceptable?
http://www.8ung.at/basiror/theironcross.html
quote:Original post by Basiror
[...]
btw i have 25000 particles in a 2 sited linked list( next & prev)
when i update all of them my frame drop from 380 to 200

is that acceptable?


I think that''s acceptable: updating 25.000 particles in 1/200th of a second is pretty fast in my opinion. I don''t know if my own code is that fast, but that''s because my GUI is also done with OpenGL code.

"My basic needs in life are food, love and a C++ compiler"
[Project AlterNova] [Novanet]
[www.LifeIsDigital.net - My open source projects and articles.

This topic is closed to new replies.

Advertisement