MomentsInGraphics / vulkan_renderer

A toy renderer written in C using Vulkan to perform real-time ray tracing research.
GNU General Public License v3.0
349 stars 24 forks source link

There are no instructions on what flags to send to executable to load supporting files; no ./vulkan_renderer --help #2

Closed DaemonDave closed 8 months ago

DaemonDave commented 8 months ago

I've finished reworking your cmake folders to work with GNU autotools automake, configure and libtool.

I can make a libtool convenience library to separate out main file executables to run various versions. Some guidance on where and what you'd separate would be appreciated. What that would do is allow you separate executables along various papers with no increase in source code and folder division other than a varied main.c or other ( ex. configure --build-this=polygon-light ... and so on) you want to determine. That way builds would vary a minor amount or make all different versions on configuration (i.e. use the config.h config.in.h header to alter builds)

I notice no one has asked so I gather I'm the first developer to run it through to executables?

When it comes to running it, it fails because there's no explanation on what file flags are needed, from which data folders, and what variables alter behavour. There is no example run to show what the syntax should be like many opensource executables (i.e. like man page versions " vulkan_renderer --help ")

It fails like this:


dave@cell:~/src/vulkan_renderer/src$ ./vk-renderer  **[i changed executable target]**
The following physical devices (GPUs) are available to Vulkan:
0 - Intel(R) HD Graphics 520 (SKL GT2) (used)
1 - llvmpipe (LLVM 15.0.7, 256 bits)
Ray tracing was requested but is unavailable. Try installing the latest GPU drivers or using a different physical device.
Defined 321 experiments to reproduce.
Failed to load a quick save. Please check path and permissions: data/quicksaves/attic.save
Failed to open the noise file at path . Please check path and permissions?
Application startup has failed.

For example, here's how astyle --help starts:

" ~/.local/astyle --help

                 Artistic Style 2.06 beta
                 Maintained by: Jim Pattee
                 Original Author: Tal Davidson

Usage:

        astyle [OPTIONS] File1 File2 File3 [...]

        astyle [OPTIONS] < Original > Beautified

When indenting a specific file, the resulting indented file RETAINS
the original file-name. The original pre-indented file is renamed,
with a suffix of '.orig' added to the original filename.

Wildcards (* and ?) may be used in the filename.
A 'recursive' option can process directories recursively.

By default, astyle is set up to indent with four spaces per indent,
a maximal indentation of 40 spaces inside continuous statements,
a minimum indentation of eight spaces inside conditional statements,
and NO formatting options.

Options:

This  program  follows  the  usual  GNU  command line syntax.
Long options (starting with '--') must be written one at a time.
Short options (starting with '-') may be appended together.
Thus, -bps4 is the same as -b -p -s4.

"

Your code is replete with flaws like magic numbers, a sign that the creator feels he's way too smart when compared to others, but in reality hasn't done a minimum of due diligence to make certain the code is rational to those that weren't in the same mindset when written. I've researched over 1000 open source projects in many languages, I can assess the relative contempt without sweating... It's better to write a #define MAGIC_NUMBER_RANDOM 3 with a doxygen \def outline what the reason was than just a 3. Clarity saves time for your possible code helpers. Or not.

BTW: I've reformatted your C code into the Allman bracket style ( { and terminating } on separate lines so one can see the extent of a bracketed code block and code extent is clear) do you want those back in the main trunk?

Under main.c:


  for (int i = 1; i < argc; ++i)
  {
    const char* arg = argv[i];
    if (arg[0] == '-' && arg[1] == 'e') sscanf(arg + 2, "%d", &experiment);
    if (strcmp(arg, "-no_v_sync") == 0) v_sync_override = bool_override_false;
    if (strcmp(arg, "-v_sync") == 0) v_sync_override = bool_override_true;
    if (strcmp(arg, "-no_gui") == 0) gui_override = bool_override_false;
    if (strcmp(arg, "-gui") == 0) gui_override = bool_override_true;
  }

The experiment is formatted: "-eXXX"?

So there is a -e flag that wants an experiment number? Your folders don't have a number attached in the data so how does one find those? BTW Sscanf is a bug inducing function call if you aren't aware. Full of injections and crash inducement.

Your polygon count is hidden in sample_polygon_technique_e enum inside polygonal_light.h? Does that map to experiment #?

OR is it inside } scene_index_t; that you don't expressly outline the numbers for each enum? See the problem?

BTW There is a GNU GETTEXT library that automates the flag interpretation for letter -f flags and --word-flags= for argv and argc ... It's better and bug free since they've spent 30 years+ perfecting it. And it makes the flag explanations for you.

MomentsInGraphics commented 8 months ago

Just a quick response, because I am too busy to read the whole message right now: There are instructions in the read me that will fix your error message.

Downloading Data

Scenes and other data that are needed to run the renderer are available on the websites for the papers: http://momentsingraphics.de/Siggraph2021.html http://momentsingraphics.de/HPG2021.html

[...]

Running the Renderer

Get data files first (see above). Run the binary with current working directory vulkan_renderer.

MomentsInGraphics commented 8 months ago

Here are answers to a few of your specific questions:

Feel free to change this code base in any way you like in your own fork. But I am no longer actively developing this project and find that it serves its purposes well in its current form. Do not expect me to review and/or merge your changes.