-
Notifications
You must be signed in to change notification settings - Fork 317
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
Texture support for raw Mesh3D
logging
#4894
Conversation
Size changes
|
I cannot compile the rust example: $ cargo r -q -p raw_mesh
error[E0432]: unresolved imports `rerun::external::ecolor`, `rerun::external::re_memory`
--> examples/rust/raw_mesh/src/main.rs:16:16
|
16 | external::{ecolor, re_log, re_memory::AccountingAllocator},
| ^^^^^^ ^^^^^^^^^ could not find `re_memory` in `external`
| |
| no `ecolor` in `external`
error[E0433]: failed to resolve: could not find `clap` in `rerun`
--> examples/rust/raw_mesh/src/main.rs:126:19
|
126 | rerun: rerun::clap::RerunArgs,
| ^^^^ could not find `clap` in `rerun`
error[E0425]: cannot find function `setup_native_logging` in crate `re_log`
--> examples/rust/raw_mesh/src/main.rs:182:13
|
182 | re_log::setup_native_logging();
| ^^^^^^^^^^^^^^^^^^^^ not found in `re_log`
Some errors have detailed explanations: E0425, E0432, E0433.
For more information about an error, try `rustc --explain E0425`.
error: could not compile `raw_mesh` (bin "raw_mesh") due to 3 previous errors |
examples/rust/raw_mesh/src/main.rs
Outdated
if albedo_factor.is_some() { | ||
mesh = mesh.with_mesh_material(rerun::datatypes::Material { | ||
albedo_factor: albedo_factor | ||
.map(|[r, g, b, a]| ecolor::Rgba::from_rgba_unmultiplied(r, g, b, a).into()), | ||
albedo_texture: None, // TODO(andreas): This would require loading the right texture file and converting it to `TensorData`. |
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.
Why not do it for the rust example too?
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.
I ran out of time and didn't see a quick & easy path towards that. Afaik the gltf loader doesn't load the image itself, so I need an extra path that loads the images from disk etc.
Would be nice to update the screenshots in raw_mesh readmes (python & rust). They look so sad right now as they rely on just the albedo factor, it's so much better looking now. |
Unfortunately I didn't update the Rust example (and apparently also broke it :/) though to upload the texture. Guess I shouldn't leave this business unfinished |
Albedo factor showed like that before when it's null. Don't know what else to write there. Isn't
Yeah this sucks, but I found this really hard to fix that right now with the setup of the texture not being a |
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.
Works great and I agree with everything you said 👍 🚢
but looks like deserialization is actually broken
Blocked by a crash in arrow when logging only a color and no image |
What
Meshes can now be logged with optional texture coordinates and an optional albedo texture!
Vertex texture coordinates are straight forward, implemented as a new component, mostly to avoid semantic confusion (position2d on mesh?) and being able to call the coordinates
uv
.The (albedo) texture itself got a bit messy: The original plan was to refer to a separately logged image and I believe that's still where we want to go. But this messes with some parts of the viewer so I made the decision to put aTensorData
based field on the material. The main drawback of that is that now you can't inspect the texture separately and the format restrictions are quite tight (this is in part also due to the mesh renderer itself though, so that's deeper than just not using the Image archetype). I believe in the future the material should instead have an entity reference to specify where the texture comes from.Another pretty bad sideffect from this is that if you have model with a bunch of meshes using the same texture several times, it will send this texture each time to the viewer since there's no way to "instance" this.
... but let's perfect not be the enemy of well-it-works-for-the-most-important-usecases-so-let's-ship-this!Change: Texture is now a component, making a lot of things nicer
Checklist
main
build: app.rerun.ionightly
build: app.rerun.io