Skip to content

Easy3D-v2.7.0 Native Vulkan support

Latest

Choose a tag to compare

@LiangliangNan LiangliangNan released this 23 Nov 20:36
· 109 commits to main since this release

Easy3D-v2.7.0 Native Vulkan support

Easy3D 2.7.0 is a milestone release. Easy3D now renders natively through Vulkan, in addition to OpenGL, from the same C++ API. Unlike most visualization libraries, which are tied to OpenGL (a legacy API that is deprecated on macOS), Easy3D lets you pick the graphics backend at build time and keep your application code unchanged.

Highlights

  • Native Vulkan backend (Vulkan 1.2). Viewer, MultiViewer and OffScreen run on either backend. On macOS Vulkan runs through MoltenVK.
  • Choose the backend when you configure the build with Easy3D_ENABLE_VULKAN (ON by default). A build contains exactly one backend; there is no runtime switching.
  • Portable rendering. Points, spheres, surfels, wide lines, cylinder/cone impostors, textures, scalar fields, text, OBJ materials, clipping planes, MSAA, picking, lasso selection and overlays work on Vulkan without geometry shaders or optional device features. SPIR-V shaders are compiled at build time and embedded, so installed applications need only a Vulkan loader and driver.
  • Headless Vulkan rendering. OffScreen needs no window, display or OpenGL context.
  • Mapple now runs on Vulkan. The Qt-based Mapple was OpenGL-only. Mapple has been rebuilt on Dear ImGui and runs on both backends.
  • Professional camera paths. Keyframe timing and motion were redesigned for smooth, cinematic camera-path videos.

What's new

Vulkan and the viewer library

  • New backend-neutral rendering layer (render_device.h) with a native Vulkan device, and the OpenGL code moved behind the same interface.
  • Unified Viewer, MultiViewer and OffScreen classes for both backends, sharing one input-event API (ViewerBase).
  • Viewer window settings are grouped into the new WindowOptions struct. Backend-specific settings go to VulkanOptions (validation layers, device selection, ...) or OpenGLOptions (GL version, depth/stencil bits).
  • MSAA follows one rule on both backends: samples of 0 or 1 disables it, any other power of two enables it, and an unsupported count steps down to the largest supported one with a warning.
  • MultiViewer supports per-cell rectangles on both backends.
  • Order-independent transparency (per-pixel linked lists) is available on both backends. The OpenGL resolve pass now composites fragments in the correct (back-to-front) order.
  • Screen-space overlays and ImGui are rendered through the backend-neutral path, so ImGui-based tools work on Vulkan too.
  • Vulkan validation layers can be enabled for debugging (VulkanOptions::validation); Easy3D_BUILD_TESTS=ON requires them.

Camera paths and keyframes

  • Per-keyframe dwell time and a cinematic speed profile (ease-in/ease-out, near-constant speed along long trajectories), with playback accessors playback_elapsed() and total_duration().
  • Smooth orientation interpolation with quat::squad().
  • Keyframe editing (KeyframeEditor, KeyframeGizmo) and CameraPathBuilder (orbit, ground-walk and flight paths) moved from the application into the renderer library, so they are reusable by your own applications. Keyframe cameras can be drawn as scene glyphs.

Mapple

  • Migrated from Qt to Dear ImGui; one UI stack on both backends.
  • Camera Path window: elapsed-time readout and playhead, dwell control under the timeline, Alt gestures for keyframe editing, insert/delete that preserves dwell pauses, and video recording with a selectable sample count.
  • The Qt version is retired and kept as applications/Mapple-Qt for reference. It can only be built standalone against an OpenGL build of Easy3D.

Algorithms, tests and build

  • New: graph minimum spanning tree, and surface-mesh ambient occlusion (algo).
  • Extensive Vulkan and OpenGL test suites; CI no longer builds Qt.
  • CMake: Easy3D_ENABLE_VULKAN (new, default ON); Easy3D_ENABLE_QT (removed); Easy3D_BUILD_TUTORIALS now defaults to OFF.
  • Tutorials reorganized, and more of them (e.g., the 6xx, 7xx and 8xx algorithm tutorials) run on both backends. See the table below.

Breaking changes and migration

1. Viewer constructor

Window settings moved out of the long positional argument list into WindowOptions.

// v2.6.1
Viewer viewer("Title", 4 /*samples*/, 3, 2 /*GL*/, false /*full_screen*/, true /*resizable*/, 24, 8 /*depth, stencil*/, 1024 /*width*/, 768 /*height*/);

// v2.7.0
WindowOptions window;
window.width = 1024;
window.height = 768;
window.samples = 4;
Viewer viewer("Title", window);  // Vulkan-specific: pass VulkanOptions as the third argument
                                 // OpenGL-specific: pass OpenGLOptions 
  • Fields: width, height, samples, full_screen, visible, resizable.
  • The default sample count is now 1 (no MSAA); it was 4. Set window.samples = 4 to keep the old look.
  • Include <easy3d/viewer/viewer.h> as before. Subclass hooks (init(), draw(), mouse_press_event(), ...) are unchanged.
  • The Viewer constructor throws if the chosen backend cannot be initialized.

2. Camera, Frame (and related classes) use snake_case

The API now follows the snake_case convention of the rest of Easy3D. There are no deprecated aliases; update the names. This applies to C++ and to the Python bindings.

v2.6.1 v2.7.0
viewDirection(), upVector(), rightVector() view_direction(), up_vector(), right_vector()
setPosition(), setOrientation() set_position(), set_orientation()
setUpVector(), setViewDirection() set_up_vector(), set_view_direction()
lookAt(), showEntireScene(), centerScene() look_at(), show_entire_scene(), center_scene()
fitSphere(), fitBoundingBox(), fitScreenRegion() fit_sphere(), fit_bounding_box(), fit_screen_region()
fieldOfView(), aspectRatio(), screenWidth() field_of_view(), aspect_ratio(), screen_width()
pixelGLRatio() world_pixel_ratio()
set_modelview_matrix() set_model_view_matrix()
interpolateToFitScene(), interpolateTo(const Frame&, ...) interpolate_to_fit_scene(), interpolate_to(const Frame*, ...)
Frame::referenceFrame(), setReferenceFrame() reference_frame(), set_reference_frame()
Frame::coordinatesOf(), transformOf() coordinates_of(), transform_of()
Frame::setTranslationAndRotation() set_translation_and_rotation()

Rule of thumb: convert camelCase to snake_case. Related classes (ManipulatedFrame, KeyFrameInterpolator, constraints) were aligned the same way; the compiler will point to anything missed.

3. Qt and wxWidgets are no longer supported

  • Easy3D_ENABLE_QT is removed, and Tutorial 203 (wxWidgets) and Tutorial 204 (Qt) are gone. Use Viewer (GLFW + optional ImGui) for GUI applications.
  • The Qt Mapple is retired; use the ImGui Mapple.

4. Other changes to be aware of

  • easy3d/util/console_style.{h,cpp} was removed.

  • Several tutorials were renumbered:

    v2.6.1 v2.7.0
    Tutorial_205_MultiView Tutorial_203_MultiView
    (new) Tutorial_204_Offscreen
    Tutorial_207_RealCamera Tutorial_205_RealCamera
    Tutorial_404_VirtualScanner Tutorial_405_VirtualScanner
    Tutorial_405_ObjectManipulation Tutorial_404_ObjectManipulation
  • Tutorials are no longer built by default; configure with -DEasy3D_BUILD_TUTORIALS=ON.

  • Unused, unmaintained Python binding sources under python/bindings/unused were removed; Python tutorials moved to python/tutorials.

  • OpenGL-only entry points are unavailable in a Vulkan build and report an explicit error. Applications that call them directly should either build with -DEasy3D_ENABLE_VULKAN=OFF or use the backend-neutral API.

Quick migration checklist

  1. Choose the backend: -DEasy3D_ENABLE_VULKAN=ON (default) or OFF for OpenGL.
  2. Update the Viewer constructor call to use WindowOptions.
  3. Rename Camera/Frame calls to snake_case.
  4. Replace Qt/wxWidgets viewers with Viewer; use the ImGui Mapple.
  5. Rebuild; vulkan builds need a Vulkan 1.2 loader/driver (MoltenVK on macOS).