Stretching 2d point sprites

Started by
2 comments, last by hogwash 18 years, 5 months ago
Hi, I have a particle system which uses 2d point sprites. I would like to be able to stretch these particles based on their velocities and I was thinking of doing some kind of skew of the texture coordinates. Anyone have any ideas how I could implement this in a pixel/vertex shader? I also thought that I could increase the size (PSIZE) of each particle depending on how fast it is moving and using some kind of discard to remove areas of the texture which don't cover the skewed sprite. Hope that made sense! Thanks, Tom.
Advertisement
anyone?
Your best move would be to scale the size of the sprite quad and leave the same texture coordinates. That way you get the stretched texture effect. Also rotate the sprite so it's oriented with the screen-projected velocity direction. I don't see any reason to do this with a fragment program though.
We would like to stick with point sprites and our pipeline uses a shader to apply the texture, do rotation, scaling etc.

So... I was thinking that we could somehow manipulate the texture coordinates to make it looked skewed. The problem with point sprites is that they have to be square (ie. non rectangular)- that is why we could just enlarge the point sprites and discard pixels not in the rectangular region.

I'm just not too sure how to manipulate the texture coordinates in a manner that will give the impression that the particles are stretching as they move quicker.

Cheers,
Tom.

This topic is closed to new replies.

Advertisement