Point Sprites + Motion-based distortion?

Started by
-1 comments, last by Qatal 17 years, 5 months ago
Hi This is just something I've been thinking about; Looking for feedback, or better still, to be told "yes that might work, but everyone does it using XYZ technique instead, for reason FOO". :) I've recently implemented a particle system with point sprites. I set up a vertex buffer and matching CPU-side array of my particle type, simulate on the CPU, and copy the active block of particles to the VB once per frame. It's simple, and it works. However, point sprites give me square sprite support only, and I'm not so keen on that :P In particular, I want to be able to distort a sprite in the direction of its motion. It would be nice if it required no CPU intervention also; (a nice big block-copy wins, performance-wise, than having to calculate stuff CPU-side). So, my proposed method, in the vertex program: - Figure out how much distortion we need by some magic formula - Turn that into a basis for sampling the texture, to pass to the fragment program without the interpolator blowing it up (just make it constant over the whole sprite if we can't turn the interpolator off) - Figure out how much we need to enlarge the sprite (psize) to fit the distorted form In the fragment program: - Transform the input texcoords (which DX9 maps naively over the whole surface of the sprite) using the basis passed to us by the vertex program - Look up the sprite texture using those coords. - Everything falling outside 0..1, 0..1 ends up transparent. Comments/opinions/why-it-wont-work please :) Cheers, Chris
die or be died...i think

This topic is closed to new replies.

Advertisement