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

Improvements to the api regarding skinning-style routines #507

Open
2 tasks
OptimisticPeach opened this issue Aug 14, 2023 · 0 comments
Open
2 tasks

Improvements to the api regarding skinning-style routines #507

OptimisticPeach opened this issue Aug 14, 2023 · 0 comments

Comments

@OptimisticPeach
Copy link
Contributor

OptimisticPeach commented Aug 14, 2023

This is following a discussion we had here on discord. A brief summary of my usecase and the issues I ran up against:

  • My "skinning-style routine" is projecting points from 4D to 3D.
  • Meshes hence have source Vec4 positions. These get their own "4d position" vertex attribute.
  • The output vertices are Vec3 positions.
  • The way the skinning routine works currently, the skinned vertices get taken and placed from Vec3 buffers. Hence, meshes which are skinned have the "vec3 position" vertex attribute.
  • My mesh does not have a "vec3 position" attribute -- hence it would be rejected by this code (snippet in case the link gets invalidated):
    ...
    for &required_attribute in M::required_attributes().into_iter() {
        // We can just directly use the internal mesh, as every attribute in the skeleton is also in the mesh.
        let found_in_mesh = args
        ...
    
  • Hence my solution is to add the "3d position" and "3d normal" attributes to my mesh and fill them with dummy values.
    • Add a way to add vertex attributes without uploading data for them.
  • This wouldn't let have multiple objects with the same particular mesh instantiated, since this buffer would be created per-mesh, not per-object.
    • Add a way to have multiple output buffers per mesh.

I hope that summarizes the conversation.

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

No branches or pull requests

1 participant