UNPKG

@needle-tools/materialx

Version:

Web runtime support to load and display MaterialX materials in Needle Engine and three.js via the MaterialX WebAssembly library. glTF files containing the `NEEDLE_materials_mtlx` extension can be loaded with this package. There is also experimental suppor

823 lines (768 loc) 1.43 MB
# MaterialX Data Libraries This folder contains the standard data libraries for MaterialX, providing declarations and graph definitions for the MaterialX nodes, and source code for all supported shader generators. ## Standard Pattern Library - [stdlib](stdlib) - [stdlib_defs.mtlx](stdlib/stdlib_defs.mtlx) : Nodedef declarations. - [stdlib_ng.mtlx](stdlib/stdlib_ng.mtlx) : Nodegraph definitions. - [genglsl](stdlib/genglsl): GLSL language support. - [lib](stdlib/genglsl/lib) : Shader utility files. - [stdlib_genglsl_impl.mtlx](stdlib/genglsl/stdlib_genglsl_impl.mtlx) : Mapping from declarations to implementations. - [genosl](stdlib/genosl): OSL language support. - [lib](stdlib/genosl/lib) : Shader utility files. - [stdlib_genosl_impl.mtlx](stdlib/genosl/stdlib_genosl_impl.mtlx) : Mapping from declarations to implementations. - [genmdl](stdlib/genmdl): MDL language support. - [stdlib_genmdl_impl.mtlx](stdlib/genmdl/stdlib_genmdl_impl.mtlx) : Mapping from declarations to implementations. - Additional MaterialX support libraries for MDL are located in the [source/MaterialXGenMdl/mdl/materialx](../source/MaterialXGenMdl/mdl/materialx) package folder - [genmsl](stdlib/genmsl): MSL language support. - [lib](stdlib/genmsl/lib) : Shader utility files. - [stdlib_genmsl_impl.mtlx](stdlib/genmsl/stdlib_genmsl_impl.mtlx) : Mapping from declarations to implementations. ## Physically Based Shading Library - [pbrlib](pbrlib) - [pbrlib_defs.mtlx](pbrlib/pbrlib_defs.mtlx) : Nodedef declarations. - [pbrlib_ng.mtlx](pbrlib/pbrlib_ng.mtlx) : Nodegraph definitions. - [genglsl](pbrlib/genglsl) : GLSL language support - [lib](pbrlib/genglsl/lib) : Shader utility files. - [pbrlib_genglsl_impl.mtlx](pbrlib/genglsl/pbrlib_genglsl_impl.mtlx) : Mapping from declarations to implementations. - [genosl](pbrlib/genosl) : OSL language support - [lib](pbrlib/genosl/lib) : Shader utility files. - [pbrlib_genosl_impl.mtlx](pbrlib/genosl/pbrlib_genosl_impl.mtlx) : Mapping from declarations to implementations. - [genmdl](pbrlib/genmdl) : MDL language support - [pbrlib_genmdl_impl.mtlx](pbrlib/genmdl/pbrlib_genmdl_impl.mtlx) : Mapping from declarations to implementations. - [genmsl](pbrlib/genmsl) : MSL language support - [pbrlib_genmsl_impl.mtlx](pbrlib/genmsl/pbrlib_genmsl_impl.mtlx) : Mapping from declarations to implementations. ## BxDF Graph Library - [bxdf](bxdf) - [standard_surface.mtlx](bxdf/standard_surface.mtlx) : Graph definition of the [Autodesk Standard Surface](https://autodesk.github.io/standard-surface/) shading model. - [gltf_pbr.mtlx](bxdf/gltf_pbr.mtlx) : Graph definition of the [glTF PBR](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#appendix-b-brdf-implementation) shading model. - [usd_preview_surface.mtlx](bxdf/usd_preview_surface.mtlx) : Graph definition of the [UsdPreviewSurface](https://openusd.org/release/spec_usdpreviewsurface.html) shading model. - [lama](bxdf/lama) : Graph definitions of the [MaterialX Lama](https://rmanwiki.pixar.com/display/REN24/MaterialX+Lama) node set. ## Color Management Library - MaterialX shader generation natively supports a small set of common spaces for input colors, with all color transforms implemented as language-independent MaterialX graphs.The canonical definitions of these color transforms may be found in the OpenColorIO configuration for [ACES 1.2](https://github.com/colour-science/OpenColorIO-Configs/tree/feature/aces-1.2-config/aces_1.2). - lin_rec709 - g18_rec709 - g22_rec709 - rec709_display - acescg (lin_ap1) - g22_ap1 - srgb_texture - lin_adobergb - adobergb - srgb_displayp3 - lin_displayp3 - [cmlib](cmlib) - [cmlib_defs.mtlx](cmlib/cmlib_defs.mtlx) : Nodedef declarations. - [cmlib_ng.mtlx](cmlib/cmlib_ng.mtlx) : Nodegraph definitions. ## Target Definitions - Each target implementation requires a target definition for declaration / implementation correspondence to work. - The [targets](targets) folder contains definition files for the following core targets: - GLSL : `genglsl` - OSL : `genosl` - MDL : `genmdl` - MSL : `genmsl` - Any additional target files should be added under this folder and loaded in as required. ### Target Support - GLSL target support is for version 4.0 or higher. - OSL target support is for version 1.12.6 or higher. - MDL target support is for version 1.6 or higher. - Basic GLSL and MSL `lightshader` node definitions and implementations are provided for the following light types: - point, directional, spot - Shader generation does not currently support: - `displacementshader` and `volumeshader` nodes for hardware shading targets (GLSL, MSL). - `hextiledimage` and `hextilednormalmap` for OSL and MDL. if(MATERIALX_BUILD_DATA_LIBRARY) # Build generated products from the MaterialX data library. # Initially, this step is a simple copy across folders, but our intent # is for it to include meaningful work in the future. set(DATA_LIBRARY_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/DataLibraryBuild) file(GLOB_RECURSE MATERIALX_DATA_LIBRARY_SOURCE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} LIST_DIRECTORIES false *.mtlx *.md *.glsl *.osl *.h *.metal) foreach(SOURCE_FILE IN LISTS MATERIALX_DATA_LIBRARY_SOURCE_FILES) set(SOURCE_FILEPATH ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE_FILE}) set(DEST_FILEPATH ${DATA_LIBRARY_BUILD_DIR}/${SOURCE_FILE}) add_custom_command( OUTPUT ${DEST_FILEPATH} COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SOURCE_FILEPATH} ${DEST_FILEPATH} DEPENDS ${SOURCE_FILEPATH}) list(APPEND MATERIALX_DATA_LIBRARY_BUILD_FILES ${DEST_FILEPATH}) endforeach() add_custom_target(MaterialXBuildData ALL DEPENDS ${MATERIALX_DATA_LIBRARY_BUILD_FILES}) set(DATA_LIBRARY_DIR ${DATA_LIBRARY_BUILD_DIR}) else() set(DATA_LIBRARY_DIR ${CMAKE_CURRENT_SOURCE_DIR}) endif() if(NOT SKBUILD) install(DIRECTORY ${DATA_LIBRARY_DIR}/ DESTINATION "${MATERIALX_INSTALL_STDLIB_PATH}" PATTERN "CMakeLists.txt" EXCLUDE) endif() if(MATERIALX_BUILD_PYTHON) set(MATERIALX_PYTHON_LIBRARIES_PATH "${MATERIALX_PYTHON_FOLDER_NAME}/${MATERIALX_INSTALL_STDLIB_PATH}") if(SKBUILD) set(MATERIALX_PYTHON_LIBRARIES_PATH "${SKBUILD_PLATLIB_DIR}/MaterialX/libraries") endif() install(DIRECTORY ${DATA_LIBRARY_DIR}/ DESTINATION "${MATERIALX_PYTHON_LIBRARIES_PATH}" PATTERN "CMakeLists.txt" EXCLUDE) endif() set(MATERIALX_DATA_LIBRARY_DIR ${DATA_LIBRARY_DIR} PARENT_SCOPE) <?xml version="1.0"?> <materialx version="1.39"> <!-- Copyright Contributors to the MaterialX Project SPDX-License-Identifier: Apache-2.0 Declarations of common light nodes, used in code generation for hardware shading languages that require explicit light loops. These nodes are a required implementation detail for hardware shader generation, and are not themselves part of the MaterialX standard. --> <!-- ======================================================================== --> <!-- Light shader nodes --> <!-- ======================================================================== --> <!-- Node: <point_light> --> <nodedef name="ND_point_light" node="point_light" nodegroup="light" doc="A light shader node of 'point' type."> <input name="position" type="vector3" doc="Light source position." /> <input name="color" type="color3" doc="Light color." /> <input name="intensity" type="float" doc="Light intensity." /> <input name="decay_rate" type="float" value="2.0" doc="Light decay exponent. Defaults to 2 for quadratic decay." /> <output name="out" type="lightshader" /> </nodedef> <!-- Node: <directional_light> --> <nodedef name="ND_directional_light" node="directional_light" nodegroup="light" doc="A light shader node of 'directional' type."> <input name="direction" type="vector3" doc="Light source direction." /> <input name="color" type="color3" doc="Light color." /> <input name="intensity" type="float" doc="Light intensity." /> <output name="out" type="lightshader" /> </nodedef> <!-- Node: <spot_light> --> <nodedef name="ND_spot_light" node="spot_light" nodegroup="light" doc="A light shader node of 'spot' type."> <input name="position" type="vector3" doc="Light source position." /> <input name="direction" type="vector3" doc="Light source direction." /> <input name="color" type="color3" doc="Light color." /> <input name="intensity" type="float" doc="Light intensity." /> <input name="decay_rate" type="float" value="2.0" doc="Light decay exponent. Defaults to 2 for quadratic decay." /> <input name="inner_angle" type="float" doc="Inner cone angle." /> <input name="outer_angle" type="float" doc="Outer cone angle." /> <output name="out" type="lightshader" /> </nodedef> </materialx> void mx_point_light(LightData light, float3 position, thread lightshader& result) { result.direction = light.position - position; float distance = length(result.direction) + M_FLOAT_EPS; float attenuation = pow(distance + 1.0, light.decay_rate + M_FLOAT_EPS); result.intensity = light.color * light.intensity / attenuation; result.direction /= distance; } void mx_spot_light(LightData light, float3 position, thread lightshader& result) { result.direction = light.position - position; float distance = length(result.direction) + M_FLOAT_EPS; float attenuation = pow(distance + 1.0, light.decay_rate + M_FLOAT_EPS); result.intensity = light.color * light.intensity / attenuation; result.direction /= distance; float low = min(light.inner_angle, light.outer_angle); float high = light.inner_angle; float cosDir = dot(result.direction, -light.direction); float spotAttenuation = smoothstep(low, high, cosDir); result.intensity *= spotAttenuation; } void mx_directional_light(LightData light, float3 position, thread lightshader& result) { result.direction = -light.direction; result.intensity = light.color * light.intensity; } <?xml version="1.0"?> <materialx version="1.39"> <!-- <point_light> --> <implementation name="IM_point_light_genmsl" nodedef="ND_point_light" file="mx_point_light.metal" function="mx_point_light" target="genmsl" /> <!-- <directional_light> --> <implementation name="IM_directional_light_genmsl" nodedef="ND_directional_light" file="mx_directional_light.metal" function="mx_directional_light" target="genmsl" /> <!-- <spot_light> --> <implementation name="IM_spot_light_genmsl" nodedef="ND_spot_light" file="mx_spot_light.metal" function="mx_spot_light" target="genmsl" /> </materialx> <?xml version="1.0"?> <materialx version="1.39"> <!-- <point_light> --> <implementation name="IM_point_light_genglsl" nodedef="ND_point_light" file="mx_point_light.glsl" function="mx_point_light" target="genglsl" /> <!-- <directional_light> --> <implementation name="IM_directional_light_genglsl" nodedef="ND_directional_light" file="mx_directional_light.glsl" function="mx_directional_light" target="genglsl" /> <!-- <spot_light> --> <implementation name="IM_spot_light_genglsl" nodedef="ND_spot_light" file="mx_spot_light.glsl" function="mx_spot_light" target="genglsl" /> </materialx> void mx_spot_light(LightData light, vec3 position, out lightshader result) { result.direction = light.position - position; float distance = length(result.direction) + M_FLOAT_EPS; float attenuation = pow(distance + 1.0, light.decay_rate + M_FLOAT_EPS); result.intensity = light.color * light.intensity / attenuation; result.direction /= distance; float low = min(light.inner_angle, light.outer_angle); float high = light.inner_angle; float cosDir = dot(result.direction, -light.direction); float spotAttenuation = smoothstep(low, high, cosDir); result.intensity *= spotAttenuation; } void mx_directional_light(LightData light, vec3 position, out lightshader result) { result.direction = -light.direction; result.intensity = light.color * light.intensity; } void mx_point_light(LightData light, vec3 position, out lightshader result) { result.direction = light.position - position; float distance = length(result.direction) + M_FLOAT_EPS; float attenuation = pow(distance + 1.0, light.decay_rate + M_FLOAT_EPS); result.intensity = light.color * light.intensity / attenuation; result.direction /= distance; } <?xml version="1.0"?> <materialx version="1.39"> <!-- Copyright Contributors to the MaterialX Project SPDX-License-Identifier: Apache-2.0 Declarations of standard data types and nodes included in the MaterialX specification. --> <!-- ======================================================================== --> <!-- Data types --> <!-- ======================================================================== --> <typedef name="boolean" /> <typedef name="integer" /> <typedef name="float" /> <typedef name="color3" semantic="color" /> <typedef name="color4" semantic="color" /> <typedef name="vector2" /> <typedef name="vector3" /> <typedef name="vector4" /> <typedef name="matrix33" /> <typedef name="matrix44" /> <typedef name="string" /> <typedef name="filename" /> <typedef name="geomname" /> <typedef name="surfaceshader" semantic="shader" context="surface" /> <typedef name="displacementshader" semantic="shader" context="displacement" /> <typedef name="volumeshader" semantic="shader" context="volume" /> <typedef name="lightshader" semantic="shader" context="light" /> <typedef name="material" semantic="material" /> <typedef name="none" /> <typedef name="integerarray" /> <typedef name="floatarray" /> <typedef name="color3array" semantic="color" /> <typedef name="color4array" semantic="color" /> <typedef name="vector2array" /> <typedef name="vector3array" /> <typedef name="vector4array" /> <typedef name="stringarray" /> <typedef name="geomnamearray" /> <!-- ======================================================================== --> <!-- Units and unit types --> <!-- ======================================================================== --> <unittypedef name="distance" /> <unitdef name="UD_stdlib_distance" unittype="distance"> <unit name="nanometer" scale="0.000000001" /> <unit name="micron" scale="0.000001" /> <unit name="millimeter" scale="0.001" /> <unit name="centimeter" scale="0.01" /> <unit name="inch" scale="0.0254" /> <unit name="foot" scale="0.3048" /> <unit name="yard" scale="0.9144" /> <unit name="meter" scale="1.0" /> <unit name="kilometer" scale="1000.0" /> <unit name="mile" scale="1609.344" /> </unitdef> <unittypedef name="angle" /> <unitdef name="UD_stdlib_angle" unittype="angle"> <unit name="degree" scale="1.0" /> <unit name="radian" scale="57.295779513" /> </unitdef> <!-- ======================================================================== --> <!-- Geometric Properties --> <!-- ======================================================================== --> <geompropdef name="Pobject" type="vector3" geomprop="position" space="object" /> <geompropdef name="Nobject" type="vector3" geomprop="normal" space="object" /> <geompropdef name="Tobject" type="vector3" geomprop="tangent" space="object" index="0" /> <geompropdef name="Bobject" type="vector3" geomprop="bitangent" space="object" index="0" /> <geompropdef name="Pworld" type="vector3" geomprop="position" space="world" /> <geompropdef name="Nworld" type="vector3" geomprop="normal" space="world" /> <geompropdef name="Tworld" type="vector3" geomprop="tangent" space="world" index="0" /> <geompropdef name="Bworld" type="vector3" geomprop="bitangent" space="world" index="0" /> <geompropdef name="UV0" type="vector2" geomprop="texcoord" index="0" /> <!-- ======================================================================== --> <!-- Materials --> <!-- ======================================================================== --> <!-- Surface material --> <nodedef name="ND_surfacematerial" node="surfacematerial" nodegroup="material"> <input name="surfaceshader" type="surfaceshader" value="" /> <input name="backsurfaceshader" type="surfaceshader" value="" /> <input name="displacementshader" type="displacementshader" value="" /> <output name="out" type="material" /> </nodedef> <!-- Volume material --> <nodedef name="ND_volumematerial" node="volumematerial" nodegroup="material"> <input name="volumeshader" type="volumeshader" value="" /> <output name="out" type="material" /> </nodedef> <!-- ======================================================================== --> <!-- Shader nodes --> <!-- ======================================================================== --> <!-- Node: <surface_unlit> An unlit surface shader node. Represents a surface that can emit and transmit light, but does not receive illumination from light sources or other surfaces. --> <nodedef name="ND_surface_unlit" node="surface_unlit" nodegroup="shader" doc="Construct a surface shader from emission and transmission values."> <input name="emission" type="float" value="1.0" doc="Surface emission amount." /> <input name="emission_color" type="color3" value="1,1,1" doc="Surface emission color." /> <input name="transmission" type="float" value="0.0" doc="Surface transmission amount." /> <input name="transmission_color" type="color3" value="1,1,1" doc="Surface transmission color." /> <input name="opacity" type="float" value="1.0" doc="Surface cutout opacity." /> <output name="out" type="surfaceshader" /> </nodedef> <!-- ======================================================================== --> <!-- Texture nodes --> <!-- ======================================================================== --> <!-- Node: <image> Samples data from a single image, or from a layer within a multi-layer image. --> <nodedef name="ND_image_float" node="image" nodegroup="texture2d"> <input name="file" type="filename" value="" uiname="Filename" uniform="true" /> <input name="layer" type="string" value="" uiname="Layer" uniform="true" /> <input name="default" type="float" value="0.0" uiname="Default Color" /> <input name="texcoord" type="vector2" defaultgeomprop="UV0" uiname="Texture Coordinates" /> <input name="uaddressmode" type="string" value="periodic" enum="constant,clamp,periodic,mirror" uiname="Address Mode U" uniform="true" /> <input name="vaddressmode" type="string" value="periodic" enum="constant,clamp,periodic,mirror" uiname="Address Mode V" uniform="true" /> <input name="filtertype" type="string" value="linear" enum="closest,linear,cubic" uiname="Filter Type" uniform="true" /> <input name="framerange" type="string" value="" uiname="Frame Range" uniform="true" /> <input name="frameoffset" type="integer" value="0" uiname="Frame Offset" uniform="true" /> <input name="frameendaction" type="string" value="constant" enum="constant,clamp,periodic,mirror" uiname="Frame End Action" uniform="true" /> <output name="out" type="float" default="0.0" /> </nodedef> <nodedef name="ND_image_color3" node="image" nodegroup="texture2d"> <input name="file" type="filename" value="" uiname="Filename" uniform="true" /> <input name="layer" type="string" value="" uiname="Layer" uniform="true" /> <input name="default" type="color3" value="0.0, 0.0, 0.0" uiname="Default Color" /> <input name="texcoord" type="vector2" defaultgeomprop="UV0" uiname="Texture Coordinates" /> <input name="uaddressmode" type="string" value="periodic" enum="constant,clamp,periodic,mirror" uiname="Address Mode U" uniform="true" /> <input name="vaddressmode" type="string" value="periodic" enum="constant,clamp,periodic,mirror" uiname="Address Mode V" uniform="true" /> <input name="filtertype" type="string" value="linear" enum="closest,linear,cubic" uiname="Filter Type" uniform="true" /> <input name="framerange" type="string" value="" uiname="Frame Range" uniform="true" /> <input name="frameoffset" type="integer" value="0" uiname="Frame Offset" uniform="true" /> <input name="frameendaction" type="string" value="constant" enum="constant,clamp,periodic,mirror" uiname="Frame End Action" uniform="true" /> <output name="out" type="color3" default="0.0, 0.0, 0.0" /> </nodedef> <nodedef name="ND_image_color4" node="image" nodegroup="texture2d"> <input name="file" type="filename" value="" uiname="Filename" uniform="true" /> <input name="layer" type="string" value="" uiname="Layer" uniform="true" /> <input name="default" type="color4" value="0.0, 0.0, 0.0, 0.0" uiname="Default Color" /> <input name="texcoord" type="vector2" defaultgeomprop="UV0" uiname="Texture Coordinates" /> <input name="uaddressmode" type="string" value="periodic" enum="constant,clamp,periodic,mirror" uiname="Address Mode U" uniform="true" /> <input name="vaddressmode" type="string" value="periodic" enum="constant,clamp,periodic,mirror" uiname="Address Mode V" uniform="true" /> <input name="filtertype" type="string" value="linear" enum="closest,linear,cubic" uiname="Filter Type" uniform="true" /> <input name="framerange" type="string" value="" uiname="Frame Range" uniform="true" /> <input name="frameoffset" type="integer" value="0" uiname="Frame Offset" uniform="true" /> <input name="frameendaction" type="string" value="constant" enum="constant,clamp,periodic,mirror" uiname="Frame End Action" uniform="true" /> <output name="out" type="color4" default="0.0, 0.0, 0.0, 0.0" /> </nodedef> <nodedef name="ND_image_vector2" node="image" nodegroup="texture2d"> <input name="file" type="filename" value="" uiname="Filename" uniform="true" /> <input name="layer" type="string" value="" uiname="Layer" uniform="true" /> <input name="default" type="vector2" value="0.0, 0.0" uiname="Default Color" /> <input name="texcoord" type="vector2" defaultgeomprop="UV0" uiname="Texture Coordinates" /> <input name="uaddressmode" type="string" value="periodic" enum="constant,clamp,periodic,mirror" uiname="Address Mode U" uniform="true" /> <input name="vaddressmode" type="string" value="periodic" enum="constant,clamp,periodic,mirror" uiname="Address Mode V" uniform="true" /> <input name="filtertype" type="string" value="linear" enum="closest,linear,cubic" uiname="Filter Type" uniform="true" /> <input name="framerange" type="string" value="" uiname="Frame Range" uniform="true" /> <input name="frameoffset" type="integer" value="0" uiname="Frame Offset" uniform="true" /> <input name="frameendaction" type="string" value="constant" enum="constant,clamp,periodic,mirror" uiname="Frame End Action" uniform="true" /> <output name="out" type="vector2" default="0.0, 0.0" /> </nodedef> <nodedef name="ND_image_vector3" node="image" nodegroup="texture2d"> <input name="file" type="filename" value="" uiname="Filename" uniform="true" /> <input name="layer" type="string" value="" uiname="Layer" uniform="true" /> <input name="default" type="vector3" value="0.0, 0.0, 0.0" uiname="Default Color" /> <input name="texcoord" type="vector2" defaultgeomprop="UV0" uiname="Texture Coordinates" /> <input name="uaddressmode" type="string" value="periodic" enum="constant,clamp,periodic,mirror" uiname="Address Mode U" uniform="true" /> <input name="vaddressmode" type="string" value="periodic" enum="constant,clamp,periodic,mirror" uiname="Address Mode V" uniform="true" /> <input name="filtertype" type="string" value="linear" enum="closest,linear,cubic" uiname="Filter Type" uniform="true" /> <input name="framerange" type="string" value="" uiname="Frame Range" uniform="true" /> <input name="frameoffset" type="integer" value="0" uiname="Frame Offset" uniform="true" /> <input name="frameendaction" type="string" value="constant" enum="constant,clamp,periodic,mirror" uiname="Frame End Action" uniform="true" /> <output name="out" type="vector3" default="0.0, 0.0, 0.0" /> </nodedef> <nodedef name="ND_image_vector4" node="image" nodegroup="texture2d"> <input name="file" type="filename" value="" uiname="Filename" uniform="true" /> <input name="layer" type="string" value="" uiname="Layer" uniform="true" /> <input name="default" type="vector4" value="0.0, 0.0, 0.0, 0.0" uiname="Default Color" /> <input name="texcoord" type="vector2" defaultgeomprop="UV0" uiname="Texture Coordinates" /> <input name="uaddressmode" type="string" value="periodic" enum="constant,clamp,periodic,mirror" uiname="Address Mode U" uniform="true" /> <input name="vaddressmode" type="string" value="periodic" enum="constant,clamp,periodic,mirror" uiname="Address Mode V" uniform="true" /> <input name="filtertype" type="string" value="linear" enum="closest,linear,cubic" uiname="Filter Type" uniform="true" /> <input name="framerange" type="string" value="" uiname="Frame Range" uniform="true" /> <input name="frameoffset" type="integer" value="0" uiname="Frame Offset" uniform="true" /> <input name="frameendaction" type="string" value="constant" enum="constant,clamp,periodic,mirror" uiname="Frame End Action" uniform="true" /> <output name="out" type="vector4" default="0.0, 0.0, 0.0, 0.0" /> </nodedef> <!-- Node: <tiledimage> Supplemental Node Samples data from a single image, with provisions for tiling and offsetting the image across uv space. --> <nodedef name="ND_tiledimage_float" node="tiledimage" nodegroup="texture2d"> <input name="file" type="filename" value="" uniform="true" /> <input name="default" type="float" value="0.0" /> <input name="texcoord" type="vector2" defaultgeomprop="UV0" /> <input name="uvtiling" type="vector2" value="1.0, 1.0" /> <input name="uvoffset" type="vector2" value="0.0, 0.0" /> <input name="realworldimagesize" type="vector2" value="1.0, 1.0" unittype="distance" /> <input name="realworldtilesize" type="vector2" value="1.0, 1.0" unittype="distance" /> <input name="filtertype" type="string" value="linear" enum="closest,linear,cubic" uniform="true" /> <input name="framerange" type="string" value="" uniform="true" /> <input name="frameoffset" type="integer" value="0" uniform="true" /> <input name="frameendaction" type="string" value="constant" enum="constant,clamp,periodic,mirror" uniform="true" /> <output name="out" type="float" default="0.0" /> </nodedef> <nodedef name="ND_tiledimage_color3" node="tiledimage" nodegroup="texture2d"> <input name="file" type="filename" value="" uniform="true" /> <input name="default" type="color3" value="0.0, 0.0, 0.0" /> <input name="texcoord" type="vector2" defaultgeomprop="UV0" /> <input name="uvtiling" type="vector2" value="1.0, 1.0" /> <input name="uvoffset" type="vector2" value="0.0, 0.0" /> <input name="realworldimagesize" type="vector2" value="1.0, 1.0" unittype="distance" /> <input name="realworldtilesize" type="vector2" value="1.0, 1.0" unittype="distance" /> <input name="filtertype" type="string" value="linear" enum="closest,linear,cubic" uniform="true" /> <input name="framerange" type="string" value="" uniform="true" /> <input name="frameoffset" type="integer" value="0" uniform="true" /> <input name="frameendaction" type="string" value="constant" enum="constant,clamp,periodic,mirror" uniform="true" /> <output name="out" type="color3" default="0.0, 0.0, 0.0" /> </nodedef> <nodedef name="ND_tiledimage_color4" node="tiledimage" nodegroup="texture2d"> <input name="file" type="filename" value="" uniform="true" /> <input name="default" type="color4" value="0.0, 0.0, 0.0, 0.0" /> <input name="texcoord" type="vector2" defaultgeomprop="UV0" /> <input name="uvtiling" type="vector2" value="1.0, 1.0" /> <input name="uvoffset" type="vector2" value="0.0, 0.0" /> <input name="realworldimagesize" type="vector2" value="1.0, 1.0" unittype="distance" /> <input name="realworldtilesize" type="vector2" value="1.0, 1.0" unittype="distance" /> <input name="filtertype" type="string" value="linear" enum="closest,linear,cubic" uniform="true" /> <input name="framerange" type="string" value="" uniform="true" /> <input name="frameoffset" type="integer" value="0" uniform="true" /> <input name="frameendaction" type="string" value="constant" enum="constant,clamp,periodic,mirror" uniform="true" /> <output name="out" type="color4" default="0.0, 0.0, 0.0, 0.0" /> </nodedef> <nodedef name="ND_tiledimage_vector2" node="tiledimage" nodegroup="texture2d"> <input name="file" type="filename" value="" uniform="true" /> <input name="default" type="vector2" value="0.0, 0.0" /> <input name="texcoord" type="vector2" defaultgeomprop="UV0" /> <input name="uvtiling" type="vector2" value="1.0, 1.0" /> <input name="uvoffset" type="vector2" value="0.0, 0.0" /> <input name="realworldimagesize" type="vector2" value="1.0, 1.0" unittype="distance" /> <input name="realworldtilesize" type="vector2" value="1.0, 1.0" unittype="distance" /> <input name="filtertype" type="string" value="linear" enum="closest,linear,cubic" uniform="true" /> <input name="framerange" type="string" value="" uniform="true" /> <input name="frameoffset" type="integer" value="0" uniform="true" /> <input name="frameendaction" type="string" value="constant" enum="constant,clamp,periodic,mirror" uniform="true" /> <output name="out" type="vector2" default="0.0, 0.0" /> </nodedef> <nodedef name="ND_tiledimage_vector3" node="tiledimage" nodegroup="texture2d"> <input name="file" type="filename" value="" uniform="true" /> <input name="default" type="vector3" value="0.0, 0.0, 0.0" /> <input name="texcoord" type="vector2" defaultgeomprop="UV0" /> <input name="uvtiling" type="vector2" value="1.0, 1.0" /> <input name="uvoffset" type="vector2" value="0.0, 0.0" /> <input name="realworldimagesize" type="vector2" value="1.0, 1.0" unittype="distance" /> <input name="realworldtilesize" type="vector2" value="1.0, 1.0" unittype="distance" /> <input name="filtertype" type="string" value="linear" enum="closest,linear,cubic" uniform="true" /> <input name="framerange" type="string" value="" uniform="true" /> <input name="frameoffset" type="integer" value="0" uniform="true" /> <input name="frameendaction" type="string" value="constant" enum="constant,clamp,periodic,mirror" uniform="true" /> <output name="out" type="vector3" default="0.0, 0.0, 0.0" /> </nodedef> <nodedef name="ND_tiledimage_vector4" node="tiledimage" nodegroup="texture2d"> <input name="file" type="filename" value="" uniform="true" /> <input name="default" type="vector4" value="0.0, 0.0, 0.0, 0.0" /> <input name="texcoord" type="vector2" defaultgeomprop="UV0" /> <input name="uvtiling" type="vector2" value="1.0, 1.0" /> <input name="uvoffset" type="vector2" value="0.0, 0.0" /> <input name="realworldimagesize" type="vector2" value="1.0, 1.0" unittype="distance" /> <input name="realworldtilesize" type="vector2" value="1.0, 1.0" unittype="distance" /> <input name="filtertype" type="string" value="linear" enum="closest,linear,cubic" uniform="true" /> <input name="framerange" type="string" value="" uniform="true" /> <input name="frameoffset" type="integer" value="0" uniform="true" /> <input name="frameendaction" type="string" value="constant" enum="constant,clamp,periodic,mirror" uniform="true" /> <output name="out" type="vector4" default="0.0, 0.0, 0.0, 0.0" /> </nodedef> <!-- Node: <latlongimage> Supplemental Node Samples an equiangular map with adjustable rotation offset. --> <nodedef name="ND_latlongimage" node="latlongimage" nodegroup="texture2d"> <input name="file" type="filename" value="" uniform="true" uiname="Filename" /> <input name="default" type="color3" value="0.0, 0.0, 0.0" uiname="Default Color" /> <input name="viewdir" type="vector3" value="0.0, 0.0, 1.0" uiname="View Direction" /> <input name="rotation" type="float" value="0.0" unittype="angle" unit="degree" uimin="0" uimax="360" uiname="Longitude Offset" /> <output name="out" type="color3" default="0.0, 0.0, 0.0" /> </nodedef> <!-- Node: <hextiledimage> Supplemental Node Samples data from a single image, with provisions for hex-tiling and randomizing the image across uv space. --> <nodedef name="ND_hextiledimage_color3" node="hextiledimage" nodegroup="texture2d"> <input name="file" type="filename" value="" uniform="true" /> <input name="default" type="color3" value="0.0, 0.0, 0.0" /> <input name="texcoord" type="vector2" defaultgeomprop="UV0" /> <input name="tiling" type="vector2" value="1.0, 1.0" /> <input name="rotation" type="float" value="1.0" /> <input name="rotationrange" type="vector2" value="0.0, 360.0" /> <input name="scale" type="float" value="1.0" /> <input name="scalerange" type="vector2" value="0.5, 2.0" /> <input name="offset" type="float" value="1.0" /> <input name="offsetrange" type="vector2" value="0.0, 1.0" /> <input name="falloff" type="float" value="0.5" /> <input name="falloffcontrast" type="float" value="0.5" /> <input name="lumacoeffs" type="color3" value="0.2722287, 0.6740818, 0.0536895" enum="acescg, rec709, rec2020, rec2100" enumvalues="0.2722287,0.6740818,0.0536895, 0.2126,0.7152,0.0722, 0.2627,0.6780,0.0593, 0.2627,0.6780,0.0593" /> <output name="out" type="color3" default="0.0, 0.0, 0.0" /> </nodedef> <nodedef name="ND_hextiledimage_color4" node="hextiledimage" nodegroup="texture2d"> <input name="file" type="filename" value="" uniform="true" /> <input name="default" type="color4" value="0.0, 0.0, 0.0, 0.0" /> <input name="texcoord" type="vector2" defaultgeomprop="UV0" /> <input name="tiling" type="vector2" value="1.0, 1.0" /> <input name="rotation" type="float" value="1.0" /> <input name="rotationrange" type="vector2" value="0.0, 360.0" /> <input name="scale" type="float" value="1.0" /> <input name="scalerange" type="vector2" value="0.5, 2.0" /> <input name="offset" type="float" value="1.0" /> <input name="offsetrange" type="vector2" value="0.0, 1.0" /> <input name="falloff" type="float" value="0.5" /> <input name="falloffcontrast" type="float" value="0.5" /> <input name="lumacoeffs" type="color3" value="0.2722287, 0.6740818, 0.0536895" enum="acescg, rec709, rec2020, rec2100" enumvalues="0.2722287,0.6740818,0.0536895, 0.2126,0.7152,0.0722, 0.2627,0.6780,0.0593, 0.2627,0.6780,0.0593" /> <output name="out" type="color4" default="0.0, 0.0, 0.0, 0.0" /> </nodedef> <!-- Node: <triplanarprojection> Supplemental Node Samples data from three images, or layers within multi-layer images, and projects a tiled representation of the images along each of the three respective coordinate axes, computing an adjustable weighted blend of the three samples using the geometric normal. --> <nodedef name="ND_triplanarprojection_float" node="triplanarprojection" nodegroup="texture3d"> <input name="filex" type="filename" value="" uniform="true" /> <input name="filey" type="filename" value="" uniform="true" /> <input name="filez" type="filename" value="" uniform="true" /> <input name="layerx" type="string" value="" uniform="true" /> <input name="layery" type="string" value="" uniform="true" /> <input name="layerz" type="string" value="" uniform="true" /> <input name="default" type="float" value="0.0" /> <input name="position" type="vector3" defaultgeomprop="Pobject" /> <input name="normal" type="vector3" defaultgeomprop="Nobject" /> <input name="upaxis" type="integer" value="2" enum="X,Y,Z" enumvalues="0,1,2" uniform="true" /> <input name="blend" type="float" value="1.0" uimin="0.0" uimax="1.0" /> <input name="filtertype" type="string" value="linear" enum="closest,linear,cubic" uniform="true" /> <input name="framerange" type="string" value="" uniform="true" /> <input name="frameoffset" type="integer" value="0" uniform="true" /> <input name="frameendaction" type="string" value="constant" enum="constant,clamp,periodic,mirror" uniform="true" /> <output name="out" type="float" default="0.0" /> </nodedef> <nodedef name="ND_triplanarprojection_color3" node="triplanarprojection" nodegroup="texture3d"> <input name="filex" type="filename" value="" uniform="true" /> <input name="filey" type="filename" value="" uniform="true" /> <input name="filez" type="filename" value="" uniform="true" /> <input name="layerx" type="string" value="" uniform="true" /> <input name="layery" type="string" value="" uniform="true" /> <input name="layerz" type="string" value="" uniform="true" /> <input name="default" type="color3" value="0.0, 0.0, 0.0" /> <input name="position" type="vector3" defaultgeomprop="Pobject" /> <input name="normal" type="vector3" defaultgeomprop="Nobject" /> <input name="upaxis" type="integer" value="2" enum="X,Y,Z" enumvalues="0,1,2" uniform="true" /> <input name="blend" type="float" value="1.0" uimin="0.0" uimax="1.0" /> <input name="filtertype" type="string" value="linear" enum="closest,linear,cubic" uniform="true" /> <input name="framerange" type="string" value="" uniform="true" /> <input name="frameoffset" type="integer" value="0" uniform="true" /> <input name="frameendaction" type="string" value="constant" enum="constant,clamp,periodic,mirror" uniform="true" /> <output name="out" type="color3" default="0.0, 0.0, 0.0" /> </nodedef> <nodedef name="ND_triplanarprojection_color4" node="triplanarprojection" nodegroup="texture3d"> <input name="filex" type="filename" value="" uniform="true" /> <input name="filey" type="filename" value="" uniform="true" /> <input name="filez" type="filename" value="" uniform="true" /> <input name="layerx" type="string" value="" uniform="true" /> <input name="layery" type="string" value="" uniform="true" /> <input name="layerz" type="string" value="" uniform="true" /> <input name="default" type="color4" value="0.0, 0.0, 0.0, 0.0" /> <input name="position" type="vector3" defaultgeomprop="Pobject" /> <input name="normal" type="vector3" defaultgeomprop="Nobject" /> <input name="upaxis" type="integer" value="2" enum="X,Y,Z" enumvalues="0,1,2" uniform="true" /> <input name="blend" type="float" value="1.0" uimin="0.0" uimax="1.0" /> <input name="filtertype" type="string" value="linear" enum="closest,linear,cubic" uniform="true" /> <input name="framerange" type="string" value="" uniform="true" /> <input name="frameoffset" type="integer" value="0" uniform="true" /> <input name="frameendaction" type="string" value="constant" enum="constant,clamp,periodic,mirror" uniform="true" /> <output name="out" type="color4" default="0.0, 0.0, 0.0, 0.0" /> </nodedef> <nodedef name="ND_triplanarprojection_vector2" node="triplanarprojection" nodegroup="texture3d"> <input name="filex" type="filename" value="" uniform="true" /> <input name="filey" type="filename" value="" uniform="true" /> <input name="filez" type="filename" value="" uniform="true" /> <input name="layerx" type="string" value="" uniform="true" /> <input name="layery" type="string" value="" uniform="true" /> <input name="layerz" type="string" value="" uniform="true" /> <input name="default" type="vector2" value="0.0, 0.0" /> <input name="position" type="vector3" defaultgeomprop="Pobject" /> <input name="normal" type="vector3" defaultgeomprop="Nobject" /> <input name="upaxis" type="integer" value="2" enum="X,Y,Z" enumvalues="0,1,2" uniform="true" /> <input name="blend" type="float" value="1.0" uimin="0.0" uimax="1.0" /> <input name="filtertype" type="string" value="linear" enum="closest,linear,cubic" uniform="true" /> <input name="framerange" type="string" value="" uniform="true" /> <input name="frameoffset" type="integer" value="0" uniform="true" /> <input name="frameendaction" type="string" value="constant" enum="constant,clamp,periodic,mirror" uniform="true" /> <output name="out" type="vector2" default="0.0, 0.0" /> </nodedef> <nodedef name="ND_triplanarprojection_vector3" node="triplanarprojection" nodegroup="texture3d"> <input name="filex" type="filename" value="" uniform="true" /> <input name="filey" type="filename" value="" uniform="true" /> <input name="filez" type="filename" value="" uniform="true" /> <input name="layerx" type="string" value="" uniform="true" /> <input name="layery" type="string" value="" uniform="true" /> <input name="layerz" type="string" value="" uniform="true" /> <input name="default" type="vector3" value="0.0, 0.0, 0.0" /> <input name="position" type="vector3" defaultgeomprop="Pobject" /> <input name="normal" type="vector3" defaultgeomprop="Nobject" /> <input name="upaxis" type="integer" value="2" enum="X,Y,Z" enumvalues="0,1,2" uniform="true" /> <input name="blend" type="float" value="1.0" uimin="0.0" uimax="1.0" /> <input name="filtertype" type="string" value="linear" enum="closest,linear,cubic" uniform="true" /> <input name="framerange" type="string" value="" uniform="true" /> <input name="frameoffset" type="integer" value="0" uniform="true" /> <input name="frameendaction" type="string" value="constant" enum="constant,clamp,periodic,mirror" uniform="true" /> <output name="out" type="vector3" default="0.0, 0.0, 0.0" /> </nodedef> <nodedef name="ND_triplanarprojection_vector4" node="triplanarprojection" nodegroup="texture3d"> <input name="filex" type="filename" value="" uniform="true" /> <input name="filey" type="filename" value="" uniform="true" /> <input name="filez" type="filename" value="" uniform="true" /> <input name="layerx" type="string" value="" uniform="true" /> <input name="layery" type="string" value="" uniform="true" /> <input name="layerz" type="string" value="" uniform="true" /> <input name="default" type="vector4" value="0.0, 0.0, 0.0, 0.0" /> <input name="position" type="vector3" defaultgeomprop="Pobject" /> <input name="normal" type="vector3" defaultgeomprop="Nobject" /> <input name="upaxis" type="integer" value="2" enum="X,Y,Z" enumvalues="0,1,2" uniform="true" /> <input name="blend" type="float" value="1.0" uimin="0.0" uimax="1.0" /> <input name="filtertype" type="string" value="linear" enum="closest,linear,cubic" uniform="true" /> <input name="framerange" type="string" value="" uniform="true" /> <input name="frameoffset" type="integer" value="0" uniform="true" /> <input name="frameendaction" type="string" value="constant" enum="constant,clamp,periodic,mirror" uniform="true" /> <output name="out" type="vector4" default="0.0, 0.0, 0.0, 0.0" /> </nodedef> <!-- ======================================================================== --> <!-- Procedural nodes --> <!-- ======================================================================== --> <!-- Node: <constant> A constant value. When exposed as a public parameter, this is a way to create a value that can be accessed in multiple places in the opgraph. --> <nodedef name="ND_constant_float" node="constant" nodegroup="procedural"> <input name="value" type="float" value="0.0" /> <output name="out" type="float" default="0.0" /> </nodedef> <nodedef name="ND_constant_color3" node="constant" nodegroup="procedural"> <input name="value" type="color3" value="0.0, 0.0, 0.0" /> <output name="out" type="color3" default="0.0, 0.0, 0.0" /> </nodedef> <nodedef name="ND_constant_color4" node="constant" nodegroup="procedural"> <input name="value" type="color4" value="0.0, 0.0, 0.0, 0.0" /> <output name="out" type="color4" default="0.0, 0.0, 0.0, 0.0" /> </nodedef> <nodedef name="ND_constant_vector2" node="constant" nodegroup="procedural"> <input name="value" type="vector2" value="0.0, 0.0" /> <output name="out" type="vector2" default="0.0, 0.0" /> </nodedef> <nodedef name="ND_constant_vector3" node="constant" nodegroup="procedural"> <input name="value" type="vector3" value="0.0, 0.0, 0.0" /> <output name="out" type="vector3" default="0.0, 0.0, 0.0" /> </nodedef> <nodedef name="ND_constant_vector4" node="constant" nodegroup="procedural"> <input name="value" type="vector4" value="0.0, 0.0, 0.0, 0.0" /> <output name="out" type="vector4" default="0.0, 0.0, 0.0, 0.0" /> </nodedef> <nodedef name="ND_constant_boolean" node="constant" nodegroup="procedural"> <input name="value" type="boolean" value="false" /> <output name="out" type="boolean" default="false" /> </nodedef> <nodedef name="ND_constant_integer" node="constant" nodegroup="procedural"> <input name="value" type="integer" value="0" /> <output name="out" type="integer" default="0" /> </nodedef> <nodedef name="ND_constant_matrix33" node="constant" nodegroup="procedural"> <input name="value" type="matrix33" value="1.0,0.0,0.0, 0.0,1.0,0.0, 0.0,0.0,1.0" /> <output name="out" type="matrix33" default="1.0,0.0,0.0, 0.0,1.0,0.0, 0.0,0.0,1.0" /> </nodedef> <nodedef name="ND_constant_matrix44" node="constant" nodegroup="procedural"> <input name="value" type="matrix44" value="1.0,0.0,0.0,0.0, 0.0,1.0,0.0,0.0, 0.0,0.0,1.0,0.0, 0.0,0.0,0.0,1.0" /> <output name="out" type="matrix44" default="1.0,0.0,0.0,0.0, 0.0,1.0,0.0,0.0, 0.0,0.0,1.0,0.0, 0.0,0.0,0.0,1.0" /> </nodedef> <nodedef name="ND_constant_string" node="constant" nodegroup="procedural"> <input name="value" type="string" value="" uniform="true" /> <output name="out" type="string" default="" /> </nodedef> <nodedef name="ND_constant_filename" node="constant" nodegroup="procedural"> <input name="value" type="filename" value="" uniform="true" /> <output name="out" type="filename" default="" /> </nodedef> <!-- Node: <ramp> A ramp that supports up to 10 control points. --> <nodedef name="ND_ramp" node="ramp" nodegroup="procedural2d"> <input name="texcoord" type="vector2" defaultgeomprop="UV0" /> <input name="type" type="integer" value="0" enum="standard,radial,circular,box" enumvalues="0,1,2,3" /> <input name="interpolation" type="integer" value="1" enum="linear,smooth,step" enumvalues="0,1,2" /> <input name="num_intervals" type="integer" value="2" uimin="2" uimax="10" /> <input name="interval1" type="float" value="0" uimin="0" uimax="1" /> <input name="color1" type="color4" value="0,0,0,1" uimin="0,0,0,0" uimax="1,1,1,1" /> <input name="interval2" type="float" value="1" uimin="0" uimax="1" /> <input name="color2" type="color4" value="1,1,1,1" uimin="0,0,0,0" uimax="1,1,1,1" /> <input name="interval3" type="float" value="1" uimin="0" uimax="1" /> <input name="color3" type="color4" value="1,1,1,1" uimin="0,0,0,0" uimax="1,1,1,1" /> <input name="interval4" type="float" value="1" uimin="0" uimax="1" /> <input name="color4" type="color4" value="1,1,1,1" uimin="0,0,0,0" uimax="1,1,1,1" /> <input name="interval5" type="float" value="1" uimin="0" uimax="1" /> <input name="color5" type="color4" value="1,1,1,1" uimin="0,0,0,0" uimax="1,1,1,1" /> <input name="interval6" type="float" value="1" uimin="0" uimax="1" /> <input name="color6" type="color4" value="1,1,1,1" uimin="0,0,0,0" uimax="1,1,1,1" /> <input name="interval7" type="float" value="1" uimin="0" uimax="1" /> <input name="color7" type="color4" value="1,1,1,1" uimin="0,0,0,0" uimax="1,1,1,1" /> <input name="interval8" type="float" value="1" uimin="0" uimax="1" /> <input name="color8" type="color4" value="1,1,1,1" uimin="0,0,0,0" uimax="1,1,1,1" /> <input name="interval9" type="float" value="1" uimin="0" uimax="1" /> <input name="color9" type="color4" value="1,1,1,1" uimin="0,0,0,0" uimax="1,1,1,1" /> <input name="interval10" type="float" value="1" uimin="0" uimax="1" /> <input name="color10" type="color4" value="1,1,1,1" uimin="0,0,0,0" uimax="1,1,1,1" /> <output name="out" type="color4" /> </nodedef> <!-- Node <ramp_gradient> A helper node that handles a single control point within a <ramp>. --> <nodedef name="ND_ramp_gradient" node="ramp_gradient" nodegroup="procedural2d"> <input name="x" type="float" value="0" uimin="0" uimax="1" /> <input name="interval1" type="float" value="0" uimin="0" uimax="1" /> <input name="interval2" type="float" value="1" uimin="0" uimax="1" /> <input name="color1" type="color4" value="0,0,0,1" uimin="0,0,0,0" uimax="1,1,1,1" /> <input name="color2" type="color4" value="1,1,1,1" uimin="0,0,0,0" uimax="1,1,1,1" /> <input name="interpolation" type="integer" value="1" enum="linear,smooth,step" enumvalues="0,1,2" /> <input name="prev_color" type="color4" value="0,0,0,1" uimin