Skip to content

Commit

Permalink
MDL SDK 2024.0.2 (377400.2626)
Browse files Browse the repository at this point in the history
  • Loading branch information
jreichel-nvidia committed Aug 26, 2024
1 parent 203d514 commit e26aef8
Show file tree
Hide file tree
Showing 60 changed files with 907 additions and 365 deletions.
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
Change Log
==========
MDL SDK 2024.0.2 (377400.2626): 07 Aug 2024
-----------------------------------------------

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

**Added and Changed Features**

- General
- MDL Arnold: Added support for Arnold SDK version 7.3.2.1.

**Fixed Bugs**

- General
- Fixed missing leading "::" for qualified names reported by `IMdl_discovery_api`,
if search paths had a trailing OS separator.
- Improved error message that can be triggered when calling non-const methods
on const objects. This can e.g. be triggered via the Python binding by accessing
(not editing) database elements.
- Improved coverage tests for the Python binding.

- MDL Compiler and Backends
- Fixed crash in some cases when derivatives were calculated for a struct also containing
non-floating point fields.
- Fixed wrong digit that can be added to `tex::texture_isvalid()` calls for
HLSL and GLSL backends, if more than one texture type (for instance `texture_2d` and
`texture_3d`) are used together in one module.

MDL SDK 2024.0.1 (377400.2109): 18 Jul 2024
-----------------------------------------------

Expand Down
3 changes: 0 additions & 3 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
MDL SDK Copyright and License
=============================

Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion doc/base_module/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ <h3>Edge</h3>

</div><div id="blackfooter">
<span class="footeritem">
17&#160;July&#160;2024,&#160;19:52,&#160;rev379530, v1.3
6&#160;August&#160;2024,&#160;19:57,&#160;rev380010, v1.3
</span>
<span class="footeritem">
<a href="https://www.nvidia.com/en-us/about-nvidia/legal-info/">&copy; 2024 NVIDIA&nbsp;Corporation.</a> All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion doc/build/doxygen_footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!-- start footer part -->
<!--BEGIN GENERATE_TREEVIEW-->
<div id="nav-path">
<span class="footeritem">MDL SDK 2024.0.1 (377400.2109): $datetime</span>
<span class="footeritem">MDL SDK 2024.0.2 (377400.2626): $datetime</span>
<span class="footeritem">
<a href="http://www.nvidia.com/">
&copy;&#160;2024&#160;NVIDIA&#160;Corporation.</a>
Expand Down
9 changes: 8 additions & 1 deletion doc/core_definitions/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,13 @@ <h2>Page cannot be loaded</h2>
</li>
</ol>

<p>The documentation is also available as a PDF file from the links in the black bar at the
bottom of the page or from the following links:</p>

<div style="padding-left:2em;">
<a href="mdl_core_definitions.240806.A4.pdf">View documentation in A4 format</a><br>
<a href="mdl_core_definitions.240806.LTR.pdf">View documentation in US Letter format</a><br>
</div>
<h3>Overriding security settings</h3>

<p>If the problem is due to the configuration of the browser (case #3),
Expand Down Expand Up @@ -270,7 +277,7 @@ <h3>Edge</h3>
<span class="footeritem">
</span>
<span class="footeritem">
17&#160;July&#160;2024,&#160;19:52,&#160;rev379530, v1.4
6&#160;August&#160;2024,&#160;19:58,&#160;rev380010, v1.4
</span>
<span class="footeritem">
<a href="https://www.nvidia.com/en-us/about-nvidia/legal-info/">&copy; 2024 NVIDIA&nbsp;Corporation.</a> All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion doc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
</div>
<div id="blackfooter">
<span class="footeritem">
MDL SDK 2024.0.1 (377400.2109): 18 Jul 2024
MDL SDK 2024.0.2 (377400.2626): 07 Aug 2024
</span>
<span class="footeritem">
<a href="http://www.nvidia.com/">&copy;&#160;2024&#160;NVIDIA&#160;Corporation.</a> &#160;All&#160;rights&#160;reserved.
Expand Down
4 changes: 2 additions & 2 deletions doc/mdl_sdkapi/example_axf_to_mdl.dox
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ This example loads an X-Rite AxF(Appearance Exchange Format) file and converts i
AxF to MDL material format conversion
</b></dt>
<dd><br>
The example first loads an AxF file and parses it using the AxF Decoding SDK (not distributed with MDL-SDK,
The example first loads an AxF file and parses it using the AxF Decoding SDK (not distributed with MDL SDK,
please check \link mi_neuray_getting_started Getting started \endlink for further information) in order to decode AxF material representations, its parameters,
its resources such a texture bitmaps, measurements, and metadata.

Expand All @@ -60,7 +60,7 @@ This example loads an X-Rite AxF(Appearance Exchange Format) file and converts i

This means The MDL representations will have a close visual appearance to its AxF equivalents and will expose the same input parameters.

This way, by using MDL-SDK, the example will load this module and use it as template to create material variations to map parameters,
This way, by using MDL SDK, the example will load this module and use it as template to create material variations to map parameters,
textures and measurements between MDL and AxF representations and so achieving the conversion.

Finally, the example will write a output MDL file with the resulting variation(s) along its resources (bitmaps).
Expand Down
10 changes: 5 additions & 5 deletions doc/mdl_sdkapi/example_distilling_target.dox
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ distilled.
</b></dt>
<dd><br>
A custom Distiller plugin is a shared library that is loaded
into the MDL-SDK and provides one or more custom distilling
into the MDL SDK and provides one or more custom distilling
target(s) to the an application. The application is
responsible for loading the plugin and can then use the
target(s) through the Distiller API, just as for the targets
from the <tt>mdl_distiller</tt> plugin which is part of the
MDL-SDK.
MDL SDK.

The \ref example_distilling_target "example program" described
below loads an example plugin and distills a material to the
Expand Down Expand Up @@ -91,7 +91,7 @@ distilled.
Note that the example plugin implements one target. The
plugin interface is general enough so that plugins could
implement more than one in the same plugin. The distiller
plugin <tt>mdl_distilller</tt> that comes with the MDL-SDK
plugin <tt>mdl_distiller</tt> that comes with the MDL SDK
does exactly that and implements multiple targets.

<!-- Workaround to prevent a layout problem after dd tags. -->
Expand All @@ -109,15 +109,15 @@ distilled.
which rule sets are applied to a material graph, and in which
order.

Each rule consists of a left- and a right-hadn side. The
Each rule consists of a left- and a right-hand side. The
left-hand side is a pattern that matches a graph node and
binds variables, and the right-hand side specifies the
replacement for the matched rule.

When a rule set is applied to a material, the Distiller will
attempt to match all rules of a rule set, in order, to each
node in the material graph. When it matches, the variables in
the lefthand pattern of the rule are bound to subexpressions
the left-hand pattern of the rule are bound to subexpressions
of the current node, and the node on the right-hand side is
constructed, possibly including expressions bound by the
left-hand pattern. After a successful match, the Distiller
Expand Down
2 changes: 1 addition & 1 deletion doc/mdl_sdkapi/example_mdl_browser.dox
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ configured search paths.
Each node in the tree can save various information in form of key-value-pairs.
This allows us to store names, authors, descriptions or other data, mainly gathered from
annotations, for each exported material or function. The example also contains an
implementation of the IMdl_cache_serializer, which exports the cache to a xml file
implementation of the IMdl_cache_serializer, which exports the cache to a XML file
and imports it back again when the application is started the next time.

In the current implementation, all modules that are not already in the cache,
Expand Down
2 changes: 1 addition & 1 deletion doc/mdl_sdkapi/example_modules.dox
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ This example loads an MDL module and inspects it contents.
<dd><br>
MDL materials and functions (as found in a \c .mdl file) are represented in the
\neurayApiName by the interface #mi::neuraylib::IFunction_definition. Similar to the module
interface thi interface offers various methods related to metadata, like the name of the
interface this interface offers various methods related to metadata, like the name of the
definition, or the name of the containing module. Important methods are those that provide
details about the parameters, like their names, types, and the values of defaults (if
present).
Expand Down
2 changes: 1 addition & 1 deletion doc/mdl_sdkapi/mdltl.dox
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ plugins is documented in three parts:
compiled rules created by the MDLTL compiler in a Distiller plugin.

- \subpage mi_neuray_mdltl_spec <br>
Specification of MDLT, including a detailed description of the
Specification of MDLTL, including a detailed description of the
language.

- \subpage mi_neuray_mdltl_grammar <br>
Expand Down
2 changes: 1 addition & 1 deletion doc/mdl_sdkapi/mdltl_manual.dox
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ rule engine to repeatedly apply transformation rules to nodes in the
material graph. Transformation rules are implemented as subclasses of
the class `mi::mdl::IRule_matcher`. These classes for rule-matching can
be written by hand, but a more convenient and less error-prone option
is to write rules in the <i>MDL Transforamtion Language (MDLTL)</i>. MDLTL is a
is to write rules in the <i>MDL Transformation Language (MDLTL)</i>. MDLTL is a
domain-specific language for describing transformations on MDL
materials. These transformations are expressed as a set of rules which
are compiled to C++ code and are then linked into Distiller plugins.
Expand Down
8 changes: 4 additions & 4 deletions doc/mdl_sdkapi/mdltl_spec.dox
Original file line number Diff line number Diff line change
Expand Up @@ -460,19 +460,19 @@ are transformed into calls to one of the functions:
- `bsdf_unbounded_mix_1, bsdf_unbounded_mix_2, bsdf_unbounded_mix_3, bsdf_unbounded_mix_4`
- `bsdf_color_mix_1, bsdf_color_mix_2, bsdf_color_mix_3, bsdf_color_mix_4`
- `bsdf_color_clamped_mix_1, bsdf_color_clamped_mix_2, bsdf_color_clamped_mix_3, bsdf_color_clamped_mix_4`
- `bsdf_color_unboudned_mix_1, bsdf_color_unbounded_mix_2, bsdf_color_unbounded_mix_3, bsdf_color_unbounded_mix_4`
- `bsdf_color_unbounded_mix_1, bsdf_color_unbounded_mix_2, bsdf_color_unbounded_mix_3, bsdf_color_unbounded_mix_4`
- `edf_mix_1, edf_mix_2, edf_mix_3, edf_mix_4`
- `edf_clamped_mix_1, edf_clamped_mix2, edf_clamped_mix_3, edf_clamped_mix_4`
- `edf_unbounded_mix_1, edf_unbounded_mix_2, edf_unbounded_mix_3, edf_unbounded_mix_4`
- `edf_color_mix_1, edf_color_mix_2, edf_color_mix_3, edf_color_mix_4`
- `edf_color_clamped_mix_1, edf_color_clamped_mix_2, edf_color_clamped_mix_3, edf_color_clamped_mix_4`
- `edf_color_unboudned_mix_1, edf_color_unbounded_mix_2, edf_color_unbounded_mix_3, edf_color_unbounded_mix_4`
- `edf_color_unbounded_mix_1, edf_color_unbounded_mix_2, edf_color_unbounded_mix_3, edf_color_unbounded_mix_4`
- `vdf_mix_1, vdf_mix_2, vdf_mix_3, vdf_mix_4`
- `df_clamped_mix_1, vdf_clamped_mix2, vdf_clamped_mix_3, vdf_clamped_mix_4`
- `vdf_unbounded_mix_1, vdf_unbounded_mix_2, vdf_unbounded_mix_3, vdf_unbounded_mix_4`
- `vdf_color_mix_1, vdf_color_mix_2, vdf_color_mix_3, vdf_color_mix_4`
- `vdf_color_clamped_mix_1, vdf_color_clamped_mix_2, vdf_color_clamped_mix_3, vdf_color_clamped_mix_4`
- `vdf_color_unboudned_mix_1, vdf_color_unbounded_mix_2, vdf_color_unbounded_mix_3, vdf_color_unbounded_mix_4`
- `vdf_color_unbounded_mix_1, vdf_color_unbounded_mix_2, vdf_color_unbounded_mix_3, vdf_color_unbounded_mix_4`

depending of their number and types of parameters before rule
application and back afterwards. That means that rules can only match
Expand All @@ -491,7 +491,7 @@ The mixer call transformation in the rule engine also applies some
normalization to the calls. Since the order of parameters for these
functions does not matter, the pairs of weights and DFs are sorted by
the semantics of the argument DFs. DF semantics are represented by
the `mi::mdl::IDefinition::Semantics` enumeration in the MDL-SDK and
the `mi::mdl::IDefinition::Semantics` enumeration in the MDL SDK and
the calls in mixer calls are ordered according to the the numerical
values of the C++ enum variants.

Expand Down
6 changes: 0 additions & 6 deletions examples/mdl/nvidia/sdk_examples/tutorials_aov.mdl
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,3 @@ export aov_material merge5(
example: (1.0f - mix) * a.example + mix * b2.example,
magic: int(math::lerp(float(a.magic), float(b2.magic), mix))
);

// Example of an empty material.
// FIXME: assertion fails.
export struct empty_material in material_category {
};
export empty_material empty() = empty_material();
1 change: 1 addition & 0 deletions examples/mdl_core/calls/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ create_from_base_preset(
OUTPUT_NAME "calls"
SOURCES ${PROJECT_SOURCES}
EXAMPLE
STATIC_MSVC_RUNTIME
)

# add dependencies
Expand Down
7 changes: 5 additions & 2 deletions examples/mdl_core/code_gen/example_code_gen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ int MAIN_UTF8(int argc, char* argv[])
options.print_usage(std::cout);
exit(EXIT_FAILURE);
}

// Print description of command line options
if (options.m_help)
{
Expand Down Expand Up @@ -440,6 +440,9 @@ code_gen [options] <qualified_material_name>
bool Options::parse(int argc, char* argv[])
{
m_mdl_paths.push_back(get_samples_mdl_root());
const auto& path = get_src_shaders_mdl();
if (path != ".")
m_mdl_paths.push_back(path);

for (int i = 1; i < argc; ++i)
{
Expand Down Expand Up @@ -573,4 +576,4 @@ bool Options::parse(int argc, char* argv[])
}
}
return true;
}
}
16 changes: 9 additions & 7 deletions examples/mdl_core/shared/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ endif()
set(PROJECT_SOURCES
"example_cuda_shared.h"
"example_shared.h"
"example_shared.cpp"
"example_shared_backends.h"
"texture_support_cuda.h"
${DUMMY_CPP}
Expand All @@ -51,25 +52,26 @@ create_from_base_preset(
OUTPUT_NAME "shared"
SOURCES ${PROJECT_SOURCES}
EXAMPLE
STATIC_MSVC_RUNTIME
)
add_library(mdl_core::shared ALIAS ${PROJECT_NAME})

# inject the MDL_SAMPLES_ROOT path
target_compile_definitions(${PROJECT_NAME}
PUBLIC
target_compile_definitions(${PROJECT_NAME}
PRIVATE
"MDL_SAMPLES_ROOT=\"${CMAKE_CURRENT_SOURCE_DIR}/../..\""
)

# add dependencies
target_add_dependencies(TARGET ${PROJECT_NAME}
DEPENDS
mdl::mdl_core
NO_RUNTIME_COPY # header only -> the consumer will also add this dependency
target_add_dependencies(TARGET ${PROJECT_NAME}
DEPENDS
mdl::mdl_core
NO_RUNTIME_COPY
)

# add include directories
target_include_directories(${PROJECT_NAME}
INTERFACE
# the template makes non public headers private by default
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
)
71 changes: 71 additions & 0 deletions examples/mdl_core/shared/example_shared.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/******************************************************************************
* Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of NVIDIA CORPORATION nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/

// examples/mdl_core/shared/example_shared.cpp
//
// Code shared by all examples

#include "example_shared.h"

void* g_dso_handle = 0;

// Intentionally not implemented inline which would require callers to define MDL_SAMPLES_ROOT.
std::string get_samples_root()
{
std::string path = get_environment("MDL_SAMPLES_ROOT");
if (path.empty()) {
#ifdef MDL_SAMPLES_ROOT
path = MDL_SAMPLES_ROOT;
#else
path = ".";
#endif
}

if (dir_exists(path.c_str()))
return path;

return ".";
}

// Intentionally not implemented inline which would require callers to define MDL_SRC_SHADERS_MDL.
std::string get_src_shaders_mdl()
{
std::string path = get_environment("MDL_SRC_SHADERS_MDL");
if (path.empty()) {
#ifdef MDL_SRC_SHADERS_MDL
path = MDL_SRC_SHADERS_MDL;
#else
path = ".";
#endif
}

if (dir_exists(path.c_str()))
return path;

return ".";
}
Loading

0 comments on commit e26aef8

Please sign in to comment.