Jump to content
  • Advertisement
Sign in to follow this  
hogwash

Stretching 2d point sprites

This topic is 4699 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!