Announcement: MDL SDK 2019.1 released, HLSL support and DXR example, MDL 1.5

Get the update on https://developer.nvidia.com/mdl-sdk and https://github.com/NVIDIA/MDL-SDK

Changes compared to previous version (excerpt from the full release notes shipped with the SDK):

MDL SDK 2019.1, build 317500.1752
Added and Changed Features
MDL 1.5 Language Specification

  • The draft status of the document has been removed.
  • Annotations have been added to annotation declarations.
  • A new standard annotation origin() has been added, which is used in the MDLE file format to reference the original declarations of refactored elements.

General

  • A new function IMdle api::get hash() has been added.
  • A new function IMdl compiler::get module db name() has been added.
  • MDLE files now use the new anno::origin annotation rather than a custom one.
  • The MDLE file format version has been bumped to 1.0.
  • A new interface mi::neuraylib::IValue string localized has been added.

MDL Compiler and Backends

  • The following MDL 1.5 features are now supported by the MDL compiler:
    • hair bsdf() type
    • df::chiang hair bsdf()
    • anno::origin annotation
    • support for annotations on annotation declarations
  • The backends were upgraded to use the LLVM 7 library. This means, that the LLVM-IR backend now produces LLVM 7 IR code.
  • Allow generating code for bsdf() if "compile constants" options is "on" (default).
  • Support for (color )measured curve layer has been added to the HLSL backend.
  • Global constants are only stored in the read-only segment for HLSL, when they are larger than 1kB (as for the other backends).

MDL SDK examples

  • Support for thin-walled materials has been added to example df cuda and example dxr.
  • Support for relative scene and environment map paths has been added to example dxr.

Fixed Bugs
General

  • Failing MDLE creation when an argument of the MDLE prototype is connected to a function which returns a user-defined type has been fixed.
  • A bug leading to different output (and therefore different hashes) when exporting the same MDLE more than once has been fixed.
  • A failure (error code -8) when creating presets from functions with user-defined return types has been fixed.
  • A failure (error code -8) when creating function presets from MDL modules with versions < 1.3 has been fixed.
  • When exporting presets from MDLE definitions or MDL definitions containing calls to MDLE definitions in their arguments, the MDLE code is now inlined into the new module, rather than resulting in invalid MDL.
  • The missing origin annotation on the main definition of an MDLE file has been added.
  • Issues resolving MDLE files on UNC file paths have been fixed.

MDL Compiler and Backends

  • JIT compilation of cast operators has been fixed.
  • Native code execution on Mac has been fixed.
  • Struct member access for MDLE types containing a dot in their file path has been fixed.

MDL SDK 2019.1 Beta, build 317500.683
MDL 1.5 Language Specification
Added and Changed Features

  • A new cast operator has been added to support assignments between structurally equivalent user defined structure types and value equivalent enumeration types to support workflows with the new MDLE format. Beginning with MDL 1.5, cast is a reserved word.
  • A new field named hair of type hair bsdf has been added to the material type, which represents the shading model applicable for hair primitives. Beginning with MDL 1.5, hair bsdf is a reserved word.
  • Anew elemental distribution function df::chiang hair bsdf has been added as a hair shading model.
  • A new distribution function modifier df::measured factor has been added to support microfacet coloring based on the angle between the half-vector and the shading normal in addition to the angle between the half-vector and the incoming ray direction.
  • The new Appendix D– MDLE File Format defines a new container format for a self contained MDL material or function including all of its dependencies and resources.
  • The new Appendix E – Internationalization defines the use of XLIFF files for the localization of MDL string annotations.

General

  • A new function IType factory::is compatible() has been added to check if one MDL type can be cast to another.
  • A new function IExpression factory::create cast() has been added.
  • A new configuration interface IMdl configuration has been added, which can be used to control the behavior of the SDK regarding the automatic insertion of casts when assigning compatible but different types to arguments of MDL instances.
  • The IMdl discovery api has been extended to also support discovery of resources and XLIFF files.

MDL Compiler and Backends

  • A new backend mi::neuraylib::IMdl compiler::MB HLSL for HLSL code generation has been added. Please refer to the execution hlsl and demo rtx examples for examples on how to use it.
  • The CUDA/OptiX backend expects some new functions in the user provided renderer runtime to allow using resources unknown at compile-time via argument blocks with class compilation:
    • bool tex texture isvalid(Texture handler base const *self, tct uint texture idx)
    • void tex resolution 3d(int result[3], Texture handler base const *self, tct uint texture idx)
    • bool df light profile isvalid(Texture handler base const *self, tct uint resource idx)
    • tct float df light profile power(Texture handler base const *self, tct uint resource idx)
    • tct float df light profile maximum(Texture handler base const *self, tct uint resource idx)
    • bool df bsdf measurement isvalid(Texture handler base const *self, tct uint resource idx)

    The tex resolution 3d() function fills the width, height and depth for the given texture index
    into the respective result entry. The other functions are implementations for the corresponding
    MDL functions. See examples/mdl sdk/shared/texture support cuda.h for an example
    implementation.

  • The compiler support for the ternary operator on material and material sub types has been improved. Several materials that caused compile errors before are now compiled flawless.
  • The MDL compiler now correctly issues an error when the called object is not a function, detecting (wrong) code like f()().
  • The compiler generated now correct MDL code when exporting functions containing a dangling if construct.
  • The compiler now (correctly) forbids the use of resource types as parameter types in annotations.
  • The PTX backend does not use global counters to generate temporary identifiers anymore, this greatly improves PTX cache hits.

MDL Distiller and Baker

  • The Baker can now bake boolean constants right on the GPU.

MDL SDK examples

  • A new Direct3D 12 example demo rtx has been added which illustrates how to use the HLSL backend in an RTX-based real-time path tracer.

Fixed Bugs
General

  • Missing imports for user-defined function return types which caused MDLE creation to fail, have been added.
  • The handling of conversion operators and constructors when creating MDL AST expressions has been fixed.
  • The conversion of array constructors to MDL AST expressions has been fixed.
  • The use of implicit conversion functions inside enableif expressions is no longer forbidden.

MDL Compiler and Backends

  • Unnecessarily slow code generation for very big output has been fixed.
  • Wrong code generation for df::bsdf measurement isvalid() has been fixed.
  • Creating DAG call nodes for ternary operators returning non-builtin types has been fixed.
  • For the native and PTX backends, wrong order of array elements returned by math::modf() has been fixed.

Github is now updated too
cheers
Jan