rend3
rend3 copied to clipboard
Improvements to the api regarding skinning-style routines
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.