Skip to content

cg-tuwien/FastRenderingOfParametricObjects

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Accompanying source code of our EGPGV 2024 'best' paper: Fast Rendering of Parametric Objects on Modern GPUs
by Johannes Unterguggenberger, Lukas Lipp, Michael Wimmer, Bernhard Kerbl, and Markus Schütz
Research Unit of Computer Graphics, TU Wien

Screenshot of the UI section to enable/disable parametric objects
Figure 1: A screenshot of the UI section which allows enabling and disabling of different kinds of parametric objects.

This technique allows fast rendering of various parametrically defined objects like the following:

Parametric Seashell Parametric Fiber Curves Curtain of Fiber Curves Spherical Harmonics (SH) Glyph
Parametrically defined seashell model Parametrically defined fiber curves Curtain made of hundreds of thousands of fiber curves Spherical Harmonics glyph can be parametrically defined
Parametric description of a seashell model Parametric description of six intertwined fiber curves A curtain made of 358k fiber curves, which are rendered fully opaque SH functions classify as parametric functions; can be used for detailed medical visualization

When the program is run, it will present the window shown in Figure 1 in the user interface (UI), which contains controls to enable/disable various parametrically defined objects, along with controls to change their position, and change their rendering method. Further settings and information, like the frames per second, can be found in another UI window. Information about the implementation and the structure of the source code can be found in our paper, in the used framework Auto-Vk-Toolkit, in source code comments, and below in section Hints, Q&A.

Setup

Requirements:

  • Visual Studio 2022
  • MSVC C++ compiler
  • Vulkan 1.3 or 1.4 SDK with VMA header (optional component => select during SDK install)
  • A GPU with at least 3 gigabytes of video memory*

*) Some buffers are pre-allocated, totalling approximately 3 gigabytes. See MAX_VERTICES and MAX_INDICES in code.

Setup:

  • Clone this repository
  • Pull submodules: git submodule update --init --recursive
  • Open FastRenderingOfParametricObjects.sln
  • Select the project FastRenderingOfPaametricObjects as the startup project
  • Build All and wait for the Post Build Helper to have deployed all the assets
  • Debug/Run the solution

Hints, Q&A

Important implementation files

Most of the host code is contained in the big huge main.cpp file, which also contains the program entry point.
Some relevant type definitions are contained in types.hpp and their matching GLSL types are contained in types.glsl.
Parametric functions are evaluated on the fly during rendering in the file parametric_curve_helpers.glsl, most importantly in the function vec4 paramToWS(float u, float v, int curveIndex, uvec3 userData), which calls the different parametric functions implemented in the following files:

Configuration options in source code

Besides the configuration options which are controllable through the UI, there are several configuration options that can be changed in source files: The file host_device_shared.h is included from both, the C++ side and the GLSL side. It contains several relevant configuration options, which are documented in source code. For example, it contains MAX_VERTICES and MAX_INDICES which indicate the sizes of pre-allocated buffers. There are also some configuration options at the top of the main.cpp file, like settings for multi sampling or super sampling. Furthermore, some of the GLSL files contain configuration settings which are relevant to the specific file.

Can more discrete level-of-detail (LOD) meshes be added?

Yes, we have only included six different LODs to save storage in the repository and in GPU memory. More LODs can be added. See void load_discrete_lods_of_seashells() in main.cpp.

Where is the SH brain dataset?

For reasons, we could not include the SH brain scan dataset (containing 19,600 SH glyphs) in this repository. Only one single SH glyph is defined directly in source code (see SH_COEFFS in parametric_functions/sh_glyph.glsl). Loading of a large dataset from a specific (non-standard) file is implemented in big_dataset.cpp. If you would like to get help with loading and rendering a large data set, please contact the first author via [email protected].

About

Accompanying source code to our paper Fast Rendering of Parametric Objects on Modern GPUs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published