Jump to content
  • Advertisement
Sign in to follow this  
ehmdjii

Easy to do Geometry Shader Example

This topic is 2777 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,
i'm starting to learn geometry shaders using CG.

i am looking for a fun and easy to do example or tutorial. something where you can have a "reasonable" result at the end and not just some randomly floating triangles.

does anyone have any ideas on what to do which is not too hard for a beginner?

thanks!

Share this post


Link to post
Share on other sites
Advertisement
I don't know of any Cg tutorials, but one of the simplest and most useful things you can do with a geometry shader is expand a single point into a quad. Very handy for particle system rendering. Basically you transform the point to view space in the vertex shader, then in the geometry shader you billboard in view space so that you can emit 4 new vertices forming a 2-triangle strip.

Share this post


Link to post
Share on other sites

I don't know of any Cg tutorials, but one of the simplest and most useful things you can do with a geometry shader is expand a single point into a quad. Very handy for particle system rendering. Basically you transform the point to view space in the vertex shader, then in the geometry shader you billboard in view space so that you can emit 4 new vertices forming a 2-triangle strip.


thanks for the tip! sounds good! do you maybe have any sample code for that? if not in CG, GLSL or HLSL is ok too.

Share this post


Link to post
Share on other sites
The only one I know off the top of my head is the SoftParticles sample that ships with the DX SDK.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!