Sign in to follow this  
Tinyn

Point Sprites and texture coords.

Recommended Posts

I have this texture, it consists of an 8x8 grid of slightly different cloud puffs. For my particles I'm supposed to randomly assign each new particle one of the different puffs randomly. I'm trying to use GL_ARB_point_sprite, but when using this feature, it seems to always always use texture coords 0.0 to 1.0, and there is no way for me to specify "No, use 0.125,0.125 to 0.25,0.25". Its even ignoring the texture matrix.
glMatrixMode(GL_TEXTURE);
glPushMatrix();
glScalef(0.125f, 0.125f, 1.0f);
glTranslatef(0.125f, 0.25f, 1.0f);
glMatrixMode(GL_MODELVIEW);
has no affect at all. Any ideas?

Share this post


Link to post
Share on other sites
AFAIK there is no way of specifing other texturecoordinates for point sprites. There are also lots of other restrictions on point sprites. Because of this most people use billboarded quads for particle rendering.

Share this post


Link to post
Share on other sites
Well, where there isn't a normal way, theres always ARBfp.


!!ARBfp1.0
PARAM OFFSET = program.local[0];
PARAM SIZE = program.local[1];
TEMP COORD;
TEMP TEXCLR;
MAD COORD, SIZE, fragment.texcoord[0], OFFSET;
TEX TEXCLR, COORD, texture[0], 2D;
MUL result.color, TEXCLR, fragment.color.primary;
END

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this