Building SORT with source code

SORT is a cross-platform project that runs on multiple platforms, including Windows, Mac OS, and Ubuntu.

It is fully open-source and built on C++ 17. Following are the mandatory software to compile SORT:

Setup Compiling Environment

Platform Independent Compiling Options

There are only a few compiling options for us to pay attention in SORT CMake generation.

Download Dependencies before Compiling

SORT's shading system heavily replies on another open source project of mine, Tiny Shading Language, which is an essential part of interpreting its shader code. In order to compile SORT successfully, it is mandatory to get a compiled version of Tiny Shading Language first. The following command, 'make update_dep', will do so. What it does under the hood is just checking out the source code of that project and compile it on the fly.

Windows

It is necessary to install Visual Studio 2015 or above to compile SORT on Windows. And please also make sure that ‘msbuild.exe’ is in the system ‘Path’ folder so that the script can run it directly.

Mac OS

Please install XCode first before compiling on MacOS.

Ubuntu

Unlike the other two platforms, for which SORT has packed all necessary libararies in the dependency, some of the depedent libraries is OS dependent. SORT doesn’t pack those OS dependent libraries with it, it is programmer’s responsibility to setup the correct environment before building it, meaning compiling SORT on Ubuntu requires some basic setup first.

Following is the tools and library needed by SORT and the correct way to install them on Ubuntu (Xenial)

There is no need to setup G++ on Ubuntu Bionic and Focal since the default version comes with the system is already G++7, which is sufficient for compiling SORT.

Unfortunately, due to limited resources, I don’t have time trying and maintaining SORT on every single version of Ubuntu. If you happen to build SORT on other version, you need to rebuild TSL library by yourself.

Compiling SORT

Of course, it is also possible to manually generate the project and load it by yourself in any proper way you see fit.

Other Available Commands

Generated Binary

Only one executable file will be generated. It will be generated in a newly created folder ‘bin’ in the SORT root folder. For release version build, an executable named ‘sort_r’ will be generated. For debug version build, it is named ‘sort_d’.



Deploying SORT

Active SORT in Blender
There are two ways to activate it in Blender. Either way, it is necessary to setup a system environment (SORT_BIN_DIR) variable to indicate where the SORT binary is.
Activate SORT in Blender

After compiling SORT with source code, there should be a binary folder with the name ‘bin’ in SORT root folder. Usually, the binary is named ‘sort_r’ for release version build and ‘sort_d’ for debugging version build. It is also fine to generate or copy the binary to any other desired folder with other binary file names.

Open the ‘Blender User Preferences’ in Blender by choosing ‘User Preferences’ in ‘File’ menu.

Tick the checkbox before SORT and the path of SORT binary will be automatically set if the environment variable is setup correctly.

Picking SORT as the Renderer

After SORT is activated in Blender, the next step is to pick SORT as the renderer in Blender so that Blender will send jobs to SORT for rendering.

Simply by choosing SORT in engine will pick it as the main renderer. The rendering process is no difference from other engines.



Copyright© 2011-2020 Jiayin Cao. All rights reserved.