I'm learning about using Ogre particles and had some questions about how the point type particles work.

Q. I believe point type particles are implemented as a single position. Is one single vertex is passed to the vertex shader?

Q. If one vertex is passed to the vertex shader then what gets sent to the fragment shader?

Q. Can I pass the particle size to the shader? Perhaps with a custom parameter?

  • \$\begingroup\$ I think, if my memory hasn't failed me, that particles in Ogre can be simulated using sprites. But most effects imply 4 vertices for each billboard, where the billboard position is at the center of that rectangle/square. You can then pass the size to your vertex shader and modify the billboard size by multiplying the vertices since their origin is (0,0,0) in object space. That's one way to dynamically control the size of the billboards via uniforms. I don't know how sprites are implemented behind the Ogre interfaces, but in all cases, you have at least 4 positions sent to the fragment shader.. \$\endgroup\$ – teodron Nov 20 '12 at 8:38
  • \$\begingroup\$ I haven't found all the answers yet, but it looks like you can pass a single vertex to the video card. Since it's not a polygon you must also pass the size of what you want to render (PSIZE semantic in nvidia Cg language). I think some of my answers are in chapter 6 (particles): http.developer.nvidia.com/CgTutorial/cg_tutorial_chapter06.html \$\endgroup\$ – Jay Nov 20 '12 at 12:41
  • \$\begingroup\$ Since you're using Ogre to do the job, and not manually interacting with the point sprite code (as suggested here gpgpu.org/forums/viewtopic.php?p=21834 ), try it and see if it works just by writing shaders for that particular particle system. You can then do some magic in the pixel shader if you like, since the vertex isn't good at scaling things anymore (apart from tampering with that PSIZE semantic). \$\endgroup\$ – teodron Nov 20 '12 at 12:57

Ogre can do 'point sprites' but it has some important caveats.

  • if the center of the sprite hits a screen edge it will be culled. Half the visible sprite will vanish when it's culled.

  • some video cards don't allow large sprites.

If you do choose to use point sprites under opengl you must set the pixel attenuation values or pixel sprite mode will not be enabled. The PSIZE parameter in the shaders will just not work. It's not obvious what it's doing under the covers. Generating vertices for the billboard for you or just generating a point sprite.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.