Releases: NVIDIA/MDL-SDK
MDL SDK 2021.1.1 (349500.8264): 18 Mar 2022
ABI compatible with the MDL SDK 2021.1.1 (349500.8264) binary release
(see https://developer.nvidia.com/mdl-sdk)
Known Issues
- The version text in the MI_NEURAYLIB_PRODUCT_VERSION_STRING macro
in the version.h include file contains the previous version number
of "2021.1" instead of "2021.1.1".
Added and Changed Features
-
Image File Format Plugins
- Support .rgb extension for textures in the SGI file format.
Fixed Bugs
-
General
- Fixed filename extension mismatch when exporting textures referenced from MDL modules.
Under certain circumstances, the texture was copied, but got a different filename extension,
causing problems importing the MDL module again. - Fixed creation of function calls of the cast operator if the target type has frequency
qualifiers. Similarly, fixed creation of function calls of the ternary operator if the
argument types have frequency qualifiers. - Fixed handling of memory allocation failures in
IImage_api::create_canvas()/create_tile()
methods. - Also encode the simple name of function definitions. For almost all functions this does not
make any change since the simple name is usually an identifier, except for a couple of
operators from the builtins module.
- Fixed filename extension mismatch when exporting textures referenced from MDL modules.
-
MDL Compiler and Backends
- libbsdf: Fixed incorrect child normal orientation usage in
df::(color_)fresnel_layer
,
df::(color_)custom_curve_layer
anddf::(color_)measured_curve_layer
for backside hits. - HLSL backend: Fixed code generation for scene data access functions inside automatically
derived expressions.
- libbsdf: Fixed incorrect child normal orientation usage in
MDL SDK 2021.1 (349500.7063): 18 Jan 2022
ABI compatible with the MDL SDK 2021.1 (349500.7063) binary release
(see https://developer.nvidia.com/mdl-sdk)
Added and Changed Features
-
MDL 1.7 Language Specification
-
Removed the draft status of this document.
-
Clarified that constants can be declared locally as well, which is
working since MDL 1.0. -
Clarified that the
thin_film
modifier applies only to
directly connected BSDFs that have a Fresnel term. -
Clarified that the
state::normal()
orientation is
facing outward from the volume, with thin-walled materials
treated as enclosing an infinitesimally thin volume, such that
both sides are facing outward and the normal always points to the
observer.
-
-
General
- The module
::core_definitions
requires now MDL 1.6 and contains a new material
surface_falloff
. - Added support for texture selectors. The selector can be queried with methods on
IImage
,
ITexture
,IVolume_data
,IValue_texture
, andITarget_code
. For non-volume data
textures, the supported selectors are restricted to"R"
,"G"
,"B"
, and"A"
for now. - Renamed
IVolume_data::get_channel_name()
toIVolume_data::get_selector()
for consistency
withIImage
andITexture
. The old method is still available if
MI_NEURAYLIB_DEPRECATED_12_1
is defined. - The signature of
IMdl_factory::create_texture()
has been extended to specify the selector.
The old signature is deprecated and still available ifMI_NEURAYLIB_DEPRECATED_12_1
is
defined. - Added
IImage_api::create_canvas_from_reader()
to enable canvas creation directly from a
reader (in addition tocreate_canvas_from_buffer()
). - Added the methods
get_pixel_type_for_channel()
andextract_channel()
toIImage_api
,
which are useful for extracting RGBA channels from existing textures. - Added a warning to catch some wrong implementations of
IMdl_resolved_module::get_module_name()
. - Improved resource enumeration on modules. The new method
IModule::get_resource()
returns
anIValue_resource
with all details, including gamma mode and selector. The old methods
returning the individual bits are deprecated and still available if
MI_NEURAYLIB_DEPRECATED_12_1
is defined. - Added overloads of
IValue_factory::create()
that accept a range annotation as argument, and
a type and an entire annotation block. This makes it simpler to create values that observe
range annotations. ModifiedDefinition_wrapper
to make use of the latter if a parameter has
no default. - Added
IFunction_call::reset_argument()
which sets an argument back to the parameter default
(if present), or an value observing given range annotations, or a default-constructed value. - Extended
IValue_factory::compare()
andIExpression_factory::compare()
to support floating
point comparisons with an optional epsilon range. - The materials-are-functions feature is now enabled by default. See the documentation
referenced fromIMdl_configuration::set_materials_are_functions()
. All examples have been
updated to avoid usage ofIMaterial_definition
completely, andIMaterial_instance
as much
as possible. - Added an
user_data
option to theIMdl_execution_context
, which allows the user to pass
its own interface pointer around, in particular to the methods ofIMdl_entity_resolver
. - Improved performance of editing of instances of
IMdl_function_call
, in particular for
instances with a large set of arguments. Depending on the exact circumstances, this can cut
the time for a full edit cycle (create transaction, create argument editor, change argument,
destroy argument editor, commit transaction) in half. An additional speedup can be obtained
by making use of the additional optional argument ofArgument_editor
. - Extended
IExpression_factory::compare()
to support deep comparisons of call expressions.
Useful to figure out whether an exporter needs to export an argument, or can rely on the
corresponding default on the definition. - Export to EXR takes now the quality parameter into account: a value of 50 or less selects
half
as channel type. - Added
create_reader()
andcreate_writer()
toIMdl_impexp_api
. - Changed the behavior of
IImage_api::adjust_gamma()
to include the alpha channel. This also
affects export operations (ifforce_default_gamma
is set) and the MDL texture runtime if
derivatives are enabled. - Added an implementation variant based on
std::atomic_uint32_t
toAtom32
. This results
in a large speedup on ARM, and on a rather small speedup on Windows. - Added support for animated textures:
- The signature of various methods on
IImage
andITexture
has been changed. The frame
index has been added as first parameter and the order of uvtile index and mipmap level
has been flipped. The default arguments have been removed. The old signatures are still
available ifMI_NEURAYLIB_DEPRECATED_12_1
is defined. Methods to query the mapping
between frame index and frame number have been added. - The method
uvtile_marker_to_string()
onIMdl_impexp_api
andIExport_api
has been
renamed toframe_uvtile_marker_to_string()
. It is still available under the old name if
MI_NEURAYLIB_DEPRECATED_12_1
is defined. The methoduvtile_string_to_marker()
on both
interfaces has been deprecated without replacement. The last component of
IImage::get_original_filename()
is an alternative (if available), or construct a custom
string from scratch. - The interface
IMdl_resolved_resource
has been split such that it represents an array of
instances of the new interfaceIMdl_resolved_resource_element
, where each element
corresponds to a texture frame (only one for non-animated textures and other resources). - The frame parameter has been added to various method of the runtime interfaces
Texture_handler_vtable
andTexture_handler_deriv_vtable
. A new memberm_tex_frame
to support the intrinsicstex::first_frame()
andtex::last_frame()
has been added. - The examples "DF Native", "DXR", and "Execution Native" have been extended accordingly.
- The signature of various methods on
- Added an overload of
IMdl_factory::clone()
that allows cloning of an execution context.
Useful for local changes to the context options. - Disabled WEBP export in the FreeImage plugin due to memory access violations.
- Changed
mi::math::gamma_correction()
to include the alpha channel, as it is done already in
other places.
- The module
-
MDL Compiler and Backends
- Added support for libbsdf normal adaption for CUDA and native runtime. The
--an
option for
thedf_cuda
anddf_native
examples demonstrates the feature (the dummy implementation
does not change the normal, though). - The libbsdf implementations of the functions
df::diffuse_reflection_bsdf
and
df::diffuse_transmission_bsdf
now compensate for energy loss caused by differences of
shading and geometric normal. - Added frame sequences resolution using frame markers in resources to the MDL core compiler.
- Added an error message to the JIT backend that is issued if the user specifies
a state module that does not contain all necessary functions. - Removed a redundant call to the entity resolver in the MDL core compiler when
importing modules.
- Added support for libbsdf normal adaption for CUDA and native runtime. The
-
MDL SDK examples
- Examples Shared
- All examples load now the
dds
plugin by default.
- All examples load now the
- Example DF Native
- Added support for custom texture runtime.
- Example DXR
- Added a new dependency to the DirectX Shader Compiler, which is optional for Windows SDK
10.0.20348.0 and later. - Write a memory dump file in case an application crash occurs.
- Added support for the glTF extension
"KHR_materials_emissive_strength"
to
the example renderer and to the MDL support module.
- Added a new dependency to the DirectX Shader Compiler, which is optional for Windows SDK
- Example Python Bindings
- Added many more interface to the Python bindings, e.g.,
IBaker
,ICanvas
,
ICompiled_material
,IImage_api
,IMdl_Module_builder
,
IPlugin_configuration
, andITile
, and extended the examples.
- Added many more interface to the Python bindings, e.g.,
- Examples Shared
Fixed Bugs
-
General
- Fixed a bug in mdlm and i18n if the environment variable
HOME
is not set. - Fixed a bug in i18n which caused command MDL search paths other than
"SYSTEM"
and"USER"
to get ignored. - Fixed
IFactory::clone()
when dealing with untyped arrays. - Fixed
IMdl_backend::deserialize_target_code()
such that the internal DF texture are no
longer missing under certain circumstances. - Fixed handling of weak imports for MDL < 1.6 if an external entity resolver is set. The
semantic of weak imports is now handled by the core compiler itself, an external entity
resolver sees now only absolute or strictly relative module names. - Fixed
ICompiled_material::get_hash()
to take the material slots forsurface.emission.mode
andbackface.emission.mode
into account. Added enumeratorsSLOT_SURFACE_EMISSION_MODE
and
SLOT_BACKFACE_EMISSION_MODE
tomi::neuraylib::Material_slot
. Also addedSLOT_FIRST
and
SLOT_LAST
to support easier enumeration over all material slots. - Fixed a crash with default constructed BSDF measurements during MDL export/MDLE creation.
- Fixed gamma value of pink 1x1 default textures.
- Fixed a race condition for accessing global core JIT backend options from
dif...
- Fixed a bug in mdlm and i18n if the environment variable
MDL SDK 2021.0.4 (344800.9767): 26 Nov 2021
ABI compatible with the MDL SDK 2021.0.4 (344800.9767) binary release
(see https://developer.nvidia.com/mdl-sdk)
Fixed Bugs
-
General
- Fixed incorrect handling of user-defined type names for structs and enums
when encoded names were enabled.
- Fixed incorrect handling of user-defined type names for structs and enums
-
MDL Compiler and Backends
- Fixed non-deterministic behavior with
sincos
calls.
- Fixed non-deterministic behavior with
MDL SDK 2021.0.2 (344800.7839): 07 Oct 2021
ABI compatible with the MDL SDK 2021.0.2 (344800.7839) binary release
(see https://developer.nvidia.com/mdl-sdk)
Added and Changed Features
-
MDL SDK examples
- Example DXR
- Added support for various glTF extensions to the example renderer and the MDL support
module. The new supported extensions are:KHR_texture_transform
,
KHR_materials_transmission
,KHR_materials_sheen
,KHR_materials_specular
,
KHR_materials_ior
, andKHR_materials_volume
. - Added support for
state::animation_time()
when the animation mode is enabled in the
renderer settings. - Added support for volume attenuation to the renderer.
- Update MaterialX dependency to version 1.38.1.
- Added support for various glTF extensions to the example renderer and the MDL support
- Example DXR
Fixed Bugs
-
MDL Compiler and Backends
- Fixed incorrect BSDF evaluation for
df::sheen_bsdf
with a transmitting"multiscatter"
BSDF parameter. - Fixed
df::thin_film
implementation for the case material IOR < thin film IOR
(libbsdf). - Creation of compiled materials fails now (instead of crashing) if some internal error
condition is detected.
- Fixed incorrect BSDF evaluation for
-
MDL SDK examples
- Example DXR
- Fixed the UV coordinate transformations to match the glTF specification. Now the
V-coordinate is simply flipped by applying v = 1.0f - v to improve UDIM support. - Metallic-roughness texture lookups are fixed and will now be handled strict to the glTF
specification.
- Fixed the UV coordinate transformations to match the glTF specification. Now the
- Example DXR
MDL SDK 2021.0.1 (344800.4174): 17 Aug 2021
ABI compatible with the MDL SDK 2021.0.1 (344800.4174) binary release
(see https://developer.nvidia.com/mdl-sdk)
Added and Changed Features
-
General
- Reduced memory usage for DDS textures with subformat BC7.
- Added a new execution context option "warning" to silence compiler warnings or to promote
them to errors. SeeIMdl_execution_context
for details. - Disabled warnings for deprecated MDL materials and functions by default.
-
MDL Compiler and Backends
- Reduced compilation times.
- Updated
nvidia::core_definitions
with new functionality.
-
MDL SDK examples
- Example Code Generation
- Added an option to set number of texture result slots.
- Example Code Generation
Fixed Bugs
-
MDL Compiler and Backends
- Fixed handling of
nvidia::baking
annotations. - Fixed lambda results handling in single-init mode for non-HLSL.
- Fixed uncomputed cosine in
sheen_bsdf
's multiscatter (was broken for a
transmitting multiscatter component, libbsdf). - Improved numerical stability in
base::coordinate_projection
. - Fixed missing
color_weighted_layer()
inside the transmission analysis. - Fixed thin film factor implementation (libbsdf).
- Fixed handling of
MDL SDK 2021 (344800.2052): 01 Jun 2021
ABI compatible with the MDL SDK 2021.0 (344800.2052) binary release
(see https://developer.nvidia.com/mdl-sdk)
Added and Changed Features
-
MDL 1.7 Language Specification
- OpenVDB has been added as supported 3D texture format.
- Minimum required versions have been added for OpenEXR, Ptex, and OpenVDB to conform to the
VFX Reference Platform CY2021. - Supported texture selector string values have been added for each supported texture format.
- Texture sequences with a sequence marker have been added to the definition of texture file
paths. - The
auto
placeholder type specifier has been added for variable declarations and function
return types. - The
float
type is required to use a 32-bit representation following the IEEE 754 single
precision standard. Floating point operations forfloat
anddouble
may deviate but shall
not interrupt nor terminate processing. - The
int
type is required to be a 32-bit signed integer in two's complement form with
wrap-around operations and without exceptions. - The restrictions on the texture types, light profile data type, and measured BSDF data type
have been removed. They can now be used for local variable types, return types, field types
in user defined structures, and element type of arrays. - A selector string parameter has been added to the
texture_2d
andtexture_3d
constructors
to support texture formats with multiple data sets and channels in a file. Theanno::usage
standard annotation can be used on texture parameters to pre-select selector values in an
integration. - The operators
=
,==
, and!=
have been added for the texture types, light profile data
type, and measured BSDF data type. - Emission has been added to the volumetric material properties.
- The return type of a material definition can have an annotation.
- The description of various standard annotations, like
in_group
andui_order
, mention
their wider applicability to more elements in MDL. - The
usage
standard annotation on materials is recommended to be used on the return type and
not the material definition to match the recommendation for function declarations. - The hyperbolic trigonometric functions
cosh
,sinh
, andtanh
have been added to the
standard math library. - The offset functions
width_offset
,height_offset
, anddepth_offset
have been added to
give full access to OpenVDB bounding box information. - The functions
first_frame
andlast_frame
have been added to give access to the texture
animation bounds. - The transform function
grid_to_object_space
has been added to give access to OpenVDB
bounding box information in MDL object space. - A
frame
parameter has been added to thewidth
,height
,depth
,width_offset
,
height_offset
,depth_offset
, andgrid_to_object_space
texture functions to select frames
in texture sequences. - A
frame
parameter has been added to thetexture_2d
andtexture_3d
variants of the
lookup_
ltype andtexel_
ltype family of texture function overloads to select
frames in texture sequences. - The uniform modifier has been removed from the
tint
parameter of the EDFtint
modifier. - The VDF
tint
modifier has been added. - An overloaded variant of the
directional_factor
modifier has been added for EDFs. - The
sheen_bsdf
has been changed to a modifier by adding a BSDFmultiscatter
parameter. - The uniform modifier has been removed from the
weight
field of theedf_component
and
color_edf_component
structures and the upper limit has been removed for the weight. - The
color_vdf_component
structure and VDF overloads for thecolor_normalized_mix
and
color_clamped_mix
mixing distribution functions have been added. - The mix distribution functions
unbounded_mix
andcolor_unbounded_mix
have been added for
BSDF, EDF, and VDF. - An Appendix F has been added defining MDL search path conventions.
-
General
- The MDL SDK now also supports the ARM platform on Linux (
aarch64-linux-gnu
). - This release changes the naming convention used for the DB elements of modules, material
definitions, and function definitions. This is necessary to avoid problems that exist with
the old naming scheme when names contain certain meta-characters. See
IMdl_configuration::set_encoded_names_enabled()
for details. This feature is enabled by
default. - Added the new interface
IMdl_module_builder
which allows incremental building of new MDL
modules, as well as editing of existing MDL modules. This interface allows the definition of
new struct and enum types, and of new functions and materials (including variants). It also
supports references to previous entities from the same module, explicit control of frequency
modifiers for parameters, and parameters without defaults. An entity can also be removed from
a module (if that entity is unreferenced). The new interface can be obtained from
IMdl_factory::create_module_builder()
. See also the newcreate_module
example. The method
IMdl_factory::create_variants()
is deprecated and still available if
MI_NEURAYLIB_DEPRECATED_12_0
is defined. - The API can be configured to treat materials as if they are simply functions with the return
typematerial
. This means interfaces likeIFunction_definition
andIFunction_call
can
also be used for materials. SeeIMdl_configuration::set_materials_are_functions()
for
details. This feature is disabled by default. It will be enabled by default in a future
release. - The new method
IMdl_factory::uniform_analysis()
allows to check theuniform
property of
an expression graph. - Improved performance for loading of MDL modules, in particular parallel loading of modules,
and reloading of modules. - Added
force_default_gamma
parameter toIMdl_impexp_api::export_canvas()
and
IExport_api::export_canvas()
to perform an automatic gamma adjustment based on the pixel
type chosen for export. - The implementation of
IFunction_definition::get_thumbnail()
and
IMaterial_definition::get_thumbnail()
has been changed to compute the value lazily on
demand. - The system locale used in methods of
IMdl_i18n_configuration
is restricted to two-letter
strings to follow ISO 639-1. - Reduced lock scope during MDL module loading. This avoids callbacks to the entity resolver
and related interfaces while holding this lock. - Added
get_mdl_parameter_type_name()
,get_return_type()
andget_semantic()
on
IMaterial_definition
for consistency with function definition. Likewise, added
get_return_type()
onIMaterial_instance
. - Added
IMdl_impexp_api::get_mdl_module_name()
to obtain the MDL module name for a module
identified by its file name. - Added
IType_factory::clone()
for type lists. - Made log messages from plugins available.
- Updated recommended version numbers and use C++ 17 to meet the requirements for the VFX
reference platform 2021. - A Python binding for the MDL SDK has been added. This binding consists of a shared library
generated from the API headers using SWIG, and some additional helper functions for ease of
use. In addition, there is a stub Python module to make that shared library accessible from
Python code. See "Language Bindings" in the API reference for more information. Examples to
demonstrate working with the Python binding are included as well. - In the API, the array constructor now uses --as all other function definitions-- named
arguments instead of positional arguments. The previously irrelevant parameter names are now
enforced to be "0", "1", and so on. - Added support for the "target model" compilation mode.
- Added a context option
"remove_dead_parameters"
to control the removal of dead
parameter in instances ofICompiled_materials
. Dead parameters only survive if this
options is set (enabled by default). Setting it tofalse
produces a compatible argument
block layout independent of the target material mode. - Reduced the verbosity of the
cmake
configuration output.
- The MDL SDK now also supports the ARM platform on Linux (
-
MDL Compiler and Backends
- Added support for MDL 1.7.
- The MDL compiler warns now if a literal value would loose precision in a implicit (or
explicit) conversion. - Improved half vector computation for custom-curve/measured-curve layering: assume refraction
for non-thin-walled materials to loose less energy for non-physical glass materials
constructed from separate BRDF and BTDF. - Protect custom-curve evaluations against cosines > 1 to avoid numerical corner cases.
- Fixed textures with different gamma modes being reported as one texture in
ITarget_code
,
when resource resolving was disabled. - Restricted several annotations to real functions (i.e. not materials):
intrinsic()
,throws()
,const_expr()
,noinline()
. - Slightly improved generated HLSL code: the HLSL optimizer can now fold constructions like
vector3(a.x, a.y, a.z)
intoa
. - Added support for backend option
use_renderer_adapt_normal
to HLSL backend. - Improved speed of the DAG compiler computing material hashes.
- Added some mathematical identities for math functions in the DAG optimizer.
- Allowed annotation
ui_order()
on functions and materials. IMdl_backend::translate_environment()
accepts now a function that returns a
...
MDL SDK 2020.1.2 (334300.5582): 12 Nov 2020
ABI compatible with the MDL SDK 2020.1.2 (334300.5582) binary release
(see https://developer.nvidia.com/mdl-sdk)
Added and Changed Features
-
MDL Compiler and Backends
- A new HLSL backend option
use_renderer_adapt_microfacet_roughness
has been added, which
allows a renderer to adapt the roughness values provided to microfacet BSDFs right before
using them. The prototype of the function the renderer has to provide isfloat2 mdl_adapt_microfacet_roughness(Shading_state_material state, float2 roughness_uv)
. - A new execution context option
ignore_noinline
has been added, which allows to ignore
anno::noinline()
annotations, enabling inlining when creating a compiled material.
Previously this happened later when generating code for distribution functions. But
optimizing at this time could lead to a changed DAG which may not contain the nodes requested
by the user anymore.
- A new HLSL backend option
Fixed Bugs
-
General
- Fixed a crash in the
i18n
tool when accessing module annotations.
- Fixed a crash in the
-
MDL Compiler and Backends
- Fixed wrong optimization for ternary operators selecting different vector elements in HLSL
always returning the true expression. - Fixed wrong PTX version used for sm_86.
- In single-init mode, don't let a requested
geometry.normal
expression calculate the normal
again. - Fixed analysis of derivative variants of functions not being recognized as depending on
state::normal()
. - Reduced number of texture result slots used in generated init functions.
- Do not generate HLSL code containing
min16int
to ensure compatibility to Slang. - Fixed translation of conversion of an 8-bit to a 32-bit integer for HLSL.
- Fixed wrong optimization for ternary operators selecting different vector elements in HLSL
MDL SDK 2020.1.1 (334300.4226): 29 Sep 2020
ABI compatible with the MDL SDK 2020.1.1 (334300.4226) binary release
(see https://developer.nvidia.com/mdl-sdk)
Added and Changed Features
-
General
- Thumbnail paths are now resolved when they are requested. Before, the resolving was done
during the module loading. - A new backend option
eval_dag_ternary_strictly
has been added, which enables strict
evaluation of ternary operators (?:) on the DAG to reduce code size. By default it is enabled.
- Thumbnail paths are now resolved when they are requested. Before, the resolving was done
-
MDL Compiler and Backends
- Added single-init mode for a set of functions added to a link unit, allowing all these
functions to reuse values calculated in the init function and stored in the texture results
field of the state struct. To enable this mode, the first path in the target function
description list given toILink_unit::add_material()
must be"init"
. (Note: the init
function will not be marked asITarget_code::DK_BSDF
anymore.)
- Added single-init mode for a set of functions added to a link unit, allowing all these
-
MDL SDK examples
-
Examples Shared
- Enabled CMake option for linking MSVC dynamic runtime (/MD) instead of static (/MT) by
default.
- Enabled CMake option for linking MSVC dynamic runtime (/MD) instead of static (/MT) by
-
Example Code Generation
- Updated MaterialX support to incorporate latest changes from the MaterialX github
repository (branch 1.3.8).
- Updated MaterialX support to incorporate latest changes from the MaterialX github
-
Example DXR
- Added
-e
option to specify which expressions to compile.
- Added
-
Fixed Bugs
-
MDL Compiler and Backends
- Fixed
IFunction_call::get_arguments()
for the array constructor, such that it always
uses"0"
,"1"
, and so on as argument names. - Fixed failing MDLE export if the
tex::gamma_mode
type is only referenced by an
annotation. - Fixed storing matrices in texture results taking up all the space without much benefit.
- Fixed
MDL SDK 2020.1 (334300.2228): 11 Aug 2020
ABI compatible with the MDL SDK 2020.1 (334300.2228) binary release
(see https://developer.nvidia.com/mdl-sdk)
Added and Changed Features
-
MDL 1.6 Language Specification
- Hyperlinks have been added to the MDL Specification PDF document.
-
General
- Enabled support for MDL modules whose names contains parentheses, brackets, or commas.
- The interface
IMdl_entity_resolver
has been redesigned. Support for resolving resources has
been added. - The new interface
IMdl_module_transformer
allows to apply certain transformations on MDL
modules. - Various API methods have been added in order to reduce the error-prone parsing of MDL-related
names: To retrieve DB names from MDL names useget_db_module_name()
and
get_db_definition_name()
onIMdl_factory
. To retrieve parts of the MDL name from the
corresponding DB element useget_mdl_package_component_count()
,
get_mdl_package_component_name()
, andget_mdl_simple_name()
onIModule
;
get_mdl_module_name()
,get_mdl_simple_name()
onIMaterial_definition
; and
get_mdl_module_name()
,get_mdl_simple_name()
, andget_mdl_parameter_type_name()
on
IFunction_definition
andIAnnotation_definition
. - Added a new overload of
IModule::get_function_overloads()
that accepts a simple name
and an array of parameter type names instead of two strings. This avoids the ambiguity when
parsing parentheses and commas. The old overload is deprecated and still available if
MI_NEURAYLIB_DEPRECATED_11_1
is defined. - Improved recursive MDL module reloading: changed the traversal order from pre-order to
post-order traversal, avoid flagging a module as changed if it did not change at all. - Improved
Definition_wrapper
: the creation of functions calls for template-like MDL
functions requires now an actual argument list since the dummy defaults for such functions
easily lead to function calls with the wrong types in the signature. - Added more options to control the generation of compiled materials in class compilation mode:
Folding of enum and bool parameters, folding of individual parameters, folding of cutout
opacity, and folding of transparent layers. - Added methods to retrieve the MDL version of modules, and the MDL version when a particular
function or material definition was added to (and, if applicable, removed from) the MDL
specification. - Added methods to retrieve the MDL system and user paths.
- The legacy behavior of
df::simple_glossy_bsdf
can now be controlled via the interface
IMdl_configuration
. - The return type of
IFunction_definition::get_body()
has been changed from
const IExpression_direct_call*
toconst IExpression*
.
-
MDL Compiler and Backends
- Added support for target code serialization in the HLSL and PTX backends. See the new
methodsget_backend_kind()
,supports_serialization()
,serialize()
, and
get_argument_layout_count()
onITarget_code
, and
IMdl_backend::deserialize_target_code()
. The new context option
"serialize_class_instance_data"
forITarget_code::serialize()
controls whether
per-instance data or only per-class data is serialized. - Allow total internal reflection for glossy BSDFs with mode
df::scatter_transmit
(libbsdf). - When derivatives are enabled,
state::position()
is now derivable. Thus, the"position"
field ofShading_state_material_with_derivs
is now a derivative type. - Added
"meters_per_scene_unit"
field toShading_state_material
. It is used, when folding
ofstate::meters_per_scene_unit()
andstate::scene_units_per_meter()
has been disabled
via the newIMdl_execution_context
"fold_meters_per_scene_unit"
option. - Added derivative support for matrices.
- Added derivative support for scene data functions. Requires new texture runtime functions
scene_data_lookup_deriv_float
,scene_data_lookup_deriv_float2
,
scene_data_lookup_deriv_float3
,scene_data_lookup_deriv_float4
, and
scene_data_lookup_deriv_color
(seetexture_support_cuda.h
in the MDL SDK examples
for the prototypes). - Added
mi::neuraylib::ICompiled_material::depends_on_uniform_scene_data()
analyzing
whether anyscene::data_lookup_uniform_*()
functions are called by a material instance. - Implemented per function render state usage in
ITarget_code
. - Avoid reporting deprecated warnings, if current entity is already deprecated.
- Added support for target code serialization in the HLSL and PTX backends. See the new
-
MDL SDK examples
-
Examples Shared
- Added utility headers for strings, enums, I/O, OS, and MDL specific tasks to be used in
the examples. Updated examples to make use of the new utility headers. - Added GUI classes to illustrate MDL parameter editing and to unify user interfaces in
examples in the future.
- Added utility headers for strings, enums, I/O, OS, and MDL specific tasks to be used in
-
Example DXR
- Added a new more structured user interface with various new features including the
loading of scenes and environments from the menu, the replacement of materials,
compilation and parameter folding options, and parameter editing in instance compilation
mode. - Integrated the MDL browser (if built) for the replacement of a selected material.
- Added shader caching to improve loading times (has to be enabled with option
--enable_shader_cache
).
- Added a new more structured user interface with various new features including the
-
GLTF Support
- Added
KHR_materials_clearcoat
support, also in Example DXR.
- Added
-
MDL plugin for Arnold
- Added a new example to illustrate the integration of MDL into an existing advanced CPU
renderer.
- Added a new example to illustrate the integration of MDL into an existing advanced CPU
-
Example Code Generation
- Added a new example to illustrate HLSL and PTX code generation.
-
Example OptiX 7
- Added a new example to illustrate the use MDL code as OptiX callable programs in a
closest hit shader, and alternatively, how to link the MDL code directly into a
per-material closest hit shader for better runtime performance.
- Added a new example to illustrate the use MDL code as OptiX callable programs in a
-
Example Native
- Added missing scene data functions of custom texture runtime.
-
Fixed Bugs
-
General
- Fixed documentation of
Bsdf_evaluate_data
structs: eval function results are output-only,
not input/output. - Fixed compilation of materials using the array length operator.
- Fixed crash on CentOS 7.1 when importing non-trivial MDL modules.
- Fixed incorrect behavior during function call creation when implicit casts were enabled.
- Fixed documentation of
-
MDL Compiler and Backends
- Fixed file resolution during re-export of MDLE modules.
- Fixed missing clearing of context messages when creating a link unit.
- Fixed detection of absolute file names on Windows for MDLEs on a network share.
- Fixed support for the read-only segment and resources inside function bodies when compiling
for the native target. - Fixed rare crash/memory corruption than could occur on MDLE creation.
- Fixed possible crash when inlining a function containing a
for (i = ...)
loop statement. - Fixed potential crash in the auto importer when imports of the current module are erroneous.
- Fixed handling of suppressed warnings if notes are attached to them, previously these were
attached to other messages. - Fixed possible crash in generating MDLE when array types are involved.
- Fixed printing of initializers containing sequence expressions, it is
T v = (a,b);
, notT v = a, b;
. - Improved AST optimizer:
- Write optimized
if
conditions back. - Write optimized sub-expressions of binary expressions back.
- Handle
constant && x
,constant || x
,x && constant
,x || constant
.
- Write optimized
- Fixed folding of calls to
state::meters_per_scene_unit()
and
state::scene_units_per_meter()
in non-inlined functions. - Fixed wrong code generation for int to float conversions with derivatives.
- Fixed a bug in the generated HLSL code that caused wrong calculations because loads were
erroneously placed after calls modifying memory. - Fixed checking of valid MDL identifiers (names starting with
"do"
were treated as keywords,
but not"do"
itself). - Fixed overload resolution for MDL operators.
- Fixed crash in MDL runtime when using nonexistent image files with MDL.
- Fixed invalid translation of
int
tofloat
conversion with derivatives enabled. - Fixed broken
math::sincos()
on vectors. - Fixed failing MDLE creation due to several missing or non-exported entities (constants,
annotations). - Fixed failing MDLE creation if the main module was < MDL 1.6, but imported an MDL 1.6 module.
- Fixed failing MDLE creation if non-absolute imports of
::base
were used. - Fixed rare crashes occurring when the array constructor is used in annotations.
- Fixed lost enumeration of BSDF data textures used by the libbsdf multiscatter.
-
MDL SDK examples
- Examples Shared
- Fixed failing CUDA checks when minimizing application.
- Examples Shared
MDL SDK 2020.0.2 (327300.6313): 28 May 2020
ABI compatible with the MDL SDK 2020.0.2 (327300.6313) binary release
(see https://developer.nvidia.com/mdl-sdk)
Added and Changed Features
-
MDL Compiler and Backends
- Reduced the minimum roughness threshold for microfacet BSDFs from 1e-3 to 1e-7 to
make them usable for mirrors and clear glass, which is inefficient but could be required by
ubershaders. - Added
"ro_data_segment"
field toShading_state_environment
("ro_data_segment_offset"
for
HLSL). - Use
"direction"
for the field name ofShading_state_environment
(HLSL only). - Made
state::position()
derivable.
- Reduced the minimum roughness threshold for microfacet BSDFs from 1e-3 to 1e-7 to
Fixed Bugs
-
MDL Compiler and Backends
- Fixed some rare cases were resources inside MDL functions got lost.
- Fixed crash in MDL code generators due to MDL core compiler missing some error messages when
a (wrong) member selection has the same name like an enum constant. - Fixed rare NaN in microfacet sampling.
- Fixed error value of
ITarget_code::get_body_*()
functions. - Fixed return value of
ITarget_code::create_argument_block()
when required resource callback
is missing. - Fixed read-only data segment data not being set for native lambdas.
- Fixed resource enumeration when compiling multiple expressions in a link unit with
add_material()
: ensure that resources in material bodies are enumerated first.