`: loads the specified `vkhr` scene, with the given render settings.
* `bin/vkhr --benchmark yes`: runs the default benchmark and saves it to a CSV file inside `benchmarks/`.
* Plots can be generated from this data by using the `utils/plotte.r` script (requires R and ggplot).
* **Default configuration:** `--width 1280 --height 720 --fullscreen no --vsync on --benchmark no --ui yes`
* **Shortcuts:** `U` toggles the UI, `S` takes a screenshots, `T` switches between renderers, `L` toggles light rotation on/off, `R` recompiles the shaders by using `glslc` (needs to be set in `$PATH` to work), and `Q` / `ESC` quits the app.
* **Controls:** simply click and drag to rotate the camera, scroll to zoom, use the middle mouse button to pan.
* **UI:** all configuration happens in the ImGUI window that is documented under the `Help` button in the UI.
* `man docs/vkhr.1` will open the manual page containing even more detailed usage information for `vkhr`.
Documentation
-------------
You're reading part of it! Besides this [readme.md](/readme.md), you'll find that most of the important shaders are nicely documented. Two good examples are [GPAA.glsl](/share/shaders/anti-aliasing/gpaa.glsl) for the line coverage calculations, and [approximate_deep_shadows.glsl](/share/shaders/self-shadowing/approximate_deep_shadows.glsl) for the self-shadowing technique. You'll notice that the quality of it varies quite a bit, feel free to open an issue if you sense something isn't clear. I haven't documented the host-side of the implementation yet as that would take too long, and isn't that interesting anyway.
If you want a high-level summary of our technique read [Real-Time Hybrid Hair Rendering](https://eriksvjansson.net/papers/rthhr.pdf), which is a short conference paper on our method (only the pre-print). You'll also find a copy of it here, which you can build by using LaTeX. If you want a more extensive and detailed version of our paper, my thesis [Scalable Strand-Based Hair Rendering](https://eriksvjansson.net/papers/ssbhr.pdf), will soon be available. Both of these also show the difference between our technique and other existing frameworks like TressFX, that only use a rasterizer.
And if you still haven't had enough, I have written a bunch of entries in the [Captain's Log](https://github.com/CaffeineViking/vkhr/wiki/Captain's-Log), that shows the progress log from day 1 to the current version. Besides having a lot of pretty pictures, it shows the problems we encountered, and how we've solved them. This gives a bit more insight into why we have chosen this approach, and not something completely different. The slides for my [thesis defense](https://eriksvjansson.net/papers/ssbhr.pptx) and presentation at [EGSR 2019](https://eriksvjansson.net/papers/rthhr.pptx) could also be useful to get an overview into our technique.
Directories
-----------
* `benchmarks`: output from the bundled benchmarks goes in here.
* `bin`: contains the built software and any other accompanying tools.
* `build`: stores intermediate object files and generated GNU Make files.
* `obj`: has all of the generated object files given under compilation.
* `Makefile`: automatically generated by executing `premake5 gmake`.
* `*.make`: program specific make config for augmenting `Makefile`.
* you'll also find the pre-generated Visual Studio '17 solution here.
* `docs`: any generated documentation for this project is over here.
* `foreign`: external headers and source for libraries and modules.
* `include`: only internal headers from this project should go here.
* `vkhr`: internal headers for the Vulkan hair renderer project.
* `vkpp`: headers for a minimal modern C++ Vulkan wrapper.
* `license.md`: please look through this very carefully.
* `premake5.lua`: configuration file for the build system.
* `readme.md`: this file contains information on the project.
* `share`: any extra data that needs to be bundled should go here.
* `images`: any images on disk that should be used as textures.
* `models`: the meshes/models/materials to be used in the project.
* `shaders`: all of the uncompiled shaders should go over here.
* `scenes`: any sort of scene files (e.g. in json) should go here.
* `styles`: the hair styles compatible with the Cem Yuksel format.
* `src`: all source code for the project should be located below here.
* `vkhr`: source code for the Vulkan hair renderer project itself.
* `vkpp`: full implementation of an Vulkan C++ wrapper (separate).
* `main.cc`: the primary entry point when generating the binaries.
* `utils`: any sort of helper scripts or similar should be over here.
Reporting Bugs
--------------
`vkhr` is 100% bug-free, anything that seems like a bug is in fact a feature!
This is a proof-of-concept research prototype, and as such, I wouldn't recommend using it for something serious, at least as it is. Also, do not expect this repository to be well maintained, I will not spend too much time with it after the thesis is done.
Still, if you find anything, feel free to open an issue, I'll see what I can do :)
Acknowledgements
----------------
First I would like to thank Matthäus Chajdas, Dominik Baumeister, and Jason Lacroix at AMD for supervising this thesis, and for always guiding me in the right direction. I'd also like to thank the fine folk at LiU for providing feedback and support, in particular, my examinator Ingemar Ragnemalm and Harald Nautsch at ISY and Stefan Gustavson from ITN. I would also like to thank AMD and RTG Game Engineering for their hospitality and friendliness, and for letting me sit in their Munich office.
Legal Notice
------------
Vulkan and the Vulkan logo are registered trademarks of Khronos Group Inc.
All hair styles are courtesy of Cem Yuksel's great [HAIR model files](http://www.cemyuksel.com/research/hairmodels/) repository.
The ponytail and bear hair geometry are from the [TressFX 3.1](https://github.com/GPUOpen-Effects/TressFX/tree/3.1.1) repository, and proper rights have been granted by AMD Inc. to be used in this repository. However, you are *not* allowed to use it outside of this repository! i.e. not the MIT license for it!
The woman model was created by Murat Afshar (also for Cem Yuksel's repo).
Everything in this repository is under the MIT license *except* the assets I've used. Those fall under the license terms of their respective creators. All of the code in this repository is my own, and that you can use however you like (under the [license](/license.md)).
Both GLFW and Embree are pre-compiled to facilitate building on Windows.
See: [foreign/glfw/COPYING](foreign/glfw/COPYING.txt) and [foreign/embree/LICENSE](foreign/embree/LICENSE.txt) for these licenses.
Screenshots
-----------
The screenshot above is another render of the ponytail from TressFX (with 136,320 hair strands), but from a different angle.
Above are screenshots of the bear from TressFX 3.1 (961,280 fur strands and 3,845,120 line segments) rendered in real-time.
In the figure above we show the component-by-component difference between our rasterized and raymarched solutions.
The comparisons above shows the differences between the actual tangents (on the left) and their voxelized approximations.
Above is a comparison of the ground-truth AO (on the left) from our raytracer and our approximation (middle and right).
Here we show the difference between not handling anti-aliasing and transparency at all (on the left) and when doing so ;-).