Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for Geometry Shaders #10817

Closed
curly-brace opened this issue Aug 31, 2017 · 21 comments
Closed

Add Support for Geometry Shaders #10817

curly-brace opened this issue Aug 31, 2017 · 21 comments

Comments

@curly-brace
Copy link

curly-brace commented Aug 31, 2017

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.

@reduz
Copy link
Member

reduz commented Aug 31, 2017 via email

@akien-mga
Copy link
Member

akien-mga commented Aug 31, 2017

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.

@curly-brace
Copy link
Author

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

@BastiaanOlij
Copy link
Contributor

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 :)

@curly-brace
Copy link
Author

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.

@koopa
Copy link

koopa commented Feb 12, 2018

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.

@reduz
Copy link
Member

reduz commented Feb 12, 2018 via email

@Zylann
Copy link
Contributor

Zylann commented Mar 11, 2018

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

@chjhong
Copy link

chjhong commented Mar 23, 2018

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)

@frankiezafe
Copy link

frankiezafe commented Jul 22, 2018

@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?

@AndreaCatania
Copy link
Contributor

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

@AndreaCatania AndreaCatania added this to the 3.2 milestone Sep 26, 2018
@ConnorBP
Copy link

ConnorBP commented Apr 1, 2019

I'm guessing nobody decided to add this?

@bfishman
Copy link

bfishman commented Apr 1, 2019

definitely interested, along with compute shader support

@Chaosus
Copy link
Member

Chaosus commented Apr 2, 2019

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

@ConnorBP
Copy link

ConnorBP commented Apr 3, 2019

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

Is Vulkan even arriving any time soon?

@Chaosus
Copy link
Member

Chaosus commented Apr 3, 2019

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..

@ConnorBP
Copy link

ConnorBP commented Apr 4, 2019

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.

@ConnorBP
Copy link

ConnorBP commented Apr 4, 2019

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.

@Chaosus Chaosus mentioned this issue Apr 20, 2019
2 tasks
@Calinou Calinou modified the milestones: 3.2, 4.0 Aug 17, 2019
@TheRealNOIG
Copy link

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.

@akien-mga
Copy link
Member

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.

@kalysti
Copy link
Contributor

kalysti commented Mar 5, 2021

https://github.com/sboronczyk/godot-opengl-4

OpenGL 4.6 branch, geometry and tesselation supported

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.