This page provides information on V-Ray SDK.
The V-Ray SDK comes with V-Ray for 3ds Max installation and allows the creation of V-Ray compatible materials, textures, lights, atmospheric effects, cameras, and custom geometric primitives. In addition, the V-Ray SDK includes the source code for some of the additional V-Ray plugins - for example, the VRayDomeCamera plugin.
The V-Ray SDK is installed with the Workstation installation type and is normally installed in the folder C:\Program Files\Chaos Group\V-Ray\3ds Max #### where #### is the version of 3ds Max (2020, 2021, etc.).
The V-Ray SDK includes the following folders:
\docs – Includes general information about the V-Ray architecture as well as a help file vrayclasses.chm with documentation of the various classes in the SDK. The vrayclasses.chm file is automatically generated from the header files included with the SDK.
\include – Contains the header files for the V-Ray SDK needed for compiling 3ds Max plugins that use the V-Ray SDK.
\lib – Contains the library files needed for linking plugins that use the V-Ray SDK.
\samples – Includes the source code for some of the plugins that ship with V-Ray (e.g. the VRayDomeCamera plugin), as well as some additional samples (e.g. VRayBlinnMtl).
Compiling the Samples
The sample projects come with a CMake project that can be used to generate Microsoft Visual Studio solutions or Ninja projects. The toolset version to use should be Microsoft Visual Studio 2019 with the MSVC runtime version 14.2x
A matching 3ds Max SDK is needed to build the example projects. The setup needs the CMake variable 3DSMAX_SDK_ROOT set to point to the 3ds Max SDK root.
V-Ray solutions have some options that are conditionally defined in few stages of the CMake configuration process. Because of this when using the CMake GUI one may have perform the configure step few times so all the options are set-up.
To get started with the samples for 3ds Max 2022:
- Open command prompt in the samples directory, e.g. C:\Program Files\Chaos Group\V-Ray\3ds Max 2022\samples
- Execute CMake, e.g. cmake -B"C:\build\VRay3dsMax2022Samples" -H"." -G"Visual Studio 16 2019" -A"x64" -T"v142" -D"3DSMAX_SDK_ROOT=C:\conan\pack\Max2022SDK"
If no errors occurred, the solutions should be in the output directory specified by "-B".
The project files for the samples are in .dsp file format and need to be converted for newer versions of Visual Studio.
To build the samples for 3ds Max 2013 and later, follow these steps:
- Open the respective Visual Studio version that you need for the particular 3ds Max version (Visual Studio 2010 for 3ds Max 2013 and 3ds Max 2014, Visual Studio 2012 for 3ds Max 2015);
- Click File > Open > Project/solution... and select the .dsp file for the project that you want to compile;
- Visual Studio asks whether you want to upgrade the project. Click OK and let Visual Studio do the conversion;
- Right-click on the project in the Solution Explorer and select Properties;
- Click the Configuration Manager... button;
- Click the Active solution configuration dropdown and select <New...>;
- Type a name for the new configuration, i.e. "max 2013 release";
Set the Copy settings from dropdown to the Max Release Official configuration;
It is important to base the new configuration on the Max Release Official one; other configurations do not compile properly.
Make sure Create new project configurations is enabled;
- Click OK to create the new configuration;
- Click the Active solution platform dropdown and select <New...>;
- Select the x64 platform;
- In the Copy settings from dropdown, select Win32;
- Make sure that Create new project platforms option is selected;
- Click OK to add the new platform;
- In the General section of the configuration properties, set the Character Set property to Use Unicode Character Set (for 3ds Max 2012 and earlier, leave this to Use Multi-Byte Character Set);
- In the C/C++ section of the configuration, in the Addition Include Directories property, replace the occurrences of k:\3dsmax\maxsdk2013 with the path to your installation of the 3ds Max SDK;
- In the Linker section of the configuration, in the Additional Library Directories property, replace k:\3dsmax\max2014\Lib\x64 with the path to the library files from your installation of the 3ds Max SDK.
You should now be able to build the project successfully.