Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>you can do something like this to represent the particle, </p> <pre><code>struct Particle { D3DXVECTOR3 position; float angle; }; </code></pre> <p>then just update the x and y coordinates (or x and z if your ship moves on that plane) from a velocity and calculate the new height with some basic formula instead of a physics one ie. something with "sin" and "time" so it doesn't get too far from the plane where the ship moves. You can have them all in a dynamic vertex shader and render them all together in a single call.</p> <p>For directx 9 you have "point sprites" <a href="http://msdn.microsoft.com/en-us/library/bb147281%28v=vs.85%29.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/bb147281%28v=vs.85%29.aspx</a></p> <p>I think for newer versions you have to do the job in the shader, but I'm not sure. The idea would be just send points with the positions and probably some attribute you need and constructing the particle image once in the shader (a quad with some texture most likely). </p> <p>You will probably find this link useful, at least to get some ideas. It's a bit old though but many concepts still apply: <a href="http://www.markmark.net/clouds/RTCRPubs.html" rel="nofollow">http://www.markmark.net/clouds/RTCRPubs.html</a></p> <p>There are also other ways in which you don't even have to modify the buffer... you can calculate a point for a trajectory given a starting position and a time elapsed since the start, but then it would be harder to implement an effect of a force caused by the ship's movement. So you have to find the best method to suit your needs.</p> <p>EDIT: Sorry I meant to say a "dynamic vertex buffer" for the single call </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload