Open turol opened 2 years ago
I think geometry shaders were an experiment to try to "upres" some geometry. Not sure they actually made it into the mainstream experience. And yeah, I've read that avoiding geometry shaders is preferrable.
I think it was used for rendering multiple shadow map faces (cube or cascade) with one draw call. Less CPU load, more GPU load.
One general use case was generating a camera-facing quad from a point, used for things like particles or other billboards. But yes, now it's considered obsolete.
https://github.com/WolfireGames/overgrowth/blob/08da859107194d3d283c6b54565bffb656478a26/Source/Graphics/shaders.cpp#L708
IIRC this was for geometry shaders which were sometimes required and sometimes not. However this depended on the shader preprocessor flags so the hack we came up with was to
#error
in the shader code and then just ignore any errors in geometry shaders. This should be re-thought. Are geometry shaders even used anymore? It's discouraged nowadays and several platforms don't support them, Vulkan makes it an optional feature and Metal doesn't support it at all.