Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into andreas/world-grid2
Browse files Browse the repository at this point in the history
  • Loading branch information
Wumpf committed Dec 5, 2024
2 parents 6edb4f0 + c31cf27 commit 7f67a28
Show file tree
Hide file tree
Showing 14 changed files with 177 additions and 84 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

## [Unreleased](https://github.com/rerun-io/rerun/compare/latest...HEAD)

## [0.20.3](https://github.com/rerun-io/rerun/compare/0.20.2...0.20.3) - Web viewer fix

### 🔎 Details

#### 🪳 Bug fixes
- Fix web viewer feature flags [#8295](https://github.com/rerun-io/rerun/pull/8295)

## [0.20.2](https://github.com/rerun-io/rerun/compare/0.20.1...0.20.2) - Build fix

### 🔎 Details
Expand Down
37 changes: 19 additions & 18 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f47983a1084940ba9a39c077a8c63e55c619388be5476ac04c804cfbd1e63459"
dependencies = [
"accesskit",
"hashbrown 0.15.0",
"hashbrown 0.15.1",
"immutable-chunkmap",
]

Expand All @@ -71,7 +71,7 @@ checksum = "7329821f3bd1101e03a7d2e03bd339e3ac0dc64c70b4c9f9ae1949e3ba8dece1"
dependencies = [
"accesskit",
"accesskit_consumer 0.26.0",
"hashbrown 0.15.0",
"hashbrown 0.15.1",
"objc2",
"objc2-app-kit",
"objc2-foundation",
Expand Down Expand Up @@ -103,7 +103,7 @@ checksum = "24fcd5d23d70670992b823e735e859374d694a3d12bfd8dd32bd3bd8bedb5d81"
dependencies = [
"accesskit",
"accesskit_consumer 0.26.0",
"hashbrown 0.15.0",
"hashbrown 0.15.1",
"paste",
"static_assertions",
"windows 0.58.0",
Expand Down Expand Up @@ -1923,7 +1923,7 @@ checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125"
[[package]]
name = "ecolor"
version = "0.29.1"
source = "git+https://github.com/emilk/egui.git?rev=eac7ba01fa37bad35f71bc303561761952361b7c#eac7ba01fa37bad35f71bc303561761952361b7c"
source = "git+https://github.com/emilk/egui.git?rev=c5ac7d301a90afbaec843ee04fb43d8a0956cc90#c5ac7d301a90afbaec843ee04fb43d8a0956cc90"
dependencies = [
"bytemuck",
"color-hex",
Expand All @@ -1940,7 +1940,7 @@ checksum = "18aade80d5e09429040243ce1143ddc08a92d7a22820ac512610410a4dd5214f"
[[package]]
name = "eframe"
version = "0.29.1"
source = "git+https://github.com/emilk/egui.git?rev=eac7ba01fa37bad35f71bc303561761952361b7c#eac7ba01fa37bad35f71bc303561761952361b7c"
source = "git+https://github.com/emilk/egui.git?rev=c5ac7d301a90afbaec843ee04fb43d8a0956cc90#c5ac7d301a90afbaec843ee04fb43d8a0956cc90"
dependencies = [
"ahash",
"bytemuck",
Expand Down Expand Up @@ -1979,7 +1979,7 @@ dependencies = [
[[package]]
name = "egui"
version = "0.29.1"
source = "git+https://github.com/emilk/egui.git?rev=eac7ba01fa37bad35f71bc303561761952361b7c#eac7ba01fa37bad35f71bc303561761952361b7c"
source = "git+https://github.com/emilk/egui.git?rev=c5ac7d301a90afbaec843ee04fb43d8a0956cc90#c5ac7d301a90afbaec843ee04fb43d8a0956cc90"
dependencies = [
"accesskit",
"ahash",
Expand All @@ -1996,7 +1996,7 @@ dependencies = [
[[package]]
name = "egui-wgpu"
version = "0.29.1"
source = "git+https://github.com/emilk/egui.git?rev=eac7ba01fa37bad35f71bc303561761952361b7c#eac7ba01fa37bad35f71bc303561761952361b7c"
source = "git+https://github.com/emilk/egui.git?rev=c5ac7d301a90afbaec843ee04fb43d8a0956cc90#c5ac7d301a90afbaec843ee04fb43d8a0956cc90"
dependencies = [
"ahash",
"bytemuck",
Expand All @@ -2015,7 +2015,7 @@ dependencies = [
[[package]]
name = "egui-winit"
version = "0.29.1"
source = "git+https://github.com/emilk/egui.git?rev=eac7ba01fa37bad35f71bc303561761952361b7c#eac7ba01fa37bad35f71bc303561761952361b7c"
source = "git+https://github.com/emilk/egui.git?rev=c5ac7d301a90afbaec843ee04fb43d8a0956cc90#c5ac7d301a90afbaec843ee04fb43d8a0956cc90"
dependencies = [
"accesskit_winit",
"ahash",
Expand Down Expand Up @@ -2057,7 +2057,7 @@ dependencies = [
[[package]]
name = "egui_extras"
version = "0.29.1"
source = "git+https://github.com/emilk/egui.git?rev=eac7ba01fa37bad35f71bc303561761952361b7c#eac7ba01fa37bad35f71bc303561761952361b7c"
source = "git+https://github.com/emilk/egui.git?rev=c5ac7d301a90afbaec843ee04fb43d8a0956cc90#c5ac7d301a90afbaec843ee04fb43d8a0956cc90"
dependencies = [
"ahash",
"egui",
Expand All @@ -2074,7 +2074,7 @@ dependencies = [
[[package]]
name = "egui_glow"
version = "0.29.1"
source = "git+https://github.com/emilk/egui.git?rev=eac7ba01fa37bad35f71bc303561761952361b7c#eac7ba01fa37bad35f71bc303561761952361b7c"
source = "git+https://github.com/emilk/egui.git?rev=c5ac7d301a90afbaec843ee04fb43d8a0956cc90#c5ac7d301a90afbaec843ee04fb43d8a0956cc90"
dependencies = [
"ahash",
"bytemuck",
Expand All @@ -2092,7 +2092,7 @@ dependencies = [
[[package]]
name = "egui_kittest"
version = "0.29.1"
source = "git+https://github.com/emilk/egui.git?rev=eac7ba01fa37bad35f71bc303561761952361b7c#eac7ba01fa37bad35f71bc303561761952361b7c"
source = "git+https://github.com/emilk/egui.git?rev=c5ac7d301a90afbaec843ee04fb43d8a0956cc90#c5ac7d301a90afbaec843ee04fb43d8a0956cc90"
dependencies = [
"dify",
"egui",
Expand Down Expand Up @@ -2161,7 +2161,7 @@ checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0"
[[package]]
name = "emath"
version = "0.29.1"
source = "git+https://github.com/emilk/egui.git?rev=eac7ba01fa37bad35f71bc303561761952361b7c#eac7ba01fa37bad35f71bc303561761952361b7c"
source = "git+https://github.com/emilk/egui.git?rev=c5ac7d301a90afbaec843ee04fb43d8a0956cc90#c5ac7d301a90afbaec843ee04fb43d8a0956cc90"
dependencies = [
"bytemuck",
"serde",
Expand Down Expand Up @@ -2277,7 +2277,7 @@ dependencies = [
[[package]]
name = "epaint"
version = "0.29.1"
source = "git+https://github.com/emilk/egui.git?rev=eac7ba01fa37bad35f71bc303561761952361b7c#eac7ba01fa37bad35f71bc303561761952361b7c"
source = "git+https://github.com/emilk/egui.git?rev=c5ac7d301a90afbaec843ee04fb43d8a0956cc90#c5ac7d301a90afbaec843ee04fb43d8a0956cc90"
dependencies = [
"ab_glyph",
"ahash",
Expand All @@ -2296,7 +2296,7 @@ dependencies = [
[[package]]
name = "epaint_default_fonts"
version = "0.29.1"
source = "git+https://github.com/emilk/egui.git?rev=eac7ba01fa37bad35f71bc303561761952361b7c#eac7ba01fa37bad35f71bc303561761952361b7c"
source = "git+https://github.com/emilk/egui.git?rev=c5ac7d301a90afbaec843ee04fb43d8a0956cc90#c5ac7d301a90afbaec843ee04fb43d8a0956cc90"

[[package]]
name = "equivalent"
Expand Down Expand Up @@ -2998,9 +2998,9 @@ dependencies = [

[[package]]
name = "hashbrown"
version = "0.15.0"
version = "0.15.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb"
checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3"
dependencies = [
"allocator-api2",
"equivalent",
Expand Down Expand Up @@ -3409,7 +3409,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da"
dependencies = [
"equivalent",
"hashbrown 0.15.0",
"hashbrown 0.15.1",
"serde",
]

Expand Down Expand Up @@ -3826,7 +3826,7 @@ version = "0.12.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38"
dependencies = [
"hashbrown 0.15.0",
"hashbrown 0.15.1",
]

[[package]]
Expand Down Expand Up @@ -6242,6 +6242,7 @@ dependencies = [
"fjadra",
"nohash-hasher",
"re_chunk",
"re_data_ui",
"re_entity_db",
"re_format",
"re_log_types",
Expand Down
14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -559,13 +559,13 @@ significant_drop_tightening = "allow" # An update of parking_lot made this trigg
# As a last resport, patch with a commit to our own repository.
# ALWAYS document what PR the commit hash is part of, or when it was merged into the upstream trunk.

ecolor = { git = "https://github.com/emilk/egui.git", rev = "eac7ba01fa37bad35f71bc303561761952361b7c" } # egui master 2024-12-03
eframe = { git = "https://github.com/emilk/egui.git", rev = "eac7ba01fa37bad35f71bc303561761952361b7c" } # egui master 2024-12-03
egui = { git = "https://github.com/emilk/egui.git", rev = "eac7ba01fa37bad35f71bc303561761952361b7c" } # egui master 2024-12-03
egui_extras = { git = "https://github.com/emilk/egui.git", rev = "eac7ba01fa37bad35f71bc303561761952361b7c" } # egui master 2024-12-03
egui_kittest = { git = "https://github.com/emilk/egui.git", rev = "eac7ba01fa37bad35f71bc303561761952361b7c" } # egui master 2024-12-03
egui-wgpu = { git = "https://github.com/emilk/egui.git", rev = "eac7ba01fa37bad35f71bc303561761952361b7c" } # egui master 2024-12-03
emath = { git = "https://github.com/emilk/egui.git", rev = "eac7ba01fa37bad35f71bc303561761952361b7c" } # egui master 2024-12-03
ecolor = { git = "https://github.com/emilk/egui.git", rev = "c5ac7d301a90afbaec843ee04fb43d8a0956cc90" } # egui master 2024-12-03
eframe = { git = "https://github.com/emilk/egui.git", rev = "c5ac7d301a90afbaec843ee04fb43d8a0956cc90" } # egui master 2024-12-03
egui = { git = "https://github.com/emilk/egui.git", rev = "c5ac7d301a90afbaec843ee04fb43d8a0956cc90" } # egui master 2024-12-03
egui_extras = { git = "https://github.com/emilk/egui.git", rev = "c5ac7d301a90afbaec843ee04fb43d8a0956cc90" } # egui master 2024-12-03
egui_kittest = { git = "https://github.com/emilk/egui.git", rev = "c5ac7d301a90afbaec843ee04fb43d8a0956cc90" } # egui master 2024-12-03
egui-wgpu = { git = "https://github.com/emilk/egui.git", rev = "c5ac7d301a90afbaec843ee04fb43d8a0956cc90" } # egui master 2024-12-03
emath = { git = "https://github.com/emilk/egui.git", rev = "c5ac7d301a90afbaec843ee04fb43d8a0956cc90" } # egui master 2024-12-03

# Useful while developing:
# ecolor = { path = "../../egui/crates/ecolor" }
Expand Down
2 changes: 1 addition & 1 deletion crates/build/re_types_builder/src/codegen/cpp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2182,7 +2182,7 @@ fn quote_archetype_field_type(hpp_includes: &mut Includes, obj_field: &ObjectFie
quote! { Collection<#elem_type> }
}
// TODO(andreas): This should emit `MonoCollection` which will be a constrained version of `Collection`.
// (simply adapting `MonoCollection` breaks some existing code, so this not entirely trivial to do.
// (Simply adapting `MonoCollection` breaks some existing code, so this not entirely trivial to do.
// Designing constraints for `MonoCollection` is harder still)
Type::Object(fqname) => quote_fqname_as_type_path(hpp_includes, fqname),
_ => panic!("Only vectors and objects are allowed in archetypes."),
Expand Down
7 changes: 3 additions & 4 deletions crates/viewer/re_renderer/shader/depth_cloud.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,10 @@ fn fs_main_picking_layer(in: VertexOut) -> @location(0) vec4u {

@fragment
fn fs_main_outline_mask(in: VertexOut) -> @location(0) vec2u {
// Output is an integer target, can't use coverage therefore.
// But we still want to discard fragments where coverage is low.
// Since the outline extends a bit, a very low cut off tends to look better.
// Output is an integer target so we can't use coverage even though
// the target is anti-aliased.
let coverage = sphere_quad_coverage(in.pos_in_world, in.point_radius, in.point_pos_in_world);
if coverage < 1.0 {
if coverage <= 0.5 {
discard;
}
return depth_cloud_info.outline_mask_id;
Expand Down
8 changes: 5 additions & 3 deletions crates/viewer/re_renderer/shader/lines.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -370,10 +370,12 @@ fn fs_main_picking_layer(in: VertexOut) -> @location(0) vec4u {
@fragment
fn fs_main_outline_mask(in: VertexOut) -> @location(0) vec2u {
// Output is an integer target, can't use coverage therefore.
// But we still want to discard fragments where coverage is low.
// Since the outline extends a bit, a very low cut off tends to look better.
// But we still want to discard fragments where coverage is too low, otherwise
// we'd not handle rounded corners etc. correctly.
// Note that `compute_coverage` may already give coverage values below 1.0 along the
// "main body of the line", not just the caps.
var coverage = compute_coverage(in);
if coverage < 1.0 {
if coverage <= 0.0 {
discard;
}
return batch.outline_mask_ids;
Expand Down
7 changes: 3 additions & 4 deletions crates/viewer/re_renderer/shader/point_cloud.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,10 @@ fn fs_main_picking_layer(in: VertexOut) -> @location(0) vec4u {

@fragment
fn fs_main_outline_mask(in: VertexOut) -> @location(0) vec2u {
// Output is an integer target, can't use coverage therefore.
// But we still want to discard fragments where coverage is low.
// Since the outline extends a bit, a very low cut off tends to look better.
// Output is an integer target so we can't use coverage even though
// the target is anti-aliased.
let coverage = coverage(in.world_position, in.radius, in.point_center);
if coverage < 1.0 {
if coverage <= 0.5 {
discard;
}
return batch.outline_mask;
Expand Down
1 change: 1 addition & 0 deletions crates/viewer/re_space_view_graph/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ workspace = true
all-features = true

[dependencies]
re_data_ui.workspace = true
re_chunk.workspace = true
re_entity_db.workspace = true
re_format.workspace = true
Expand Down
4 changes: 2 additions & 2 deletions crates/viewer/re_space_view_graph/src/graph/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@ impl Graph {
nodes.push(Node::Implicit {
id: edge.source_index,
graph_node: edge.source.clone(),
label: DrawableLabel::implicit_circle(),
label: DrawableLabel::implicit_circle(ui),
});
seen.insert(edge.source_index);
}
if !seen.contains(&edge.target_index) {
nodes.push(Node::Implicit {
id: edge.target_index,
graph_node: edge.target.clone(),
label: DrawableLabel::implicit_circle(),
label: DrawableLabel::implicit_circle(ui),
});
seen.insert(edge.target_index);
}
Expand Down
23 changes: 19 additions & 4 deletions crates/viewer/re_space_view_graph/src/layout/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,26 @@ pub struct ForceLayoutProvider {

impl ForceLayoutProvider {
pub fn new(request: LayoutRequest) -> Self {
Self::new_impl(request, None)
}

pub fn new_with_previous(request: LayoutRequest, layout: &Layout) -> Self {
Self::new_impl(request, Some(layout))
}

// TODO(grtlr): Consider consuming the old layout to avoid re-allocating the extents.
// That logic has to be revised when adding the blueprints anyways.
fn new_impl(request: LayoutRequest, layout: Option<&Layout>) -> Self {
let nodes = request.graphs.iter().flat_map(|(_, graph_template)| {
graph_template
.nodes
.iter()
.map(|n| (n.0, fj::Node::from(n.1)))
graph_template.nodes.iter().map(|n| {
let mut fj_node = fj::Node::from(n.1);
if let Some(rect) = layout.and_then(|l| l.get_node(n.0)) {
let pos = rect.center();
fj_node = fj_node.position(pos.x as f64, pos.y as f64);
}

(n.0, fj_node)
})
});

let mut node_index = ahash::HashMap::default();
Expand Down
44 changes: 27 additions & 17 deletions crates/viewer/re_space_view_graph/src/ui/draw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ use egui::{
Rect, Response, RichText, Sense, Shape, Stroke, TextWrapMode, Ui, UiBuilder, Vec2, WidgetText,
};
use re_chunk::EntityPath;
use re_data_ui::{item_ui, DataUi as _};
use re_entity_db::InstancePath;
use re_types::ArrowString;
use re_ui::list_item;
use re_viewer_context::{
HoverHighlight, InteractionHighlight, Item, SelectionHighlight, SpaceViewHighlights, ViewQuery,
ViewerContext,
HoverHighlight, InteractionHighlight, Item, SelectionHighlight, SpaceViewHighlights, UiLayout,
ViewQuery, ViewerContext,
};

use crate::{
Expand Down Expand Up @@ -56,10 +58,10 @@ impl DrawableLabel {
Self::Circle(CircleLabel { radius, color })
}

pub fn implicit_circle() -> Self {
pub fn implicit_circle(ui: &Ui) -> Self {
Self::Circle(CircleLabel {
radius: 4.0,
color: None,
color: Some(ui.style().visuals.weak_text_color()),
})
}

Expand Down Expand Up @@ -281,29 +283,37 @@ pub fn draw_graph(
let response = match node {
Node::Explicit { instance, .. } => {
let highlight = entity_highlights.index_highlight(instance.instance_index);
let response = draw_node(ui, center, node.label(), highlight);

let response = if let Label::Text { text, .. } = &instance.label {
response.on_hover_text(format!(
"Graph Node: {}\nLabel: {text}",
instance.graph_node.as_str(),
))
} else {
response.on_hover_text(format!("Graph Node: {}", instance.graph_node.as_str(),))
};
let mut response = draw_node(ui, center, node.label(), highlight);

let instance_path =
InstancePath::instance(entity_path.clone(), instance.instance_index);
ctx.select_hovered_on_click(
&response,
vec![(Item::DataResult(query.space_view_id, instance_path), None)].into_iter(),
Item::DataResult(query.space_view_id, instance_path.clone()),
);

response = response.on_hover_ui_at_pointer(|ui| {
list_item::list_item_scope(ui, "graph_node_hover", |ui| {
item_ui::instance_path_button(
ctx,
&query.latest_at_query(),
ctx.recording(),
ui,
Some(query.space_view_id),
&instance_path,
);

instance_path.data_ui_recording(ctx, ui, UiLayout::Tooltip);
});
});

response
}
Node::Implicit { graph_node, .. } => {
draw_node(ui, center, node.label(), Default::default())
.on_hover_text(format!("Implicit Graph Node: {}", graph_node.as_str(),))
draw_node(ui, center, node.label(), Default::default()).on_hover_text(format!(
"Implicit node {} created via a reference in a GraphEdge component",
graph_node.as_str(),
))
}
};

Expand Down
Loading

0 comments on commit 7f67a28

Please sign in to comment.