Skip to content

Source code repository accompanying the scientific paper "Finding Efficient Spatial Distributions for Massively Instanced 3-d Models" (S. Zellmann, N. Morrical, I. Wald and V. Pascucci)

License

Notifications You must be signed in to change notification settings

ukoeln-vis/instanceviewer

Repository files navigation

Finding Efficient Spatial Distributions for Massively Instanced 3-d Models

teaser

Source code repository accompanying the scientific paper

"Finding Efficient Spatial Distributions for Massively Instanced 3-d Models".

Stefan Zellmann, Nate Morrical, Ingo Wald and Valerio Pascucci

Eurographics Symposium on Parallel Graphics and Visualization (EGPGV 2020)

@inproceedings {ZellmannMorricalWaldPascucci:2020,
booktitle = {Eurographics Symposium on Parallel Graphics and Visualization},
editor = {Steffen Frey and Jian Huang and Filip Sadlo}
title = {Finding Efficient Spatial Distributions for Massively Instanced 3-d Models},
author = {Zellmann, Stefan and Morrical, Nate and Wald, Ingo and Pascucci, Valerio},
year = {2020},
publisher = {The Eurographics Association}
}

Description

The paper presents a k-d tree builder that is instance-aware:

  • Greedy top-down construction where the objects are instances.
  • Partitioning instances to either side of a split plane candidate might require the base meshes referenced by the instances to be replicated on both sides.
  • The paper proposes a split heuristic that takes memory consumption (both total and per node) into account.

This repository includes an implementation of the k-d tree builder and a simple viewer application that can load instanced 3-d models, builds a k-d tree, and colorizes the obtained partitioning. The viewer application does not implement parallel rendering; it's main purpose is to make the k-d tree implementation a bit more accessible than merely providing the latter's source code. Models that can be loaded are quite restricted, the Moana JSON files can be loaded, as well as some of the instanced pbrt-v3 files.

Command-Line Arguments

Usage:
   ./InstanceViewer [OPTIONS] filenames...

Positional options:
   filenames...           Input file(s)

Options:
   -bgcolor               Background color
   -fullscreen            Full screen window
   -h[=<ARG>]             Run w/o display, generate stats, and exit
                          immediately
   -height=<ARG>          Window height
   -n[=<ARG>]             num nodes
   -w1[=<ARG>]            min-rep
   -w2[=<ARG>]            equal-geo
   -w3[=<ARG>]            median
   -w4[=<ARG>]            middle
   -width=<ARG>           Window width

Specifically, -n (integer, required to be power of two) lets you specify the number of compute nodes the partition should be calculated for, and -w1,-w2,-w3,-w4 let you specify the weights associated with the four components of the heuristic described in the paper. Note that in the paper we used the configuration -w1=5 -w2=1 -w3=1 -w4=1 to generate the images and compute the results.

Pictures

The viewer application can create pretty pictures like the ones below. Color coding shows the assignment of instances to compute nodes.

Source Code Organization

The file kd_tree.h includes the k-d tree implementation. In InstanceViewer.cpp#L963 the k-d tree is created. The file svt.h includes a 3-d summed area table implementation (a.k.a. "summed volume table") that we use to virtually split large base meshes as described in the paper. Pathtracer.hpp includes a simple path tracer that we use for rendering.

Third-Party Libraries

The following third-party libraries are included as submodules:

  • PBRT-Parser to parse pbrt scene files.
  • RapidJSON to parse Moana JSON files.
  • Visionaray math utilities / CPU BVH traversal for the simple path tracer.

Building the application requires a couple more tools and external libraries that must be provided by the user:

About

Source code repository accompanying the scientific paper "Finding Efficient Spatial Distributions for Massively Instanced 3-d Models" (S. Zellmann, N. Morrical, I. Wald and V. Pascucci)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published