Provides access to various functionality related to MDL distilling. More...
Public Member Functions | |
virtual Size | get_target_count () const =0 |
Returns the number of targets supported for distilling. More... | |
virtual const char * | get_target_name (Size index) const =0 |
Returns the index -th target name supported for distilling, or NULL if index is out of bounds. More... | |
virtual const ICompiled_material * | distill_material (const ICompiled_material *material, const char *target, const IMap *distiller_options=0, Sint32 *errors=0) const =0 |
Distills a material. More... | |
virtual const IBaker * | create_baker (const ICompiled_material *material, const char *path, Baker_resource resource=BAKE_ON_CPU, Uint32 gpu_device_id=0) const =0 |
Creates a baker for texture baking. More... | |
Additional Inherited Members | |
![]() | |
typedef Interface_declare< id1, id2, id3, id4, id5, id6, id7, id8, id9, id10, id11, IInterface > | Self |
Own type. More... | |
typedef Uuid_t< id1, id2, id3, id4, id5, id6, id7, id8, id9, id10, id11 > | IID |
Declares the interface ID (IID) of this interface. More... | |
![]() | |
static bool | compare_iid (const Uuid &iid) |
Compares the interface ID iid against the interface ID of this interface and of its ancestors. More... | |
Provides access to various functionality related to MDL distilling.
|
pure virtual |
Creates a baker for texture baking.
material | The material of which a subexpression is to be baked. |
path | The path from the material root to the expression that should be baked, e.g., "surface.scattering.tint" . |
resource | The resource to be used for baking. |
gpu_device_id | The device ID of the GPU to be used for baking (as identified by the CUDA runtime or driver API). Ignored if resource is BAKE_ON_CPU. |
path
, or NULL
in case of failure. Note that returned baker depends on the transaction that was used to access the material.
|
pure virtual |
Distills a material.
Material distilling refers to the translation of an arbitrary input material to a predefined target model. Supported target models are
Depending on the structure of the input material and the complexity of the target model the resulting material can be as simple as a single bsdf or a set of bsdfs combined using layerers and mixes as illustrated in the table below using a pseudo-mdl notation.
diffuse | surface.scattering = diffuse_reflection_bsdf geometry.normal = () |
diffuse_glossy | surface.scattering = fresnel_layer(layer: simple_glossy_bsdf, base: diffuse_reflection_bsdf) geometry.normal = () |
surface.scattering = diffuse_reflection_bsdf geometry.normal = () | |
surface.scattering = simple_glossy_bsdf geometry.normal = () | |
specular_glossy | surface.scattering = custom_curve_layer(layer: bsdf_glossy_ggx_vcavities, base: diffuse_reflection_bsdf) geometry.normal = () |
Any subset of the above construct, see diffuse_glossy . | |
ue4 | surface.scattering = custom_curve_layer( // clearcoat layer: bsdf_glossy_ggx_vcavities, base: weighted_layer( layer: normalized_mix( bsdf_glossy_ggx_vcavities, custom_curve_layer( layer: bsdf_glossy_ggx_vcavities, base: diffuse_reflection_bsdf)), normal: () // under-clearcoat normal ), normal: () // clearcoat normal ) |
A weighted_layer of any subset of the above construct with an optional clearcoat on top. |
material | The material to be distilled. |
target | The target model. See get_target_count() and get_target_name(). |
distiller_options | Options for the distiller. Supported options are:
|
errors | An optional pointer to an mi::Sint32 to which an error code will be written. The error codes have the following meaning:
|
NULL
in case of failure.
|
pure virtual |
Returns the number of targets supported for distilling.
|
pure virtual |
Returns the index
-th target name supported for distilling, or NULL
if index
is out of bounds.