aliens

Author Topic: Requesting VS2019 help: Integrating PBRT library into OpenXcom project.  (Read 1942 times)

Offline Skybuck

  • Colonel
  • ****
  • Posts: 223
    • View Profile
Hello,

I want to experiment with "PBRT", Physically Based Rendering. I already did some experiments with PBRT version 4 and I believe it is fast enough to be of some use for gaming purposes and therefore I think it is worth it to try and integrate into OpenXcom to see what it can do. Also in the future and even currently, cuda support/graphics card acceleration is also possible, but it already runs fast enough on just CPU.

The problem however is that the PBRT project is very complex. It has many many many external dependencies and I am simply not that good/experienced with Visual Studio and Static Library inclusion/integration. Whenever I try it I run into all kinds of linker problems.

I really need a Visual Studio expert to look at this and see if he/she can integrate PBRT preferably on some OpenXcom git branch which could then be "downloaded / git fetched pulled by me, (possibly others too)".

PBRT version 4 requires C/C++ 2017 language version. Thus OpenXcom Extended from Meridian seems to be the best choice to try an integration. (Unless you believe static libraries produced by different c/c++ languages are compatible ?)

Building PBRT itself is quite easy and with these steps I can help:

I will first describe it vaguely if you need any further help then I will describe it in more details:

The steps are as follows:

1. Install a recent version of CMake-GUI

2. "Download/git fetch/git pull/git checkout/git clone" the PBRT v4 repository: https://github.com/mmp/pbrt-v4

3. Start Cmake and point the first folder to the 'src' folder of PBRTv4

4. Point the second folder to a new folder where the binaries will be "build".

5. Click configure and select the platform to build for. I recommend win32. (To build for another platform repeat from start 3 but about to a different build folder).

6. Click generate.

Now CMake-GUI will generate some visual studio project files in the build folder. Go there and open the solution file for PBRT-v4.sln and select build solution.
(Select release in visual studio if you want a release version, default it's debug version)

7. This will produce PBRT.exe in release folder or debug folder (which can read *.pbrt files and render it to a PNG), it will also produce libpbrt.lib which I would like to include into OpenXcom project preferably with header support. (It might also be possible to include this lib in a DLL project ?)

The debug version will produce libpbrt_d.lib.

This is how far I got... I need help with trying to use *.lib in OpenXcom or even a simple console project. I tried including the *.cpp *.h files of PBRT directly but this won't work because Cmake transforms some of the files, like config.h.in or something to config.h.

For now I will try and evaluate the usefullness of PBRT by exporting OpenXcom graphics/map/tiles/voxels towards a *.PBRT file so that it can be rendered.

Consider this a "heads-up" posting. My final verdict if integrating PBRT with OpenXcom should be attempted will follow later.

Low res/low quality and high res/high quality screenshots added of today's achievement ! I think this is a go-ahead ! =D

Bye for now,
  Skybuck.
« Last Edit: May 20, 2022, 01:43:47 am by Skybuck »

Offline Skybuck

  • Colonel
  • ****
  • Posts: 223
    • View Profile
PBRT is link garbage, junk deleted.

Going to try Mitsuba renderer next.

Offline Skybuck

  • Colonel
  • ****
  • Posts: 223
    • View Profile
Mitsuba 2 dismissed as well. Cannot build for win32. Plus it has all kinds of python issues.

Offline Skybuck

  • Colonel
  • ****
  • Posts: 223
    • View Profile
Tried intel otp something, but some kind of problems most likely, plus the build time will be insane. I have had enough of slow c/c++ project and compilers and shitty noise raytracers.

So I am going back to my own code which does not have any of these problems.