rerun icon indicating copy to clipboard operation
rerun copied to clipboard

World grid part 2/2: Integrate into Viewer

Open Wumpf opened this issue 1 year ago • 3 comments

Related

  • Follow-up of part 1: https://github.com/rerun-io/rerun/pull/8230
  • Fixes https://github.com/rerun-io/rerun/issues/872

What

Adds new line grid property to the 3D view and enables it by default.

Feedback on variable & type names ~welcome~ needed!

Docs says it all:

/// Configuration for the 3D line grid.
table LineGrid3D (
    "attr.rerun.scope": "blueprint"
) {
    /// Whether the grid is visible.
    ///
    /// Defaults to true.
    visible: rerun.blueprint.components.Visible ("attr.rerun.component_optional", nullable, order: 1000);

    /// Space between grid lines spacing of one line to the next in scene units.
    spacing: rerun.blueprint.components.GridSpacing ("attr.rerun.component_optional", nullable, order: 2000);

    /// How the grid is oriented.
    ///
    /// Defaults to whatever plane is determined as the down plane by view coordinates if present.
    orientation: rerun.blueprint.components.PlaneOrientation ("attr.rerun.component_optional", nullable, order: 3000);

    /// Offset of the grid along its normal.
    offset: rerun.blueprint.components.PlaneOffset ("attr.rerun.component_optional", nullable, order: 4000);

    /// How thick the lines should be in ui units.
    ///
    /// Default is 0.5 ui unit.
    line_radius: rerun.blueprint.components.UiRadius ("attr.rerun.component_optional", nullable, order: 5000);

    /// Color used for the grid.
    ///
    /// Transparency via alpha channel is supported.
    /// Defaults to a slightly transparent light gray.
    color: rerun.components.Color ("attr.rerun.component_optional", nullable, order: 6000);
}

Properties in the viewer: image

Examples of the grid in action (in default settings): image image

Bad case - it's below: image

Changes to World grid renderer since original PR

  • tweak when to fade - generally fade more aggressively to keep grid not as busy

Testing

  • [x] Metal
  • [x] Vulkan
  • [ ] WebGPU
  • [ ] WebGL

Draft TODO

  • [ ] extend view creation python snippet with this property
    • check if python blueprint api is sane
  • [x] why is background showing as half transparent by default now?
  • [ ] Adjust grid height for some samples or turn it off?
  • [x] try new idea for cardinal lines
  • [x] fix line thickness not working
  • [ ] switch to plane equations for blueprint api -> provide extensions in all languages

Wumpf avatar Nov 27 '24 17:11 Wumpf

Latest documentation preview deployed successfully.

Result Commit Link
5fe5dfdd0a8f1034d9d348fea6145bc465841a0c https://landing-nuo6pcdya-rerun.vercel.app/docs

Note: This comment is updated whenever you push a commit.

github-actions[bot] avatar Nov 27 '24 17:11 github-actions[bot]

Web viewer built successfully. If applicable, you should also test it:

  • [ ] I have tested the web viewer
Result Commit Link
5fe5dfd https://rerun.io/viewer/pr/8234

Note: This comment is updated whenever you push a commit.

github-actions[bot] avatar Nov 27 '24 17:11 github-actions[bot]

Small bug: it's now possible to set alpha in the color picker for the Lines3D override (which obviously doesn't work)

Screenshot 2024-11-29 at 15 02 01

nikolausWest avatar Nov 29 '24 14:11 nikolausWest

Just clicking through some examples it's clear that the grid doesn't end up at the "right" height for most of them. Wonder if it's worth explicitly settign the plane height to make those look good?

nikolausWest avatar Dec 05 '24 10:12 nikolausWest

yes, we should likely do some adjustments there on a per example basis. For some examples we may also want to turn it off

Wumpf avatar Dec 05 '24 12:12 Wumpf