Sign in to follow this  
AndrejJst

Particles and programmable pipeline

Recommended Posts

Hello Im working on a particle class with point sprites and have encountered a problem. I have managed to get particles to get drawn onto screen, with texture mapped to them. But problem is, they dont change size with distance. All render states are correctly set as is vertex buffer and draw function. I tested it in a sample app i got on this page i think and it worked. The only difference between my app and that, is, that i use my own effect files, vertex and pixel shaders. Could there be a problem? Andrej

Share this post


Link to post
Share on other sites
You'll need to have your VertexShader output a PSize value, which would be a float containing the size of the particle. You'll need to calculate this size in the VertexShader yourself, though.

You can have a look at the DX Docs to see how the Fixed Function Pipeline handles changing the size with distance, and even copy their math directly from there.

Hope this helps.

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