Archived

This topic is now archived and is closed to further replies.

Basiror

Point Sprite trouble

Recommended Posts

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 );   

Share this post


Link to post
Share on other sites
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!"

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites