Particles and programmable pipeline

Started by
1 comment, last by AndrejJst 17 years, 7 months ago
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
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.
Sirob Yes.» - status: Work-O-Rama.
That was the solution. Thank you.

Andrej

This topic is closed to new replies.

Advertisement