Skip to content

nolankramer/vsgQt6

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vsgQt6

Open Source (MIT Licensed), cross platform C++ library providing integration of VulkanSceneGraph with Qt windowing. Supports Windows, Linux and macOS.

vsgQt6 provides full Vulkan support through the VulkanSceneGraph's built in VkSurface support rather than the limited Vulkan support that Qt-5.10 or later provide. Using the VulkanSceneGraph for providing Vulkan support avoids the restriction that Qt's VulkanWindow has with not being able to share VkDevice between windows, and provides compatibility with Qt versions prior to it adding Vulkan support. Sharing vsg::Device/VkDevice between widgets is crucial for providing multiple 3D viewport widgets without blowing up GPU memory usage.

vsgQt6 provides native Qt integration through the use of a QQuickWidget or QQuickWindow. It does this in the follow manner:

  1. Set the QQuickWindow graphics API to Vulkan with QQuickWindow::setGraphicsApi
  2. Create a Qt graphics device from our vkDevice with QQuickGraphicsDevice::fromDeviceObjects
  3. Set the QQuickWindow graphics device with the above created graphics device
  4. Subclass QQuickWidget and have it create a QSGTexture that in-turn delivers a QRhiTexture. The underlying texture buffer can be accessed with QRhiTexture::nativeTexture()
  5. VSG renders into the above buffer
  6. The QQuickWidget renders a scene with a single QSGSimpleTextureNode, which ultimately renders the QSGTexture that is "shared" with VSG
  7. There are various events that can be used to integrate the render loop, such as QQuickItem::updatePaintNode or QQuickWindow::beforeRendering

Checking out vsgQt6

git clone https://github.com/vsg-dev/vsgQt6.git

Dependencies:

Building vsgQt6

cd vsgQt6
mkdir build && cd build
cmake ..
cmake --build . -j8

Examples

./bin/vsgqtviewer <3D MODEL FILEPATH>
./bin/vsgqtmultiviewer <3D MODEL FILEPATH>
./bin/vsgqtwindows <3D MODEL FILEPATH>
  • vsgqtviewer - example of single QApplication/QMainWindow usage with single vsgQt6::Viewer.
  • vsgqtmultiviewer - example of QWindow usage with multiple vsgQt6::Viewer in the same QWindow.
  • vsgqtwindows - example of multiple vsgQt6::Viewer per QWindow.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published