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

Geometry Shader - for subd of dyn mesh #2075

Closed
JeffGillin opened this issue Jan 5, 2021 · 7 comments
Closed

Geometry Shader - for subd of dyn mesh #2075

JeffGillin opened this issue Jan 5, 2021 · 7 comments

Comments

@JeffGillin
Copy link

JeffGillin commented Jan 5, 2021

Describe the project you are working on

Any game with lots of dynamic mesh generation.

Describe the problem or limitation you are having in your project.

Subdivision of dynamic mesh (subdivision would be too slow if cpu bound).

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Geometry shaders to subd a mesh within shader instead of godot code

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Another shader function named "geometry()" that would allow you to add/remove mesh data.

If this enhancement will not be used often, can it be worked around with a few lines of script?

Could probably be worked around with gpu compute, but then dealing with 2 passes to gpu (one to compute subd, and one to render). Geometry shader wouldn't require second call.

Is there a reason why this should be core and not an add-on in the asset library?

Yeah, part of the shader language ...

@fire
Copy link
Member

fire commented Jan 5, 2021

The game graphics industry consensus is that you create tessellation using compute shaders and not tessellation stages and definitely not geometry shaders. I can go into more detail. Its related to the fact you can not create new geometry.

@SIsilicon
Copy link

@fire Please go into more detail. I'd like to know more.

@fire
Copy link
Member

fire commented Jan 5, 2021

Have to do things but here is a article. http://www.joshbarczak.com/blog/?p=667

@clayjohn
Copy link
Member

clayjohn commented Jan 5, 2021

Most GPUs offload the geometry shader stage to the CPU which creates huge CPU and bandwidth bottlenecks on anything but the simplest demo projects. For that reason, we have decided in the past not to add support for them.

@Calinou
Copy link
Member

Calinou commented Jan 5, 2021

See also #784.

@Chaosus
Copy link
Member

Chaosus commented Jan 10, 2021

There was even the implementation by me godotengine/godot#28237. If you really need them you can rebase this PR and recompile the engine.

This proposal has no way to realize. @reduz said the points of why:

  • Geometry shaders are being deprecated in modern API versions. They are inefficient and can be better replaced with Compute.
  • Geometry shaders are not well supported in modern hardware. They remain there for compatibility but they are not very efficient.
  • Godot uses OpenGL ES 3.0, which does not support them, so they won't work on mobile.
  • There is not high demand for the feature.

@Calinou
Copy link
Member

Calinou commented Sep 2, 2021

Closing, as geometry shaders will not be implemented in 4.0 or later given they are deprecated and not present in Vulkan. See also #2075 (comment).

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

No branches or pull requests

6 participants