-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
VERTEX_ID and mesh-less rendering #19473
Comments
I've done this a few times in my own engine. Its a cool technique though with limited applications. Adding the vertex index to the shader should be easy, it should already be there as its a build in variable on the GLSL side so the parser just needs to know it exists. |
This comment has been minimized.
This comment has been minimized.
Sadly we are entering to feature freeze phase. Pushed to 3.2 |
A more specific bump, I'm interested in using the vertex_id for scientific analysis purposes unrelated to mesh-less rendering, so please, if added, just support having access to the index in the shader. The details: As of right now, I need to store the vertex_id in the uv, which is a hack. |
The VertexID would be really nice to have to make custom vertex attributes (via texture uniform) easier (and also a lot of other cool stuff possible). If i would send a PR to expose gl_vertex_id would there be any chance it would be accepted before 4.0 ? It should be easy to do and not much of code. |
@SleepProgger new features for GLES3 will not be merged. Especially if it is not compatible with GLES2. However, new features will be considered in the master branch if targeting the GLES2 and/or Vulkan backends. |
Good to know, thanks. |
Feature and improvement proposals for the Godot Engine are now being discussed and reviewed in a dedicated Godot Improvement Proposals (GIP) (godotengine/godot-proposals) issue tracker. The GIP tracker has a detailed issue template designed so that proposals include all the relevant information to start a productive discussion and help the community assess the validity of the proposal for the engine. The main (godotengine/godot) tracker is now solely dedicated to bug reports and Pull Requests, enabling contributors to have a better focus on bug fixing work. Therefore, we are now closing all older feature proposals on the main issue tracker. If you are interested in this feature proposal, please open a new proposal on the GIP tracker following the given issue template (after checking that it doesn't exist already). Be sure to reference this closed issue if it includes any relevant discussion (which you are also encouraged to summarize in the new proposal). Thanks in advance! |
@SleepProgger @bmillare @Zylann In case you want to manually add support for VERTEX_ID, these are the changes I had to make in In
and
Then compile the source and it should work. |
For the record, since this is the first Google result when searching "Godot vertex id" – VERTEX_ID is implemented as a shader variable in Godot 4. |
A friend of mine explained me an interesting rendering technique recently:
In some cases, you can render particles, grass, water or terrain chunks without using any mesh, and generating the geometry procedurally in the vertex shader, without geometry shader.
For example:
The idea is to expose the VERTEX_ID builtin from GLSL in the shading language, and add the ability to draw something without specifying a vertex array. Instead, just specifying how many vertices there are, but without data (oh my god! No vertices? Mind = blown).
I think it should work in the version of OpenGL Godot uses.
The advantages are:
Now, I'm aware that probably nobody in Godot thinks about it, since it's a kind of optimization you can do in an advanced stage of a game's development, but it's an interesting technique to consider.
The text was updated successfully, but these errors were encountered: