Tessellation On The Gpu

Started by
4 comments, last by Hollandera 7 years, 8 months ago

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?

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.

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.

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.

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

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.

This topic is closed to new replies.

Advertisement