• Advertisement
Sign in to follow this  

Particles and programmable pipeline

This topic is 4184 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

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

  • Advertisement