Jump to content
  • Advertisement
Sign in to follow this  
thedodgeruk

geometry shader outstream ?

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

as far as i can tell and looking at some sfk , the reson for out stream on geometry shadedr , is to loop that back into the input strem , so that a prticle system does all the worrk its self without any cpu

is there a way to output information though that the cpu can see, ie.e number of particles in the geometry shader

i am using the geometry shader for a particle system .
when you call the draw command, its draw (numberOfEntitys, 0);

i was wondering if the geometrty shader can output a number so i can use that number in the draw command, instead of a fixed number

Share this post


Link to post
Share on other sites
Advertisement
You might want to take a look at the 'drawAuto' family of functions (assuming D3D, OpenGL also has the functionality but I'm not so sure on the name); if memory serves they allow you to take a buffer which has been written by the GPU as a draw source and use it without having to say how many elements are in it.

Share this post


Link to post
Share on other sites
Are you sure you need a geometry shader?
I used a simple transform feedback objects and a pair of VBO's (OpenGL) for my particle system and it does just what you say.
For DirectX its called stream out.

Share this post


Link to post
Share on other sites
Using stream out technically requires a geometry shader, since that's the only stage that can do it. In practice you do not actually need to author a GS if you're just going to stream out every primitive.

If you're using D3D11 you also have access to AppendStructuredBuffer's, which allow a compute shader or pixel shader to append elements to a buffer.

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!