All Projects → nvpro-samples → gl_vk_bk3dthreaded

nvpro-samples / gl_vk_bk3dthreaded

Licence: Apache-2.0 license
Vulkan sample rendering 3D with 'worker-threads'

Programming Languages

C++
36643 projects - #6 most used programming language
c
50402 projects - #5 most used programming language
GLSL
2045 projects
CMake
9771 projects

Projects that are alternatives of or similar to gl vk bk3dthreaded

bgfx-python
Python 3.7+ wrapper for the BGFX library. 🐍
Stars: ✭ 99 (+23.75%)
Mutual labels:  vulkan
cain-ncnn-vulkan
CAIN, Channel Attention Is All You Need for Video Frame Interpolation implemented with ncnn library
Stars: ✭ 85 (+6.25%)
Mutual labels:  vulkan
ncnn-android-squeezenet
The squeezenet image classification android example
Stars: ✭ 100 (+25%)
Mutual labels:  vulkan
daisykit
Daisykit is an easy AI toolkit for software engineers to integrate pretrained AI models and pipelines into their projects. - with NCNN, OpenCV, Python wrappers
Stars: ✭ 22 (-72.5%)
Mutual labels:  vulkan
eseed-window
A minimal cross-platform C++17 window management library for rendering (deprecated)
Stars: ✭ 18 (-77.5%)
Mutual labels:  vulkan
framework
The exomia/framework is used for building 2D and 3D games and more inspired by the XNA/Mono framework.
Stars: ✭ 21 (-73.75%)
Mutual labels:  vulkan
Camera2GLPreview
Android camera preview application using Camera2 API and OpenGL ES/Vulkan
Stars: ✭ 140 (+75%)
Mutual labels:  vulkan
vktut
Shabi's Vulkan Tutorials
Stars: ✭ 88 (+10%)
Mutual labels:  vulkan
kompute
General purpose GPU compute framework built on Vulkan to support 1000s of cross vendor graphics cards (AMD, Qualcomm, NVIDIA & friends). Blazing fast, mobile-enabled, asynchronous and optimized for advanced GPU data processing usecases. Backed by the Linux Foundation.
Stars: ✭ 872 (+990%)
Mutual labels:  vulkan
ZinoEngineV1
A custom Vulkan 3D game engine in C++ 3d that I make for fun.
Stars: ✭ 17 (-78.75%)
Mutual labels:  vulkan
FFNx
Next generation modding platform for Final Fantasy VII and Final Fantasy VIII ( with native Steam 2013 release support! )
Stars: ✭ 200 (+150%)
Mutual labels:  vulkan
Nabla
OpenGL/OpenGL ES/Vulkan/CUDA/OptiX Modular Rendering Framework for PC/Linux/Android
Stars: ✭ 235 (+193.75%)
Mutual labels:  vulkan
netzhaut
Web Browser Engine Written In C99.
Stars: ✭ 20 (-75%)
Mutual labels:  vulkan
reaper
Tiny C++ Engine
Stars: ✭ 21 (-73.75%)
Mutual labels:  vulkan
tokonoma
Graphics related projects/prototypes/playground (Vulkan, C++17)
Stars: ✭ 23 (-71.25%)
Mutual labels:  vulkan
rendering-fw
Rendering framework with rasterizers & path tracers implemented using Vulkan, OptiX & OpenGL
Stars: ✭ 81 (+1.25%)
Mutual labels:  vulkan
QtVulkan
Example of usage Vulkan (MoltenVK) with Qt on OS X
Stars: ✭ 20 (-75%)
Mutual labels:  vulkan
VulkanResources
A list of resources for learning Vulkan
Stars: ✭ 50 (-37.5%)
Mutual labels:  vulkan
Vortex2D
Real-time fluid simulation engine running on GPU with Vulkan
Stars: ✭ 91 (+13.75%)
Mutual labels:  vulkan
magma
Abstraction layer to facilitate usage of Khronos Vulkan API
Stars: ✭ 23 (-71.25%)
Mutual labels:  vulkan

Vulkan & OpenGL & Command-list Sample using "Thread-Workers"

With the official release of Vulkan, NVIDIA and the "Devtech-Proviz" Team released new samples on professional graphics repository.

The Purpose of this Blog post is to give more details on what is happening in the Sample called gl_vk_bk3dthreaded (available here).

Example

How to build the sample

For now, I am sorry to say that the sample might only run on Windows. I didn't consolidate it for Linux, yet.

This sample requires the following:

  • LunarG SDK v1.0.3.1 : just install it from https://vulkan.lunarg.com : cmake should be able to locate it
  • shared sources : this folder contains few helper files and additional cmake information needed to build the project
  • the submarine model: when you will configure the project with cmake, cmake script will perform a wget to get the model and store it locally: MODEL_DOWNLOAD_SUBMARINE Checked. The model is 32Mb and will be stored in a shared folder called downloaded_resources

Optionally, be aware that other bk3d models could be used in this sample. But to avoid heavy download, only the submarine will be taken by default. Check MODEL_DOWNLOAD_MORE On for more models...

How does the sample work

The sample will run by default with the submarine model and some camera animation. So if you want to freely move the camera, don't forget to stop the animation (UI or 'a' key)

If you give as cmd-line argument another model (*.bk3d.gz or *.bk3d), the sample should be able to render it but the animation will be turned off; and it is possible that the camera won't focus exactly over the new model...

Vulkan renderer will be the default one at startup. You can switch between:

  • OpenGL & Command-lists: an example on how to feed the token-buffers
  • OpenGL: a basic implementation of how would you render 3D with OpenGL
  • Vulkan: the default renderer

toggles

Note: toggles are preceded by a character between quotes: when the viewport has the focus, you can use the keyboard instead.

  • Use Workers: checked for multi-threading. Unchecked: only the main thread will update the draw commands (cmd-buffers)
  • command-buffer amount: by default, 16 secondary command-buffers will be created to render everything. In the multi-threading case, thread-workers will get spawned and will work on building them: when 'c' toggle is checked (command-buffer continuous refresh)
  • Cmd-buf-style: this model came from a CAD application. It turns out that at the time this model was created, primitives were issued depending on their 'parts', rather than depending on their primitive type and/or materials (hence shaders). "sort on primitive type" would allow to first render triangles; then strips; then lines...
  • MSAA: Multispampling mode
  • 'c', &g_bRefreshCmdBuffers, "c: toggles command buffer continuous refresh\n");
  • , &m_realtime.bNonStopRendering, "space: toggles continuous rendering\n");
  • toggles from 'o'to '5' are obvious options... just give a try

###cmd-line arguments

  • -v (VBO max Size)
  • -m (bk3d model)
  • -c 0 or 1 : use command-lists
  • -o 0 or 1 : display meshes
  • -g 0 or 1 : display grid
  • -s 0 or 1 : stats
  • -a 0 or 1 : animate camera
  • -d 0 or 1 : debug stuff (ui)
  • -m (bk3d file) : load a specific model
  • (bk3d file name) : load a specific model
  • -q (msaa) : MSAA

mouse

special Key with the mouse allows few to move around the model. The camera is always targeting a focus point and is essentially working in "polar coordinates" (TODO: I need to display the focus point with a cross...)

  • mouse wheel: zoom in/out from the focus point
  • left mouse button: rotate around the focus point
  • right mouse button: rotate around Ox axis and zoom in/out from focus point
  • right mouse button + Ctrl: will push forward/backward the focus point
  • middle mouse button: pan left/right up/down the focus point along camera axis
  • arrows: rotate around the focus point
  • Pg-up/Pg-down: zoom in/out
  • Pg-up/Pg-down + Ctrl: push forward/backward the focus point along camera axis

3D model(s)

the 3D model comes from a pre-baked format (see here ). There is no value to understand how it is working: main interest is that it loads fast (baked format... saving us parsing time) and that I managed to 'capture' some models as they were issued by various applications.

The sample will load the model, then attach it to the renderers. The resource creation will thus depend on which Graphic API is being used.

More technical details

Here are more details in separate sub-sections :

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].