Skip to content

Add a Gaussian Splat and octomap rendering sample#1247

Open
gpx1000 wants to merge 32 commits into
KhronosGroup:mainfrom
gpx1000:complex-octmap-rendering
Open

Add a Gaussian Splat and octomap rendering sample#1247
gpx1000 wants to merge 32 commits into
KhronosGroup:mainfrom
gpx1000:complex-octmap-rendering

Conversation

@gpx1000

@gpx1000 gpx1000 commented Dec 14, 2024

Copy link
Copy Markdown
Collaborator

Description

This is a sample showing a complex interaction with other libraries to demonstrate how to work with libraries and tools int he wild. Here Octomap is used to demonstrate Occupancy grid rendering. We also demonstrate how to use ImGUI in a project with added functionality and positioning of rendered assets.

General Checklist:

Please ensure the following points are checked:

  • My code follows the coding style
  • I have reviewed file licenses
  • I have commented any added functions (in line with Doxygen)
  • I have commented any code that could be hard to understand
  • My changes do not add any new compiler warnings
  • My changes do not add any new validation layer errors or warnings
  • I have used existing framework/helper functions where possible
  • My changes do not add any regressions
  • I have tested every sample to ensure everything runs correctly
  • This PR describes the scope and expected impact of the changes I am making

Note: The Samples CI runs a number of checks including:

  • I have updated the header Copyright to reflect the current year (CI build will fail if Copyright is out of date)
  • My changes build on Windows, Linux, macOS and Android. Otherwise I have documented any exceptions

If this PR contains framework changes:

  • I did a full batch run using the batch command line argument to make sure all samples still work properly

Sample Checklist

If your PR contains a new or modified sample, these further checks must be carried out in addition to the General Checklist:

  • I have tested the sample on at least one compliant Vulkan implementation
  • If the sample is vendor-specific, I have tagged it appropriately
  • I have stated on what implementation the sample has been tested so that others can test on different implementations and platforms
  • Any dependent assets have been merged and published in downstream modules
  • For new samples, I have added a paragraph with a summary to the appropriate chapter in the readme of the folder that the sample belongs to e.g. api samples readme
  • For new samples, I have added a tutorial README.md file to guide users through what they need to know to implement code using this feature. For example, see conditional_rendering
  • For new samples, I have added a link to the Antora navigation so that the sample will be listed at the Vulkan documentation site

… Voxel Point Cloud map using Octomap. Also demonstrates how to use ImGUI in a project with added functionality and positioning of rendered assets.
@SaschaWillems

Copy link
Copy Markdown
Collaborator

Wanted to give this a first try, but no matter what I tried, I wasn't able to get the newly added OctoMap submodule to checkout. Any ideas? Tried to clean reset, did a recursive checkout of all submodules, etc.

@gary-sweet

Copy link
Copy Markdown
Contributor

Wanted to give this a first try, but no matter what I tried, I wasn't able to get the newly added OctoMap submodule to checkout. Any ideas? Tried to clean reset, did a recursive checkout of all submodules, etc.

Same problem for me it looks like.

Extends the octomap sample with three view modes: Octomap, GLTF Regular, and GLTF Splats. Implements splat rendering pipeline with per-instance attributes and premultiplied alpha blending. Adds GLTF mesh rendering with vertex color support. Includes new shader files for splat geometry and fragment evaluation. Updates camera to FirstPerson type for WASD movement. Fixes cube winding order and improves command buffer recording. Adds proper license headers to all new and modified files.
Standardizes code formatting with consistent indentation and brace style. Reorders includes alphabetically with core utilities first. Consolidates constructor initializer list to single line. Adjusts spacing and alignment throughout for consistency.
Ensures submodules are fully initialized and updated in each job by adding explicit `git submodule update --init --recursive` command after checkout, complementing the existing `submodules: "recursive"` checkout option.
Replaces spaces with tabs to maintain consistent formatting throughout the .gitmodules file.
Adds update_overlay method override that delegates to custom ImGUI implementation in render() function and executes additional UI callbacks when provided.
Renames header guards in ImGUIUtil.h from ORB_SLAM3_IMGUI_H to IMGUI_UTIL_H to match the actual file name. Excludes samples/complex/render_octomap/octomap directory from CI workflow file checks.
… with static_cast

Improves code style consistency by adding braces to all single-statement if blocks. Replaces C-style casts with appropriate static_cast and reinterpret_cast. Filters out third_party/glfw warnings from clang-tidy output in CI workflow.
Replaces leading spaces with tabs to maintain consistent formatting throughout the file.
@SaschaWillems

Copy link
Copy Markdown
Collaborator

This does compile for me now (after explicitly updating submodules), but crashes at startup with the following error:

"ERROR: Filestream to assets/scenes/octmap_and_splats/octMap.bin not open, nothing read."

I do see octMap.bin directly below the assets/scene folder.

@gpx1000

gpx1000 commented Jan 2, 2026 via email

Copy link
Copy Markdown
Collaborator Author

@gary-sweet

Copy link
Copy Markdown
Contributor

Not supported on direct-to-display platforms. Doesn't even build the sample.

Replaces GLFW-specific key handling with framework's KeyCode enum for platform-agnostic input. Renames handleKey to handle_key_event to match framework naming conventions. Updates modifier key state tracking to use ImGui's key state. Removes GLFW dependency and platform-specific conditionals from ImGUI implementation. Enables render_octomap sample on all platforms including Android, iOS, and Direct-to-Display.
Updates copyright headers across framework components and shaders from 2025 to 2026.
Updated copyright headers across various project files to reflect the year 2026. This ensures consistency and compliance with licensing requirements.
@gpx1000

gpx1000 commented Jan 8, 2026

Copy link
Copy Markdown
Collaborator Author

Give it another try Gary, I removed the input handling by GLFW assumption used during development. Although, I still haven't had the time to generate a new map to go along with this; it should build for everyone on all devices and then run until you get to Sascha's problem of not having the map yet.

@gary-sweet

Copy link
Copy Markdown
Contributor

Give it another try Gary, I removed the input handling by GLFW assumption used during development. Although, I still haven't had the time to generate a new map to go along with this; it should build for everyone on all devices and then run until you get to Sascha's problem of not having the map yet.

Confirmed. This now gets to the same point for me.

@gpx1000 gpx1000 changed the title Add a octomap rendering sample Add a Gaussian Splat and octomap rendering sample Apr 2, 2026
gpx1000 added 4 commits May 31, 2026 19:03
# Conflicts:
#	.gitmodules
#	framework/CMakeLists.txt
…ting spec

Moves Gaussian splatting attributes from extension object to primitive attributes using KHR_gaussian_splatting namespace. Updates attribute parsing to check KHR_gaussian_splatting:ROTATION, SCALE, OPACITY, and SH_DEGREE_0_COEF_0 in primitive attributes first, with fallback to old draft extension properties and COLOR_0. Simplifies extension parsing logic and removes nested property structures. Updates code examples in tutorial documentation to reflect new attribute structure.
@gary-sweet

Copy link
Copy Markdown
Contributor

Are these errors expected:

ERROR: Filestream to assets/scenes/octmap_and_splats/octMap.bin not open, nothing read.
[error] Error Message: Failed to open file for reading at path: shaders/render_octomap/glsl/imgui.vert.spv
[error] Failed when running application Octmap rendering

Comment thread samples/complex/render_octomap/README.adoc Outdated
@gary-sweet

Copy link
Copy Markdown
Contributor

Yep, that worked. WASD and the mouse will let you move around. That's the voxel view of the occupancy grid. Click on the other two buttons to see other views of the same map.

But I can't click on the buttons (we don't have a mouse). Normally the arrow keys move around in the UI, but not in this sample it seems.

@gpx1000

gpx1000 commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator Author

But I can't click on the buttons (we don't have a mouse). Normally the arrow keys move around in the UI, but not in this sample it seems.

Okay, gimme a bit and there'll be a new version that lets you move around arrow keys as normal. The complex sample I original designed to use less of the framework so it doesn't inherit the input. Easy fix working on it and the shader compiler now.

… in built spv files so platforms that oddly don't auto build will work.
@gpx1000

gpx1000 commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator Author

Yep, that worked. WASD and the mouse will let you move around. That's the voxel view of the occupancy grid. Click on the other two buttons to see other views of the same map.

But I can't click on the buttons (we don't have a mouse). Normally the arrow keys move around in the UI, but not in this sample it seems.

This version should allow you to do keyboard nav in imgui.

@gary-sweet

gary-sweet commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

This version should allow you to do keyboard nav in imgui.

Sadly not:

Reading binary octree type OcTree
    01:46:01.620 nexus_display_hlm: usage 6 enabled
vulkan_samples: /build/gsweet/vc5_git/thirdparty_vulkan/Vulkan-Samples/third_party/imgui/imgui.cpp:1488: void ImGuiIO::AddKeyAnalogEvent(ImGuiKey, bool, float): Assertion `KeyMap[n] == -1 && "Backend needs to either only use io.AddKeyEvent(), either only fill legacy io.KeysDown[] + io.KeyMap[]. Not both!"' failed.
Aborted

@SaschaWillems

Copy link
Copy Markdown
Collaborator

Sample does run for me, but I'm seeing a similar issue to the one Gary reported. As soon as I press a key (e.g. "S") I get an assertion:

image

Also unsure what it's supposed to look like. Can you post/add some reference screenshots?

@gpx1000

gpx1000 commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator Author
image image image

This is a temp map while I make a new one that hopefully looks nicer. The gaussian splats are from a single live run so they don't look that detailed. They are accurate. The octomap renders are as described in the text, no textures, just points in an occupancy grid. So those are by design false colors.

Comment thread samples/complex/render_octomap/render_octomap.cpp Outdated
@SaschaWillems

SaschaWillems commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Could documentation be expanded at least a bit? The code has very few comments and the readme is mostly talking about the topic and not the sample itself.

…es from what we do in GLTF_Loader in the framework, but it's a good idea).
@gary-sweet

Copy link
Copy Markdown
Contributor

The UI traversal is now working, thanks.

@gpx1000

gpx1000 commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator Author

Could documentation be expanded at least a bit? The code has very few comments and the readme is mostly talking about the topic and not the sample itself.

I updated the README.adoc. If you'd like specific information let me know and I'll add it. I think I'm headed to bed for a nap so might be a few hours before I do another update.

@SaschaWillems

Copy link
Copy Markdown
Collaborator

That's perfect. Thank you very much 👍🏻

@r-potter r-potter self-requested a review June 10, 2026 12:42
@r-potter

Copy link
Copy Markdown

No reflection on the quality of the sample but we should hold off merging this until internal discussions are fully resolved (but please continue to review).

@SaschaWillems SaschaWillems self-requested a review June 10, 2026 14:58
SaschaWillems
SaschaWillems previously approved these changes Jun 10, 2026
SaschaWillems
SaschaWillems previously approved these changes Jun 11, 2026
Comment thread samples/complex/render_octomap/README.adoc Outdated
@marty-johnson59

Copy link
Copy Markdown
Contributor

Hi @asuessenbach, are you OK if we merge this PR? It has fixes to CI that are breaking things, so would like to do this soon (or else spin the fixes out separately..). LMK, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants