Skip to content

Commit

Permalink
MDL SDK 2018.1.1 (307800.2890)
Browse files Browse the repository at this point in the history
  • Loading branch information
lkettnerNV committed Sep 21, 2018
1 parent 2f1efb4 commit 4e688e0
Show file tree
Hide file tree
Showing 237 changed files with 11,681 additions and 6,226 deletions.
75 changes: 71 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,81 @@
Change Log
==========

MDL SDK 2018.1.1 (307800.2890): 15 Sep 2018
-----------------------------------------------

ABI compatible with the MDL SDK 2018.1.1 (307800.2890)
binary release (see [https://developer.nvidia.com/mdl-sdk](https://developer.nvidia.com/mdl-sdk))

**Added and Changed Features**

- General
- A new API function `mi::neuraylib::ILink_unit::add_material` has been added to
translate multiple distribution functions and expressions of a material at once.
- A new API function `mi::neuraylib::IMdl_backend::translate_material` has been added to
translate multiple distribution functions and expressions of a material at once.
- A new function `mi::neuraylib::ICompiled_material::get_connected_function_db_name`
has been added.
- A new function `IImage_api::create_mipmaps` has been added.
- A new parameter has been added to the functions `mi::neuraylib::ITarget_code::execute*`
to allow passing in user-defined texture access functions.

- MDL Compiler and Backends
- Diffuse EDFs can now be translated to PTX, native x86 and LLVM IR.
- Support for passing custom texture access functions has been added to the Native backend.
The built-in texture handler can be disabled via the new backend option
`"use_builtin_resource_handler"`.

- MDL SDK examples
- The `example_df_cuda` example now features simple path tracing inside the sphere to
enable rendering of transmitting BSDFs.
- To allow loading of multiple materials within a module, a wildcard suffix "*" is now
supported in the material name command line parameter of the `example_df_cuda` example.
- The `example_df_cuda` has been updated to illustrate the use of the new function
`mi::neuraylib::ILink_unit::add_material`.
- The `example_execution_native` has been extended to illustrate the use of user-defined
texture access functions.
- The `example_mdl_browser` can now be built on Mac OS.

**Fixed Bugs**

- General
- The handling of archives containing a single module has been fixed in the
`mi::neuraylib::IMdl_discovery_api`.
- The handling of relative search paths has been fixed in the
`mi::neuraylib::IMdl_discovery_api`.

- MDL Compiler and Backends
- Various fixes have been applied to the code generated for BSDF's:
- The computation of the `evaluate()` function for glossy refraction has been fixed
(`df::simple_glossy_bsdf, df::microfacet*`).
- The `sample()` functions for layering and mixing now properly compute the full PDF
including the non-selected components.
- The implementation of `df::color_clamped_mix()` has been fixed
(the PDF was incorrect and BSDFs potentially got skipped).
- All mixers now properly clamp weights to 0..1.
- Total internal reflection is now discarded for glossy BSDF
(`df::simple_glossy_bsdf`, `df::microfacet*`) with mode `df::scatter_transmit`,
as defined in the MDL specification.
- Incorrect code generation for `math::normalize()` with the atomic types `float` and
`double` has been fixed.
- The generation of function names for array index functions for modules in packages
has been fixed.
- In rare cases, compilation of a df* function could result in undeclared parameter names
(missing _param_X error), which has been fixed.
- The compilation of MDL presets of re-exported materials has been fixed.
- In rare cases, the original name of a preset was not computed, which has been fixed.


MDL SDK 2018.1 (307800.1800): 09 Aug 2018
-----------------------------------------------

- Initial open source release
- ABI compatible with the MDL SDK 2018.1 (307800.1800) binary release (see [https://developer.nvidia.com/mdl-sdk](https://developer.nvidia.com/mdl-sdk))
- The following features are only available in the binary release and excluded in the source code release:
- MDL distiller
- Texture baking (see *examples/mdl_sdk/execution_cuda* for example code for texture baking)
- GLSL compiler back end
- The following features are only available in the binary release and excluded in the
source code release:
- MDL distiller
- Texture baking (see *examples/mdl_sdk/execution_cuda* for example code for texture baking)
- GLSL compiler back end
- Added: MDL Core API, a lower-level compiler API in the MDL SDK (see *src/prod/lib/mdl_core* and *doc/mdl_coreapi*)
- Added: examples for the MDL Core API (see *examples/mdl_core* and *doc/mdl_coreapi*)
40 changes: 25 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,38 +25,40 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#*************************************************************************************************/

cmake_minimum_required(VERSION 3.9.6 FATAL_ERROR)

# MDL SDK build directories
set(MDL_BASE_FOLDER ${CMAKE_SOURCE_DIR} CACHE FILEPATH "The folder that contains the targets to build and the cmake utility scripts.")
set(MDL_INCLUDE_FOLDER ${CMAKE_SOURCE_DIR}/include CACHE FILEPATH "The folder that interface headers, i.e., mi/base, mi/neuray, ... directories.")
set(MDL_SRC_FOLDER ${CMAKE_SOURCE_DIR}/src CACHE FILEPATH "The folder that contains the sources, i.e., the base, io, mdl, ... directories.")
set(MDL_EXAMPLES_FOLDER ${CMAKE_SOURCE_DIR}/examples CACHE FILEPATH "The folder that contains the mdl examples")
# policies
if(POLICY CMP0025)
cmake_policy(SET CMP0025 NEW)
endif()

project(MDL LANGUAGES C CXX)


# MDL SDK build directories
set(MDL_BASE_FOLDER ${CMAKE_SOURCE_DIR} CACHE PATH "The folder that contains the targets to build and the cmake utility scripts.")
set(MDL_INCLUDE_FOLDER ${CMAKE_SOURCE_DIR}/include CACHE PATH "The folder that interface headers, i.e., mi/base, mi/neuray, ... directories.")
set(MDL_SRC_FOLDER ${CMAKE_SOURCE_DIR}/src CACHE PATH "The folder that contains the sources, i.e., the base, io, mdl, ... directories.")
set(MDL_EXAMPLES_FOLDER ${CMAKE_SOURCE_DIR}/examples CACHE PATH "The folder that contains the mdl examples")

#--------------------------------------------------------------------------------------------------
# configuration options
include(${MDL_BASE_FOLDER}/cmake/build_types.cmake) # defines possible build types and sets the default one

option(MDL_BUILD_SDK_EXAMPLES "Adds MDL SDK examples to the build." ON)
option(MDL_BUILD_CORE_EXAMPLES "Adds MDL Core examples to the build." ON)
option(MDL_LOG_PLATFORM_INFOS "Prints some infos about the current build system (relevant for error reports)." ON)
option(MDL_LOG_DEPENDENCIES "Prints the list of dependencies during the generation step." ON)
option(MDL_LOG_FILE_DEPENDENCIES "Prints the list of files that is copied after a successful build." ON)
set(MDL_ADDITIONAL_COMPILER_DEFINES "" CACHE STRING "Additional compile defines that are passed to each of the projects")
set(MDL_ADDITIONAL_COMPILER_OPTIONS "" CACHE STRING "Additional compile options that are passed to each of the projects")

# -------------------------------------------------------------------------------------------------
# general setup
include(${MDL_BASE_FOLDER}/cmake/toplevel_setup.cmake)
include(${MDL_BASE_FOLDER}/cmake/setup.cmake)

#--------------------------------------------------------------------------------------------------
# print system/build information for error reporting
include(${MDL_BASE_FOLDER}/cmake/log_platform_infos.cmake)
MESSAGE(STATUS "MDL_BUILD_SDK_EXAMPLES: " ${MDL_BUILD_SDK_EXAMPLES})
MESSAGE(STATUS "MDL_BUILD_CORE_EXAMPLES: " ${MDL_BUILD_CORE_EXAMPLES})
MESSAGE(STATUS "")
if(MDL_LOG_PLATFORM_INFOS)
MESSAGE(STATUS "[INFO] MDL_BUILD_SDK_EXAMPLES: " ${MDL_BUILD_SDK_EXAMPLES})
MESSAGE(STATUS "[INFO] MDL_BUILD_CORE_EXAMPLES: " ${MDL_BUILD_CORE_EXAMPLES})
endif()

# -------------------------------------------------------------------------------------------------
# presets and utility functions used in all CMakeLists
Expand All @@ -65,11 +67,16 @@ include(${MDL_BASE_FOLDER}/cmake/utilities.cmake)
#--------------------------------------------------------------------------------------------------
# list of modules in defined order

# PUBLIC HEADERS (for convenience in IDEs)
#--------------------------------------------------------------------------------------------------
add_subdirectory(${MDL_INCLUDE_FOLDER})

# MDL SDK and MDL CORE
#--------------------------------------------------------------------------------------------------

# first thing to build
add_subdirectory(${MDL_SRC_FOLDER}/base/system/main)
add_subdirectory(${MDL_SRC_FOLDER}/base/system/stlext)
add_subdirectory(${MDL_SRC_FOLDER}/base/system/version)

# third party
Expand All @@ -86,10 +93,13 @@ add_subdirectory(${MDL_SRC_FOLDER}/base/hal/hal)
add_subdirectory(${MDL_SRC_FOLDER}/base/hal/link)
add_subdirectory(${MDL_SRC_FOLDER}/base/hal/time)
add_subdirectory(${MDL_SRC_FOLDER}/base/lib/config)
add_subdirectory(${MDL_SRC_FOLDER}/base/lib/cont)
add_subdirectory(${MDL_SRC_FOLDER}/base/lib/log)
add_subdirectory(${MDL_SRC_FOLDER}/base/lib/mem)
add_subdirectory(${MDL_SRC_FOLDER}/base/lib/path)
add_subdirectory(${MDL_SRC_FOLDER}/base/lib/plug)
add_subdirectory(${MDL_SRC_FOLDER}/base/data/attr)
add_subdirectory(${MDL_SRC_FOLDER}/base/data/db)
add_subdirectory(${MDL_SRC_FOLDER}/base/data/dblight)
add_subdirectory(${MDL_SRC_FOLDER}/base/data/serial)
add_subdirectory(${MDL_SRC_FOLDER}/io/image)
Expand Down
124 changes: 99 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,19 @@ The binary release is different in some functionality as documented in the
[Change Log](CHANGELOG.md).


## Support

- [NVIDIA MDL SDK Forum](https://devtalk.nvidia.com/default/board/253/mdl-sdk/)


## Building the MDL SDK from Source

MDL uses [CMake](http://www.cmake.org/) to generate build files for a
particular development environment. It is suggested to use CMake 3.11 or later,
which can be downloaded from the [CMake Website](https://cmake.org/download/).
When using a Unix-like system, you can install the *cmake* package using
the respective package management systems.
the respective package management systems. On the Mac OS X platform, third party
dependencies can be resolved using the [Homebrew Package Manager](https://brew.sh/index_de).


### Dependencies
Expand All @@ -68,8 +74,7 @@ successfully tested:

- **Windows 10:** Microsoft Visual Studio 2015 (msvc v140)
- **Ubuntu 18.04:** gcc/g++6 and gcc/g++7

**Note:** Mac OS X is not yet supported
- **Mac OS X 10.13:** Xcode 8.3.3 (Apple Clang 8.1)

The versions listed with the following dependencies have been
successfully tested. Where not mentioned otherwise, other versions
Expand All @@ -82,15 +87,17 @@ The following third-party libraries are required to build the MDL SDK:
Linux: Install the *libboost-dev* package.
Windows: Download and extract the boost source code from
[boost.org](https://www.boost.org/users/download/).
Mac OS X: Install the *boost* package using brew.

- **FreeImage** *(3.17.0)*
Linux: Install the *libfreeimage-dev* package.
Windows: Download and extract the pre-compiled binaries from
[freeimage.sourceforge.net](http://freeimage.sourceforge.net/download.html).
[freeimage.sourceforge.net](http://freeimage.sourceforge.net/download.html).
Mac OS X: Install the *freeimage* package using brew.

- **Python2** *(2.7.1)*
Linux: Install the *python* package.
Windows: Download and install Python 2.7 from
Windows and Max OS X: Download and install Python 2.7 from
[python.org](https://www.python.org/downloads/).

- **Clang 3.4.1**
Expand All @@ -104,12 +111,14 @@ libraries. These additional libraries are:
- **GLEW** *(2.1.0)*
Linux: Install the *libglew-dev* package.
Windows: Download and extract the pre-compiled binaries from
[glew.sourceforge.net](http://glew.sourceforge.net/).
[glew.sourceforge.net](http://glew.sourceforge.net/).
Mac OS X: Install the *glew* package using brew.

- **GLFW** *(3.2.1)*
Linux: Install the *libglfw3-dev* package.
Windows: Download and extract the pre-compiled x64 binaries from
[glfw.org](http://www.glfw.org/download.html).
[glfw.org](http://www.glfw.org/download.html).
Mac OS X: Install the *glfw* package using brew.

- **NVIDIA CUDA Toolkit** *(9.0 or 9.2)*
Please follow the instructions on the
Expand Down Expand Up @@ -187,7 +196,7 @@ Required tools to build the documentation:
- **python_PATH** in Ungrouped Entries (only of not found in the PATH),
for example: *C:/projects/thirdparty/python_2_7_1/bin/python.exe*

- **Qt5_DIR** in Ungrouped Entries (only if not installed using the installer),
- **Qt5_DIR** in Ungrouped Entries,
for example: *C:/Qt/5.10.1/msvc2015_64*

6. When all dependencies have been resolved or the corresponding examples
Expand All @@ -202,12 +211,24 @@ Required tools to build the documentation:
directory.

7. Use Visual Studio to build the MDL SDK library, MDL Core library,
and the examples. You can run the examples by double-clicking the
executable in the build directories or by using the command line,
which allows you to provide additional arguments. When running the
examples using the Visual Studio debugger, you can provide additional
arguments by specifying them in the individual Visual Studio project
settings.
and the examples. When running the examples using the Visual Studio debugger,
you can provide additional command line arguments by specifying them in the
individual Visual Studio project settings.

You can find the example binaries in the corresponding subfolders in *build/examples*.
To run the examples by double-clicking the executable in the build directories
or by using the command line, you need to add the location of the built libraries and
plugins to your environment PATH or copy them into the corresponding example
binary folder.

For the *mdl_sdk* examples, you need *libmdl_sdk.dll* from
*build/src/prod/lib/mdl_sdk* and additionally,
*freeimage.dll* and *nv_freeimage.dll* from
*build/src/shaders/plugin/freeimage*.

For the *mdl_core* examples, you need *libmdl_core.dll* from
*build/src/prod/lib/mdl_core* and the *freeimage.dll* from
*build/src/shaders/plugin/freeimage* or your third-party downloads.


### Building on Linux
Expand Down Expand Up @@ -346,7 +367,7 @@ Required tools to build the documentation:
the image plugins using the `LD_LIBRARAY_PATH` variable:

```bash
export LD_LIBRARY_PATH=~/projects/mdl-sdk/build/linux-x64-gcc7/src/prod/lib/mdl_sdk:~/projects/mdl-sdk/build/linux-x64-gcc7/src/prod/lib/mdl_core:~/projects/mdl-sdk/build/linux-x64-gcc7/src/shaders/plugin/freeimage:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH=~/projects/mdl-sdk/build/linux-x64-gcc7/src/prod/lib/mdl_sdk:~/projects/mdl-sdk/build/linux-x64-gcc7/src/prod/lib/mdl_core:~/projects/mdl-sdk/build/linux-x64-gcc7/src/shaders/plugin/freeimage${LD_LIBRARAY_PATH:+:${LD_LIBRARAY_PATH}}
```

For example, to run the MDL SDK modules example, use:
Expand All @@ -356,6 +377,58 @@ Required tools to build the documentation:
./mdl_sdk_example-modules
```

### Building on Mac OS X

1. Before generating make files, you need to install the required
tools and libraries as listed [above](#thirdparty-dependencies-libs).

Please note that the build requires clang 3.4.1, which is no
longer available through the package manager. Please download the
binary as described [above](#thirdparty-dependencies-libs). In
the following, it is assumed that it has been extracted to:

~/projects/thirdparty/clang+llvm-3.4.1-x86_64-apple-darwin10.9/bin/clang

2. Depending on your workflow, you can use CMake-Gui and follow the [Windows instructions](#building-on-windows)
or use the command line as described in the [Linux section](#building-on-linux).
In each case, begin with step 2 of the respective instructions.

If the brew packages, Python 2.7, CUDA, and Qt have been installed correctly,
the following CMake options need to be specified:

- **clang_PATH** in Ungrouped Entries,
for example: *~/projects/thirdparty/clang+llvm-3.4.1-x86_64-apple-darwin10.9/bin/clang*

- **python_PATH** in Ungrouped Entries (only of not found in the PATH),
for example: */usr/bin/python*

- **Qt5_DIR** in Ungrouped Entries,
for example: *~/Qt/5.10.1/clang_64*


3. After successfully configuring and generating make files, switch to the selected build directory and run make:

```bash
cd ~/projects/mdl-sdk/build/macosx-x64-clang810
make -j8
```

4. Because the different MDL SDK libraries are loaded at runtime, their
location has to be provided in order to run an example. Therefore,
specify the paths to the built MDL SDK library, MDL Core library, and
the image plugins using the `DYLD_LIBRARAY_PATH` variable:

```bash
export Qt5_DIR=~/Qt/5.10.1/clang_64
export DYLD_LIBRARAY_PATH=~/projects/mdl-sdk/build/macosx-x64-clang810/src/prod/lib/mdl_sdk:~/projects/mdl-sdk/build/macosx-x64-clang810/src/prod/lib/mdl_core:~/projects/mdl-sdk/build/macosx-x64-clang810/src/shaders/plugin/freeimage:${Qt5_DIR}/lib:${Qt5_DIR}/plugins/imageformats${DYLD_LIBRARAY_PATH:+:${DYLD_LIBRARAY_PATH}}
```

For example, to run the MDL SDK modules example, use:

```bash
cd ~/projects/mdl-sdk/build/macosx-x64-clang810/examples/mdl_sdk/modules
./mdl_sdk_example-modules
```

### Additional CMake Options

Expand Down Expand Up @@ -463,17 +536,18 @@ A start page that links all documents can be found in the doc directory:

The NVIDIA MDL SDK repository consists of the following directories and files:

include/ - C++ API header files
examples/ - example programs and MDL files
src/ - source code for the SDK libraries
doc/ - API documentation, MDL specification,
core_definitions.mdl and base.mdl documentation
cmake/ - support files for the CMAKE build system
include/ - C++ API header files
examples/ - example programs and MDL files
src/ - source code for the SDK libraries
doc/ - API documentation, MDL specification,
core_definitions.mdl and base.mdl documentation
cmake/ - support files for the CMAKE build system

README.md - this file: introduction and build instructions
CHANGELOG.md - change log and difference to the binary MDL SDK release
LICENSE.md - license for the MDL SDK and references to
third-party licenses
README.md - this file: introduction and build instructions
CHANGELOG.md - change log and difference to the binary MDL SDK release
LICENSE.md - license for the MDL SDK and references to
third-party licenses
CMakeLists.txt - top level CMAKE file


## Additional Resources
Expand Down
12 changes: 0 additions & 12 deletions cmake/build_types.cmake

This file was deleted.

Loading

0 comments on commit 4e688e0

Please sign in to comment.