-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Move Blend Shape Modifiers to MeshInstance #2465
Comments
For reference, this was discussed in godotengine/godot#37854. |
I second this proposal change and more. I am getting PTSD if someone pings me and mentions Godot Blendshapes. Well, every improvement is welcome and I see a few issues with how blendshapes are currently implemented which is a pity as Blendshapes are such a core feature for 3D games and really cumbersome at the moment in both Godot 3.x and 4.x. Nearly half my opened issues have blendshapes as a topic. Might as well list them here again so they can be considered if someone should start on proposed rework and blendshapes receive a new home/format. Current Issues
So here is my wishlist if anyone feels brave enough to tackle Blendshapes: Implementation Wishlist:
|
I agree with most of this but have a few things I want to raise in contest:
|
I see what format you had in mind from your example, I think I misunderstood parts of your proposal. I meant the actual storage for the blendshape data as part of the mesh resource and on the visual server not just the interpolation values so my part about blendshape fileformat changes/concerns might be outside the scope of your proposal. If this is the case I am curious what is the point of moving just the interpolation values to a new modifier/resource. The mesh resource still needs to be kept unique to cause no Visualserver glitches and the large PoolByteArray numbers for each blendshape are currently all part of the mesh resource. So this proposal would keep the old status quo on this? I don't see how this would then be able to solve half the mentioned issues, especially with memory bloat from blendshape mesh duplicates with large amounts of redundant data.
Currently Arraymeshes store gigantic PoolByteArray values for each Blendshape and Surface both in file and on Visualserver. A large amount of these values are so small or unused, they don't affect the final mesh visible with Godot's 3D scale and could all be replaced by default basemesh values at runtime and removed from the saved file to reduce filesize of Arraymesh resources with blendshapes considerably. Regarding fileformat convention, Godot 3D assets with blendshapes require 500%+ more storage saved as text due to all the small PoolByteArray numbers. That is why text formats for 3D assets become rapidly pointless for practical use except for special debug cases. They bloat the diskspace and take long to process/load. Godot also doesn't save 2D image files as raw text for good reasons so why do it for even more complex 3D asset formats? Binary is the default export option for 3D in most DDC tools for a reason. |
I see, I was under the impression that the interpolation modifiers were applied at render-time. |
the problem with doing it that way is if the blendshape doesn't change then there isn't any need to make that same computation again. Storing it in the mesh resource allows us to save the results of that computation which is why I'm suggesting we move the blendshape values to the mesh resource instead. See proposal #3477 |
Describe the project you are working on
A 3D game that uses blend shapes for character customization.
Describe the problem or limitation you are having in your project
Blend shapes modifiers are attached to the
Mesh
resource type and not theMeshInstance
node type, meaning that meshes that are modified by blend shapes affect all others that share the same mesh resource.Currently, the recommended best practice is to duplicate the mesh, but this rarely ever works without a series of deformation bugs occurring on the original mesh and bloats memory with duplicate meshes that don't vary in any way except for their blend shape modifiers - which are calculated on-the-fly anyway.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
By moving blend shape modifiers to the
MeshInstance
, modifiers become local to that instance of the mesh, instead of global to all instances. Meshes continue to function as before, but blend shapes only apply to specific users of the mesh rather than all of them.Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
All modifier values in the inspector for blend shapes are moved from the
Mesh
resource type to theMeshInstance
node type. Modifiers are applied in the scene or programmatically by getting and setting the properties of theMeshInstance
blend shapes.If this enhancement will not be used often, can it be worked around with a few lines of script?
There is no work-around for this limitation that I know of beyond duplicating mesh resources at runtime, which is wasteful and error-prone.
Support for the old blend shape approach may be phased out by keeping the old modifier logic on the
Mesh
resource and simply adding instance-based modifiers. Then, in the next breaking release, they may be removed.Is there a reason why this should be core and not an add-on in the asset library?
Instance-based blend shape modifiers are the standard way that other 3D engines tackle this same issue, and not just due to ad populum. By making blend shape modifiers local to the renderer / instance of the mesh, the creation of needless duplicate resources is avoided and assets become far more reusable, which is invaluable in a game that uses blend shapes for any of the following:
The text was updated successfully, but these errors were encountered: