Godot: Add Support for Geometry Shaders

Created on 31 Aug 2017  Â·  20Comments  Â·  Source: godotengine/godot

they are part of specification from OpenGL 3.2, so would be fine to add them to godot?

they will allow to make some geometry complexity modifications (because tessellation shaders aren't available for us, because they are OpenGL 4 feature), they will allow creating good grass on the fly, trees, fur. controlling LODs from the shader itself. and some people even create performant voxel engines using them.

and last but not least, it will allow to recalculate normals on the mesh that was changed by vertex shader.

archived feature proposal rendering shaders

Most helpful comment

Could we add tessellation shaders though? They seem to be more efficient and used in games rather than geometry shaders.

Also, that would be a game changer in terrain LOD and grass implementation

All 20 comments

this should not be too difficult to do, but leaving it for after 3.0..

On Thu, Aug 31, 2017 at 10:25 AM, Curly Brace notifications@github.com
wrote:

they are part of specification from OpenGL 3.2, so would be fine to add
them to godot?

they will allow to make some geometry complexity modifications (because
tessellation shaders aren't available for us, because they are OpenGL 4
feature), they will allow creating good grass on the fly, trees, fur.
controlling LODs from the shader itself. and some people even create
performant voxel engines using them.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/godotengine/godot/issues/10817, or mute the thread
https://github.com/notifications/unsubscribe-auth/AF-Z27JKTbtKW6Pr5OGKn7_xvgBvo7exks5sdrRcgaJpZM4PI0xL
.

Geometry Shaders seem to only be in OpenGL ES 3.2 though, IINM.
https://en.wikipedia.org/wiki/OpenGL_ES#OpenGL_ES_3.2
https://www.khronos.org/registry/OpenGL/extensions/OES/OES_geometry_shader.txt

So it would be desktop only.

@akien-mga oops. i haven't looked at ES specs 😞

Something probably to make optional as even when it is supported, on older hardware it can be slow. I don't know what mechanism we're thinking off later on to switch back to say OpenGL ES 2 for older devices but maybe that can be applied here too?

I've had some great fun with geometry shaders and would love to play around with those in Godot :)

well, talking about supporting different features for different platforms, i think adding gl4 support would be very cool because it will add tessellation shaders and compute shaders which may allow creating very nice graphics.

this is somehow done in mainstream engines? they support themselves high-end features, but allow to export to low-end platforms. i don't know how it is done, but may be they just throw away parts that aren't supported on target platform? and it is up to game developer to manage this, so that graphics aren't to bad without tessellation for example.

This discussion was the first thing I found when I searched for Godot geometry shader support. Seeing as it's still open I hope you don't mind me just going ahead and asking some of those question right here.
Firstly, related to this discussion: I am looking whether or not we can use own geometry shader programs in godot 3+. Is there any updates/progress on that?

And more generally, where would I go to find out about the status of specific features like this one and what other people are working on or interested in without actually browsing their branches?
Is there maybe even some sort of feature voting system where people can vote for the features they most want to see or is it all handled in this github issue system? Apologies if those last few questions don't belong here but thanks for any information.

Not supported, but should not be difficult to add eventually in 3.0. Just
not a priority unless somebody wants to work on it

On Feb 12, 2018 15:34, "kon" notifications@github.com wrote:

This discussion was the first thing I found when I searched for Godot
geometry shader support. Seeing as it's still open I hope you don't mind me
just going ahead and asking some of those question right here.
Firstly, related to this discussion: I am looking whether or not we can
use own geometry shader programs in godot 3+. Is there any updates/progress
on that?

And more generally, where would I go to find out about the status of
specific features like this one and what other people are working on or
interested in without actually browsing their branches?
Is there maybe even some sort of feature voting system where people can
vote for the features they most want to see or is it all handled in this
github issue system? Apologies if those last few questions don't belong
here but thanks for any information.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/godotengine/godot/issues/10817#issuecomment-364958768,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AF-Z25H8J6qtkn36Z1y8ot47XyXlxX6xks5tUFntgaJpZM4PI0xL
.

Could we add tessellation shaders though? They seem to be more efficient and used in games rather than geometry shaders.

Also, that would be a game changer in terrain LOD and grass implementation

I care about android mobile. OpenGL ES3.1+ AEK(Android_Extension_Pack) can do it. include tessellation.
---- like the XiaoMi RedMi 5 plus, the one of the cheapest mobile last year in China, can hold it. Almostly, the mobile ,sold after 2015.1 in China, all of them can hold it.
from wiki, supported hardware including:
Adreno 420 and newer (Android)
Mali-T760 and newer (Android)
Nvidia GeForce 400 series (Fermi) and newer (Windows, Linux)

@reduz : hello, as i need geometry shaders for the code i'm working on for the moment, could you point classes to be adapted? it would save several of hours of guessing :)
The main issues should be:

  • loading the shader from the harddrive,
  • binding it correctly (https://learnopengl.com/Advanced-OpenGL/Geometry-Shader),
  • ensure the communication with vert & frag parts (might be tricky due to the relative automation of the shaders and editor interactions),
  • and making the whole stuff optional (auto detection if possible).

Am i right?

What's about this feature proposal? I'm moving it to 3.2

I'm guessing nobody decided to add this?

definitely interested, along with compute shader support

I guess, now it is pointless to add until Vulkan will be supported

I guess, now it is pointless to add until Vulkan will be supported

Is Vulkan even arriving any time soon?

Is Vulkan even arriving any time soon?

No, it planned to 4.0 which planned to the end of the year (maybe + another year). The GLES3 renderer which currently may support geometry shaders, however, may be stayed until it properly implemented - afterward, it will be removed. And maybe it's not pointless and not so linked to the renderer, at least for shader language..

Yeah I think it is definitely worth it if anyone decides to take on the task. It is a very important feature for modern engines and if someone already knows how the Vulkan system works then they could write it keeping in mind how they would need to change it for Vulkan later so that there would essentially already be support waiting for the new render-er-er when it eventually comes way down the road. Both render systems were made by the same group so even though Vulkan is fundamentaly different it shouldn't be an impossible task to abstract a few things so they can be "easily" ish plopped into Vulkan later.

For now custom modules would be the way to go i suppose. Not as nice as built in engine support however in terms of prototyping, iteration, accessibility etc.

I noticed a comment from Reduz in merge request #28237
"For Godot 4.0, the plan is to create compute shaders that do a similar functions, but merging this for 3.x branch does not make much sense if it's going to be removed in 4.0 months later."
Would this make this feature request obsolete due to the lead engineer closing the merge request for 3.X and saying they will not support geometry shades in 4.0? Or is there still potentail of geometry shades being support in later version of Godot.

Indeed, thanks for the reminder. This feature proposal should be closed as #28237.

Geometry shaders were added in OpenGL 3.2, but since we're going to remove the OpenGL 3.3 renderer to replace it by Vulkan (and the more flexible compute shaders), it doesn't make sense to implement geometry shaders support indeed.

If anyone really needs it in 3.2, the PR #28237 can likely be cherry-picked in your local branch and further improved to be usable in production.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ducdetronquito picture ducdetronquito  Â·  3Comments

bojidar-bg picture bojidar-bg  Â·  3Comments

n-pigeon picture n-pigeon  Â·  3Comments

Spooner picture Spooner  Â·  3Comments

mefihl picture mefihl  Â·  3Comments