Jump to content
  • Advertisement
Sign in to follow this  
poigwym

d3d11 frustum culling on gpu

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

I 'm going to implement frustum culling on gpu (not sure gs or cs ). 

First fill the consume structure buffer objects, and cull them, output to append structure buffer.

I 'm not sure is it efficient ?  and don't know the detail about how to use append/consume buffer ..

Any sample to learn ?

 

Share this post


Link to post
Share on other sites
Advertisement

world matrices of static instance are stored in cbuffer,  and I don't want to frustum cull these static object 

and modify that cbuffer, so cull them on gpu and  indirect draw may be better, I think .

Share this post


Link to post
Share on other sites

sorry to say I just looking for an aabb frustum culling on gpu implementation.

Something look like this:

struct InstData 
{
    matrix world_mat;
   aabb;
};
cbuffer CB_Inst 
{
  InstData insts[1000];
};
 
 
AppendStructureBuffer<uint> id_of_visable;
ConsumeStructureBuffer<uint> id_of_all_objs;
 
[thread]
void cs_cull() 
{ 
  uint id = id_of_all_objs[thread_id];
if( inFrustum( insts[id].aabb ))
   id_of_visable.append(id);
}
  
Edited by poigwym

Share this post


Link to post
Share on other sites

 

Um...

 

I think you may be missing the point of frustum culling...

what point?

 

usually to save tons of CPU work, to maintain streaming and manage memory. Frustum culling on CPU is quite efficient and you might not have any benefits of doing it on GPU unless you have some very specific case.

Share this post


Link to post
Share on other sites

Not sending a ton of unused data to the GPU is another part of it. It's less of an issue than it was a few years ago, but it's still pretty relevant. I guess I could see doing a sloppy CPU cull and then doing cleanup and clipping on the GPU, but I can't imagine that it would be more effective to upload render instructions for every object in the scene and then leave the GPU to sort it all out.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!