Sign in to follow this  
hogwash

Stretching 2d point sprites

Recommended Posts

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.

Share this post


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

Share this post


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

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