-
Notifications
You must be signed in to change notification settings - Fork 366
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
Allow overriding albedo color on Asset3D
#7458
Conversation
- add attribute `albedo_factor` and method `with_albedo_factor` to archetype `Asset3D`. - update stl/obj loader : `load_stl_from_buffer` and `load_obj_from_buffer` to process `albedo_factor`.
Remove `albedo_texture_buffer`, `albedo_texture_format` from `Asset3D`
- add attribute `vertex_colors` and method `with_vertex_colors` to archetype `Asset3D`. - update stl/obj loader : `load_stl_from_buffer` and `load_obj_from_buffer` to process `vertex_colors`.
917d889
to
161224d
Compare
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.
Thanks for your contribution!! 🙂
AlbedoFactor
makes a lot of sense to me since this can be applied on all mesh/model formats, would love to get this in. But I don't see yet how we can add vertex_colors in a tractable & defined way. However, maybe we can come up with some rule for it?
Very relatedly, we have to keep in mind that more model formats may be added in the future and we need to avoid ugly surprises in that context. Therefore, I think all additional properties on Assed3D
should be "postprocesses" on the loaded mesh. This makes it more robust against future formats and makes it a lot easier to specify what they do.
e69b313
to
6b1a7b0
Compare
let me know when you think this is ready for review again! :) |
36c02cd
to
87751a4
Compare
- remove `albedo_factor` from loader
87751a4
to
f8ff765
Compare
crates/viewer/re_space_view_spatial/src/visualizers/assets3d.rs
Outdated
Show resolved
Hide resolved
- Add #derive[(Clone)] instead of impl Clone for MeshInstance
0d5945b
to
38f4044
Compare
### What This is mainly a refactor of `re_renderer`'s model loading pipeline, but as the title (== changelog entry) points out, a nice side-effect that arose culling unnecessary memory usage which may be important for large meshes. @EtaLoop's attempt to add a color option to `Asset3D` (see #7458) made it clear that the output of the mesh loaders is really hard to work with: Prior to this PR, they would eagerly create gpu-sided meshes and then store them alongside an optional (but always filled-out) "cpu mesh" (in essence the unpacked model file). Now instead all model loading goes to a intermediate `CpuModel` which can be rather easily post processed. Gpu resources are then created as a separate step, consuming the `CpuModel` (it should be trivial to create a variant that doesn't consume if we need this in the future) ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) * [x] I have tested the web demo (if applicable): * Using examples from latest `main` build: [rerun.io/viewer](https://rerun.io/viewer/pr/7824?manifest_url=https://app.rerun.io/version/main/examples_manifest.json) * Using full set of examples from `nightly` build: [rerun.io/viewer](https://rerun.io/viewer/pr/7824?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json) * [x] The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG * [x] If applicable, add a new check to the [release checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)! * [x] If have noted any breaking changes to the log API in `CHANGELOG.md` and the migration guide - [PR Build Summary](https://build.rerun.io/pr/7824) - [Recent benchmark results](https://build.rerun.io/graphs/crates.html) - [Wasm size tracking](https://build.rerun.io/graphs/sizes.html) To run all checks from `main`, comment on the PR with `@rerun-bot full-check`.
Now that #7824 is in, it should be a lot more straight forward to do this! |
Thanks a lot 👍 |
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.
alright, let's finally get this in! :)
Asset3D
Asset3D
I wanted to push a fix for the doc issues ci brought up, but I don't have permissions it seems (hum, this usually works, no idea why) |
b8c12b4
to
d46215e
Compare
Done, sorry for the mess up there 😓 |
Thank you for your time and advice |
What
The idea is to reproduce behavior of
Mesh3D
regarding color modification onAsset3D
:albedo_factor
vertex_colors
as inMesh3D
In order to overwrite white default texture of
Asset3D
loaded from stl and obj (gltf already have albedo_factor in file).See: #5253
Checklist
main
build: rerun.io/viewernightly
build: rerun.io/viewerCHANGELOG.md
and the migration guideTo run all checks from
main
, comment on the PR with@rerun-bot full-check
.