• Advertisement
Sign in to follow this  

Tessellation On The Gpu

This topic is 625 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 am making a 3D modeling application and I was wondering whether it's possible to send a mesh through a geometry shader, for tessellation, and get results back to the CPU. I am trying to replace the old mesh with the new, tessellated, one. How is this done in other 3D modeling applications? Does the whole process happen on the CPU?

Share this post


Link to post
Share on other sites
Advertisement

The short answer: Yes, it's possible.

 

The explanation: You need a way to (comfortably) get back the data from the GPU to the CPU - if you can rely on modern APIs, that usually means a buffer, like a shader storage buffer in OpenGL, where you can write to from all of your shaders (geometry included, I think). Or transform feedback, but nowadays it's kind of outdated if you could use ssbos.

 

The question is: Does it make sense? The pipeline needs some sort of.... synchronistation between GPU and CPU. Not to talk about that you have to transfer your "modeling actions" somehow to the GPU. And if one action affects multiple vertices at once, things start to get complicated. There's a concept called "pinned memory" (OpenGL world calls it persistent mapped buffers), where you represent your vertex buffers in persistent memory and do synchronization by yourself. With this concept, you could easily work on your native buffers on the CPU side and synchronize before you draw - easiest, probably fastest way I could imagine.

Edited by hannesp

Share this post


Link to post
Share on other sites

I see. I'll then do it on the CPU and if there is OpenCL or CUDA supported GPU, I will compute it on the GPU.

Share this post


Link to post
Share on other sites

No, to my knowledge it isn't possible to retrieve geometry generated by a geometry shader. Data generated in a graphics pipeline is purged after completion so keeping changes made by a vertex or a tessellation shader isn't possible either. You'll need to make your changes either using a compute shader or on the CPU.

Edited by GameGeezer

Share this post


Link to post
Share on other sites

No, to my knowledge it isn't possible to retrieve geometry generated by a geometry shader. Data generated in a graphics pipeline is purged after completion so keeping changes made by a vertex or a tessellation shader isn't possible either. You'll need to make your changes either using a compute shader or on the CPU.


Of course it's possible, that's exactly what transform feedback (stream output in D3D) does.
IC412556.png

Share this post


Link to post
Share on other sites

 

No, to my knowledge it isn't possible to retrieve geometry generated by a geometry shader. Data generated in a graphics pipeline is purged after completion so keeping changes made by a vertex or a tessellation shader isn't possible either. You'll need to make your changes either using a compute shader or on the CPU.


Of course it's possible, that's exactly what transform feedback (stream output in D3D) does.
IC412556.png

 

 

Oops I didn't know about transform feedback, thanks for correcting me.

Edited by GameGeezer

Share this post


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

  • Advertisement