Repository navigation
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,MultiViewerandOffScreenrun on either backend. On macOS Vulkan runs through MoltenVK. - Choose the backend when you configure the build with
Easy3D_ENABLE_VULKAN(ONby 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.
OffScreenneeds 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,MultiViewerandOffScreenclasses for both backends, sharing one input-event API (ViewerBase). - Viewer window settings are grouped into the new
WindowOptionsstruct. Backend-specific settings go toVulkanOptions(validation layers, device selection, ...) orOpenGLOptions(GL version, depth/stencil bits). - MSAA follows one rule on both backends:
samplesof 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. MultiViewersupports 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=ONrequires 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()andtotal_duration(). - Smooth orientation interpolation with
quat::squad(). - Keyframe editing (
KeyframeEditor,KeyframeGizmo) andCameraPathBuilder(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,
Altgestures 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-Qtfor 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, defaultON);Easy3D_ENABLE_QT(removed);Easy3D_BUILD_TUTORIALSnow defaults toOFF. - 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 was4. Setwindow.samples = 4to keep the old look. - Include
<easy3d/viewer/viewer.h>as before. Subclass hooks (init(),draw(),mouse_press_event(), ...) are unchanged. - The
Viewerconstructor 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_QTis removed, and Tutorial 203 (wxWidgets) and Tutorial 204 (Qt) are gone. UseViewer(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_MultiViewTutorial_203_MultiView(new) Tutorial_204_OffscreenTutorial_207_RealCameraTutorial_205_RealCameraTutorial_404_VirtualScannerTutorial_405_VirtualScannerTutorial_405_ObjectManipulationTutorial_404_ObjectManipulation -
Tutorials are no longer built by default; configure with
-DEasy3D_BUILD_TUTORIALS=ON. -
Unused, unmaintained Python binding sources under
python/bindings/unusedwere removed; Python tutorials moved topython/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=OFFor use the backend-neutral API.
Quick migration checklist
- Choose the backend:
-DEasy3D_ENABLE_VULKAN=ON(default) orOFFfor OpenGL. - Update the
Viewerconstructor call to useWindowOptions. - Rename
Camera/Framecalls to snake_case. - Replace Qt/wxWidgets viewers with
Viewer; use the ImGui Mapple. - Rebuild; vulkan builds need a Vulkan 1.2 loader/driver (MoltenVK on macOS).