-
-
Notifications
You must be signed in to change notification settings - Fork 99
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
Expose the starting vertex position and number of primitives to be drawn in ImmediateGeometry #2705
Comments
Note that ImmediateGeometry is not reimplemented in the In |
Hello Calinou, The new tittle is exactly what I have in mind, hopefully it can be implemented whenever it will be readded and can change the vertices information that's already been added along with it's starting vertex position and primitives count. Many Thanks! |
I would prefer to see this kind of functionality added to the mesh API instead. I think it would make more sense there given the purpose of the two APIs ImmediateGeometry is meant to give users a way to quickly put a mesh together each frame. It is much slower than using an ArrayMesh, but it is much faster than recreating an ArrayMesh every frame. Accordingly, ImmediateGeometry is best used when you have to update every vertex (or most vertices) per frame. The mesh API already has mesh_surface_update_region which allows users to just updated a specific portion of the mesh. This is ideal for the use-case you describe. During regular frames, no data needs to pass from the CPU to the GPU and you get the full speed of using a mesh, you only incur the cost of updating on the frames that you update and only for as much of the buffer as you choose to update. The big problem with Similar with the starting_vertex and primitive_count feature. Internally, when drawing a mesh, OpenGL asks for the starting vertex and how many vertices to draw. This could be exposed to the user for regular meshes. |
Hello ClayJohn, I'm playing with SurfaceTool and ImmediateGoemetry for my procedural mesh and looking for this kind of solution. It's nice to know that the vertex data can be updated using mesh_surface_update_region and I think this will suffice what I'm looking for, the only lacking is specifying the StartVertexPosition and PrimitiveCount ^_^y If this can be implemented in any tool whether in SurfaceTool, ImmediateGoemetry or directly to mesh-surface that would be great, super cool if implemented in a user friendly manner. If the vertex data can be buffered and define once at the same token we can update it, the processing will be much faster because there is no clearing of previous vertex data and setting it up again and we are sure it will be drawn in a single draw call. During XNA time I can create millions of lines and triangle using DrawUserIndexPrimitives because I can buffer the vertex data I needed a head of time and update only the vertices position and set the vertex offset and number of primitives. Many thanks and kind regards, DexterZ |
The ImmediateGeometry node was removed in favor of the ImmediateMesh resource in 4.0 (which you can add to a MeshInstance3D or MultiMeshInsatance3D). Does that change anything about this proposal? |
Describe the project you are working on
I'm working on an RTS game which consist of lots of dynamic procedural mesh, such as 3D trail, debug lines
etc,,,
Describe the problem or limitation you are having in your project
ATM 3D trails are created by Clearing the IG and adding the vertices again even with same previous length because that's how IG work.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Since the vertices are already put in IG, it would be nice if the vertices can be expose and edited and give the user to define the StartingVertex position and the number of PrimitiveCounts to be drawn.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
to make the example simpler to understand I'll just use primitive lines,
If this enhancement will not be used often, can it be worked around with a few lines of script?
Sure but clearing and creating the vertices everything in IG might be slow,
Is there a reason why this should be core and not an add-on in the asset library?
This will benefit everyone because it's out of the box features : )
The text was updated successfully, but these errors were encountered: