-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for mesh vertex colors (#1671)
* Refactor: use `izip!` * Improve docstrings for rr.log_mesh and rr.log_mesh_file * Add support for mesh vertex colors in Python API * Improve sanity checking for raw meshes * Add vertex colors to RawMesh3D * Rename normals to vertex_normals * Split vertex normals and texcoords into different vertex buffers * Add sanity check for shader locations * Pipe vertex colors into the GPU * Use mesh vertex colors in shader * Don't crash on invalid meshes * Fix num_triangles function * Better sanity checking of loaded GLB/GLTF and OBJ meshes * Cleanup * Fix typo * Handle RGB colors too * Fix broken test * Better names * Fix mypy types * Document the color type of point cloud shaders * fix typo Co-authored-by: Andreas Reich <[email protected]> * document additive_tint_rgb Co-authored-by: Andreas Reich <[email protected]> * fix TODO Co-authored-by: Andreas Reich <[email protected]> * Add Rgba32Unmul color type * Create a helper function for generating the VertexBufferLayouts * Use from_rgb helper --------- Co-authored-by: Andreas Reich <[email protected]>
- Loading branch information
Showing
21 changed files
with
647 additions
and
307 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
// See mesh.rs#MeshVertex | ||
struct VertexIn { | ||
@location(0) position: Vec3, | ||
@location(1) normal: Vec3, | ||
@location(2) texcoord: Vec2, | ||
@location(1) color: Vec4, // gamma-space 0-1, unmultiplied | ||
@location(2) normal: Vec3, | ||
@location(3) texcoord: Vec2, | ||
}; | ||
|
||
// See mesh_renderer.rs | ||
struct InstanceIn { | ||
// We could alternatively store projection_from_mesh, but world position might be useful | ||
// in the future and this saves us a Vec4 and simplifies dataflow on the cpu side. | ||
@location(3) world_from_mesh_row_0: Vec4, | ||
@location(4) world_from_mesh_row_1: Vec4, | ||
@location(5) world_from_mesh_row_2: Vec4, | ||
@location(6) world_from_mesh_normal_row_0: Vec3, | ||
@location(7) world_from_mesh_normal_row_1: Vec3, | ||
@location(8) world_from_mesh_normal_row_2: Vec3, | ||
@location(9) additive_tint_srgb: Vec4, | ||
@location(10) outline_mask_ids: UVec2, | ||
@location(4) world_from_mesh_row_0: Vec4, | ||
@location(5) world_from_mesh_row_1: Vec4, | ||
@location(6) world_from_mesh_row_2: Vec4, | ||
@location(7) world_from_mesh_normal_row_0: Vec3, | ||
@location(8) world_from_mesh_normal_row_1: Vec3, | ||
@location(9) world_from_mesh_normal_row_2: Vec3, | ||
@location(10) additive_tint_srgb: Vec4, | ||
@location(11) outline_mask_ids: UVec2, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
3f74e26
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rust Benchmark
datastore/insert/batch/rects/insert
550635
ns/iter (± 4157
)583176
ns/iter (± 2731
)0.94
datastore/latest_at/batch/rects/query
1823
ns/iter (± 28
)1875
ns/iter (± 29
)0.97
datastore/latest_at/missing_components/primary
286
ns/iter (± 2
)294
ns/iter (± 0
)0.97
datastore/latest_at/missing_components/secondaries
432
ns/iter (± 16
)445
ns/iter (± 9
)0.97
datastore/range/batch/rects/query
147876
ns/iter (± 1522
)160349
ns/iter (± 3100
)0.92
mono_points_arrow/generate_message_bundles
46670242
ns/iter (± 704140
)55423760
ns/iter (± 961151
)0.84
mono_points_arrow/generate_messages
125471059
ns/iter (± 1201351
)143700909
ns/iter (± 1638179
)0.87
mono_points_arrow/encode_log_msg
155062513
ns/iter (± 849195
)174373812
ns/iter (± 3331921
)0.89
mono_points_arrow/encode_total
327245301
ns/iter (± 1696720
)371262329
ns/iter (± 7732549
)0.88
mono_points_arrow/decode_log_msg
176820189
ns/iter (± 920910
)194074286
ns/iter (± 7421825
)0.91
mono_points_arrow/decode_message_bundles
65706207
ns/iter (± 752120
)81146250
ns/iter (± 1845871
)0.81
mono_points_arrow/decode_total
237856464
ns/iter (± 1612059
)268331743
ns/iter (± 3761224
)0.89
batch_points_arrow/generate_message_bundles
338977
ns/iter (± 1698
)340117
ns/iter (± 731
)1.00
batch_points_arrow/generate_messages
6325
ns/iter (± 36
)6385
ns/iter (± 20
)0.99
batch_points_arrow/encode_log_msg
372876
ns/iter (± 1664
)379875
ns/iter (± 2262
)0.98
batch_points_arrow/encode_total
731520
ns/iter (± 2244
)747519
ns/iter (± 5763
)0.98
batch_points_arrow/decode_log_msg
348090
ns/iter (± 1117
)358896
ns/iter (± 5735
)0.97
batch_points_arrow/decode_message_bundles
2063
ns/iter (± 11
)2074
ns/iter (± 7
)0.99
batch_points_arrow/decode_total
356709
ns/iter (± 1073
)373219
ns/iter (± 5154
)0.96
arrow_mono_points/insert
6092560623
ns/iter (± 17077781
)7799874241
ns/iter (± 125428756
)0.78
arrow_mono_points/query
1800446
ns/iter (± 13016
)1936298
ns/iter (± 80846
)0.93
arrow_batch_points/insert
2637261
ns/iter (± 14835
)2870483
ns/iter (± 243918
)0.92
arrow_batch_points/query
16213
ns/iter (± 112
)16168
ns/iter (± 38
)1.00
arrow_batch_vecs/insert
42226
ns/iter (± 146
)42894
ns/iter (± 195
)0.98
arrow_batch_vecs/query
388332
ns/iter (± 2635
)389632
ns/iter (± 687
)1.00
tuid/Tuid::random
34
ns/iter (± 0
)34
ns/iter (± 0
)1
This comment was automatically generated by workflow using github-action-benchmark.