Doubt on geometry shaders

Hello everyone, I’m currently exploring geometry shaders for my project.

Although I’ve gone through all the tutorials, I’m still unsure about applying geometry shaders to existing code.

Specifically, I’m interested in implementing geometry shaders for dynamic level of detail in large molecules, using the code from this repository as a reference:

Could someone please provide guidance on how to integrate geometry shaders into this project? Thank you!

The general recommendation is that the geometry shader is not a good fit for this type of use case. Tessellation is better. Geometry shaders can be used for where you (1) need to perform an operation on an entire triangle, rather than it’s individual vertices, and (2) where you need access to all three vertices in the triangle in order to perform that operation. But dynamically creating additional triangles is not a good use case owing to the performance characteristics and constraints of geometry shaders.

Thank you for your prompt response. Yes, I agree that using tessellation could be a more effective approach. However, I still have some confusion about how to integrate these elements into the project. For instance, I will be working with complex chemical molecules that will necessitate the use of tessellation shaders. Would you recommend adjusting the vertex shaders, or is there another step required to implement these features?

also i think, we need both tessellation and geometry shaders for getting these tasks done? Maybe adding few stages b/w geometry and vertex shaders for tessellation. Please let me know your thoughts on this?

@mhagain ???
Please help on this. I just need to ask…weather we need to add tessellation shader in between the geometry and vertex shader, or just we need to add tessellation shader without geometry shader

I thought the post was pretty clear:

Is there something that you didn’t understand?

1 Like

Thanks for your reply @Alfonse_Reinheart .I’m new to tessellation and have a basic understanding of its principles, including triangle for higher resolutions. However, I’m confused about how tessellations are actually implemented. While tutorials mention the stages of implementation


, they don’t delve into the specifics of how it’s done. How can we integrate them. I’d appreciate it if you could provide a good resource or explain the actual process of implementation. My project also deals with chemical molecules but we need to optimize the structures. something like things that are farther away can be tessellated with less detail. How can this be done actually?

The OpenGL Wiki article on tessellation goes into some detail on how tessellation shaders work. You’ll have to figure out how to map that to what you’re trying to do.