Material Definition Language API nvidia_logo_transpbg.gif Up
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
MDL compiler

This module contains the MDL API components representing the MDL compiler, its backends and the generated target code. More...

Classes

class  mi::neuraylib::IMdl_compiler
 The MDL compiler allows to import and export .mdl files, to examine their contents, to create a compiled representation of these via a backend, and to export image canvases, light profiles and measured BSDF data. More...
 
class  mi::neuraylib::IMdl_backend
 MDL backends allow to transform compiled material instances or function calls into target code. More...
 
class  mi::neuraylib::ITarget_resource_callback
 A callback interface to allow the user to handle resources when creating new mi::neuraylib::ITarget_argument_block objects for class-compiled materials when the arguments contain textures not known during compilation. More...
 
class  mi::neuraylib::ITarget_argument_block
 Represents an argument block of a class-compiled material compiled for a specific target. More...
 
struct  mi::neuraylib::Target_value_layout_state
 Structure representing the state during traversal of the nested layout. More...
 
class  mi::neuraylib::ITarget_value_layout
 Represents the layout of an mi::neuraylib::ITarget_argument_block with support for nested elements. More...
 
class  mi::neuraylib::ITarget_code
 Represents target code of an MDL backend. More...
 
class  mi::neuraylib::ILink_unit
 Represents a link-unit of an MDL backend. More...
 
struct  mi::neuraylib::Texture_handler_vtable
 The runtime for bitmap texture access for the generated target code can optionally be implemented in form of a vtable as specified by this structure. More...
 
struct  mi::neuraylib::Texture_handler_base
 The texture handler structure that is passed to the texturing functions. More...
 
struct  mi::neuraylib::Shading_state_material
 The MDL material state structure inside the MDL SDK is a representation of the renderer state as defined in section 19 "Renderer state" in the MDL specification. More...
 
struct  mi::neuraylib::Shading_state_environment
 The MDL environment state structure inside the MDL SDK is a representation of the renderer state in the context of an environment lookup as defined in section 19 "Renderer state" in the MDL specification. More...
 
struct  mi::neuraylib::Resource_data
 The data structure providing access to resources for generated code. More...
 
struct  mi::neuraylib::Bsdf_sample_data
 Input and output structure for BSDF sampling data. More...
 
struct  mi::neuraylib::Bsdf_evaluate_data
 Input and output structure for BSDF evaluation data. More...
 
struct  mi::neuraylib::Bsdf_pdf_data
 Input and output structure for BSDF PDF calculation data. More...
 
struct  mi::neuraylib::Edf_sample_data
 Input and output structure for EDF sampling data. More...
 
struct  mi::neuraylib::Edf_evaluate_data
 Input and output structure for EDF evaluation data. More...
 
struct  mi::neuraylib::Edf_pdf_data
 Input and output structure for EDF PDF calculation data. More...
 

Macros

#define MI_NEURAYLIB_BSDF_USE_MATERIAL_IOR   (-1.0f)
 The calling code can mark the x component of an IOR field in *_data with MI_NEURAYLIB_BSDF_USE_MATERIAL_IOR, to make the BSDF functions use the MDL material's IOR for this IOR field. More...
 

Typedefs

typedef void( mi::neuraylib::Environment_function )(void *result, const Shading_state_environment *state, const Resource_data *res_data, const void *exception_state, const char *arg_block_data)
 Signature of environment functions created via mi::neuraylib::IMdl_backend::translate_environment() and mi::neuraylib::ILink_unit::add_environment(). More...
 
typedef void( mi::neuraylib::Material_expr_function )(void *result, const Shading_state_material *state, const Resource_data *res_data, const void *exception_state, const char *arg_block_data)
 Signature of material expression functions created via mi::neuraylib::IMdl_backend::translate_material_expression() and mi::neuraylib::ILink_unit::add_material_expression(). More...
 
typedef void( mi::neuraylib::Bsdf_init_function )(Shading_state_material *state, const Resource_data *res_data, const void *exception_state, const char *arg_block_data)
 Signature of the initialization function for material distribution functions created via mi::neuraylib::IMdl_backend::translate_material_df() and mi::neuraylib::ILink_unit::add_material_df(). More...
 
typedef void( mi::neuraylib::Bsdf_sample_function )(Bsdf_sample_data *data, const Shading_state_material *state, const Resource_data *res_data, const void *exception_state, const char *arg_block_data)
 Signature of the importance sampling function for material distribution functions created via mi::neuraylib::IMdl_backend::translate_material_df() and mi::neuraylib::ILink_unit::add_material_df(). More...
 
typedef void( mi::neuraylib::Bsdf_evaluate_function )(Bsdf_evaluate_data *data, const Shading_state_material *state, const Resource_data *res_data, const void *exception_state, const char *arg_block_data)
 Signature of the evaluation function for material distribution functions created via mi::neuraylib::IMdl_backend::translate_material_df() and mi::neuraylib::ILink_unit::add_material_df(). More...
 
typedef void( mi::neuraylib::Bsdf_pdf_function )(Bsdf_pdf_data *data, const Shading_state_material *state, const Resource_data *res_data, const void *exception_state, const char *arg_block_data)
 Signature of the probability density function for material distribution functions created via mi::neuraylib::IMdl_backend::translate_material_df() and mi::neuraylib::ILink_unit::add_material_df(). More...
 
typedef void( mi::neuraylib::Edf_init_function )(Shading_state_material *state, Resource_data const *res_data, void const *exception_state, char const *arg_block_data)
 Signature of the initialization function for material distribution functions created via mi::neuraylib::IMdl_backend::translate_material_df() and mi::neuraylib::ILink_unit::add_material_df(). More...
 
typedef void( mi::neuraylib::Edf_sample_function )(Edf_sample_data *data, Shading_state_material const *state, Resource_data const *res_data, void const *exception_state, char const *arg_block_data)
 Signature of the importance sampling function for material distribution functions created via mi::neuraylib::IMdl_backend::translate_material_df() and mi::neuraylib::ILink_unit::add_material_df(). More...
 
typedef void( mi::neuraylib::Edf_evaluate_function )(Edf_evaluate_data *data, Shading_state_material const *state, Resource_data const *res_data, void const *exception_state, char const *arg_block_data)
 Signature of the evaluation function for material distribution functions created via mi::neuraylib::IMdl_backend::translate_material_df() and mi::neuraylib::ILink_unit::add_material_df(). More...
 
typedef void( mi::neuraylib::Edf_pdf_function )(Edf_pdf_data *data, Shading_state_material const *state, Resource_data const *res_data, void const *exception_state, char const *arg_block_data)
 Signature of the probability density function for material distribution functions created via mi::neuraylib::IMdl_backend::translate_material_df() and mi::neuraylib::ILink_unit::add_material_df(). More...
 

Enumerations

enum  mi::neuraylib::Tex_wrap_mode {
  mi::neuraylib::TEX_WRAP_CLAMP = 0,
  mi::neuraylib::TEX_WRAP_REPEAT = 1,
  mi::neuraylib::TEX_WRAP_MIRRORED_REPEAT = 2,
  mi::neuraylib::TEX_WRAP_CLIP = 3
}
 The texture wrap modes as defined by tex::wrap_mode in the MDL specification. More...
 
enum  mi::neuraylib::Bsdf_event_type
 The type of events created by BSDF importance sampling. More...
 
enum  mi::neuraylib::Edf_event_type
 The type of events created by EDF importance sampling. More...
 

Variables

void(* mi::neuraylib::Texture_handler_vtable::m_tex_lookup_float4_2d )(tct_float result[4], const Texture_handler_base *self, tct_uint texture_idx, const tct_float coord[2], Tex_wrap_mode wrap_u, Tex_wrap_mode wrap_v, const tct_float crop_u[2], const tct_float crop_v[2])
 Implementation of tex::lookup_float4() for a texture_2d texture. More...
 
void(* mi::neuraylib::Texture_handler_vtable::m_tex_lookup_float3_2d )(tct_float result[3], const Texture_handler_base *self, tct_uint texture_idx, const tct_float coord[2], Tex_wrap_mode wrap_u, Tex_wrap_mode wrap_v, const tct_float crop_u[2], const tct_float crop_v[2])
 Implementation of tex::lookup_float3() for a texture_2d texture. More...
 
void(* mi::neuraylib::Texture_handler_vtable::m_tex_texel_float4_2d )(tct_float result[4], const Texture_handler_base *self, tct_uint texture_idx, const tct_int coord[2], const tct_int uv_tile[2])
 Implementation of tex::texel_float4() for a texture_2d texture. More...
 
void(* mi::neuraylib::Texture_handler_vtable::m_tex_lookup_float4_3d )(tct_float result[4], const Texture_handler_base *self, tct_uint texture_idx, const tct_float coord[3], Tex_wrap_mode wrap_u, Tex_wrap_mode wrap_v, Tex_wrap_mode wrap_w, const tct_float crop_u[2], const tct_float crop_v[2], const tct_float crop_w[2])
 Implementation of tex::lookup_float4() for a texture_3d texture. More...
 
void(* mi::neuraylib::Texture_handler_vtable::m_tex_lookup_float3_3d )(tct_float result[3], const Texture_handler_base *self, tct_uint texture_idx, const tct_float coord[3], Tex_wrap_mode wrap_u, Tex_wrap_mode wrap_v, Tex_wrap_mode wrap_w, const tct_float crop_u[2], const tct_float crop_v[2], const tct_float crop_w[2])
 Implementation of tex::lookup_float3() for a texture_3d texture. More...
 
void(* mi::neuraylib::Texture_handler_vtable::m_tex_texel_float4_3d )(tct_float result[4], const Texture_handler_base *self, tct_uint texture_idx, const tct_int coord[3])
 Implementation of tex::texel_float4() for a texture_3d texture. More...
 
void(* mi::neuraylib::Texture_handler_vtable::m_tex_lookup_float4_cube )(tct_float result[4], const Texture_handler_base *self, tct_uint texture_idx, const tct_float coord[3])
 Implementation of tex::lookup_float4() for a texture_cube texture. More...
 
void(* mi::neuraylib::Texture_handler_vtable::m_tex_lookup_float3_cube )(tct_float result[3], const Texture_handler_base *self, tct_uint texture_idx, const tct_float coord[3])
 Implementation of tex::lookup_float3() for a texture_cube texture. More...
 
void(* mi::neuraylib::Texture_handler_vtable::m_tex_resolution_2d )(tct_int result[2], const Texture_handler_base *self, tct_uint texture_idx, const tct_int uv_tile[2])
 Implementation of resolution_2d function needed by generated code, which retrieves the width and height of the given texture. More...
 
const Texture_handler_vtable * mi::neuraylib::Texture_handler_base::vtable
 In vtable-mode, the vtable field is used to call the texturing functions. More...
 
tct_float3 mi::neuraylib::Shading_state_material::normal
 The result of state::normal(). More...
 
tct_float3 mi::neuraylib::Shading_state_material::geom_normal
 The result of state::geometry_normal(). More...
 
tct_float3 mi::neuraylib::Shading_state_material::position
 The result of state::position(). More...
 
tct_float mi::neuraylib::Shading_state_material::animation_time
 The result of state::animation_time(). More...
 
const tct_float3 * mi::neuraylib::Shading_state_material::text_coords
 An array containing the results of state::texture_coordinate(i). More...
 
const tct_float3 * mi::neuraylib::Shading_state_material::tangent_u
 An array containing the results of state::texture_tangent_u(i). More...
 
const tct_float3 * mi::neuraylib::Shading_state_material::tangent_v
 An array containing the results of state::texture_tangent_v(i). More...
 
tct_float4 * mi::neuraylib::Shading_state_material::text_results
 The texture results lookup table. More...
 
const char * mi::neuraylib::Shading_state_material::ro_data_segment
 A pointer to a read-only data segment. More...
 
const tct_float4 * mi::neuraylib::Shading_state_material::world_to_object
 A 4x4 transformation matrix transforming from world to object coordinates. More...
 
const tct_float4 * mi::neuraylib::Shading_state_material::object_to_world
 A 4x4 transformation matrix transforming from object to world coordinates. More...
 
tct_int mi::neuraylib::Shading_state_material::object_id
 The result of state::object_id(). More...
 
tct_float3 mi::neuraylib::Shading_state_environment::direction
 The result of state::direction(). More...
 
const void * mi::neuraylib::Resource_data::shared_data
 currently unused, should be NULL More...
 
const Texture_handler_base * mi::neuraylib::Resource_data::texture_handler
 will be provided as "self" parameter to texture functions More...
 
tct_float3 mi::neuraylib::Bsdf_sample_data::ior1
 IOR current medium. More...
 
tct_float3 mi::neuraylib::Bsdf_sample_data::ior2
 IOR other side. More...
 
tct_float3 mi::neuraylib::Bsdf_sample_data::k1
 outgoing direction More...
 
tct_float3 mi::neuraylib::Bsdf_sample_data::xi
 pseudo-random sample number More...
 
tct_float3 mi::neuraylib::Bsdf_sample_data::k2
 incoming direction More...
 
tct_float mi::neuraylib::Bsdf_sample_data::pdf
 pdf (non-projected hemisphere) More...
 
tct_float3 mi::neuraylib::Bsdf_sample_data::bsdf_over_pdf
 bsdf * dot(normal, k2) / pdf More...
 
Bsdf_event_type mi::neuraylib::Bsdf_sample_data::event_type
 the type of event for the generated sample More...
 
tct_float3 mi::neuraylib::Bsdf_evaluate_data::ior1
 IOR current medium. More...
 
tct_float3 mi::neuraylib::Bsdf_evaluate_data::ior2
 IOR other side. More...
 
tct_float3 mi::neuraylib::Bsdf_evaluate_data::k1
 outgoing direction More...
 
tct_float3 mi::neuraylib::Bsdf_evaluate_data::k2
 incoming direction More...
 
tct_float3 mi::neuraylib::Bsdf_evaluate_data::bsdf
 bsdf * dot(normal, k2) More...
 
tct_float mi::neuraylib::Bsdf_evaluate_data::pdf
 pdf (non-projected hemisphere) More...
 
tct_float3 mi::neuraylib::Bsdf_pdf_data::ior1
 IOR current medium. More...
 
tct_float3 mi::neuraylib::Bsdf_pdf_data::ior2
 IOR other side. More...
 
tct_float3 mi::neuraylib::Bsdf_pdf_data::k1
 outgoing direction More...
 
tct_float3 mi::neuraylib::Bsdf_pdf_data::k2
 incoming direction More...
 
tct_float mi::neuraylib::Bsdf_pdf_data::pdf
 pdf (non-projected hemisphere) More...
 
tct_float3 mi::neuraylib::Edf_sample_data::xi
 pseudo-random sample number More...
 
float mi::neuraylib::Edf_sample_data::pdf
 < outgoing direction More...
 
tct_float3 mi::neuraylib::Edf_sample_data::edf_over_pdf
 < pdf (non-projected hemisphere) More...
 
Edf_event_type mi::neuraylib::Edf_sample_data::event_type
 < edf * dot(normal,k1) / pdf More...
 
tct_float3 mi::neuraylib::Edf_evaluate_data::k1
 outgoing direction More...
 
float mi::neuraylib::Edf_evaluate_data::cos
 dot(normal, k1) More...
 
tct_float3 mi::neuraylib::Edf_evaluate_data::edf
 edf More...
 
float mi::neuraylib::Edf_evaluate_data::pdf
 pdf (non-projected hemisphere) More...
 
tct_float3 mi::neuraylib::Edf_pdf_data::k1
 outgoing direction More...
 
float mi::neuraylib::Edf_pdf_data::pdf
 pdf (non-projected hemisphere) More...
 

Detailed Description

This module contains the MDL API components representing the MDL compiler, its backends and the generated target code.

The MDL compiler can be obtained from mi::neuraylib::INeuray::get_api_component(). The backends can be obtained via the MDL compiler from mi::neuraylib::IMdl_compiler::get_backend().

Macro Definition Documentation

#define MI_NEURAYLIB_BSDF_USE_MATERIAL_IOR   (-1.0f)

The calling code can mark the x component of an IOR field in *_data with MI_NEURAYLIB_BSDF_USE_MATERIAL_IOR, to make the BSDF functions use the MDL material's IOR for this IOR field.

Typedef Documentation

typedef void( mi::neuraylib::Bsdf_evaluate_function)(Bsdf_evaluate_data *data, const Shading_state_material *state, const Resource_data *res_data, const void *exception_state, const char *arg_block_data)

Signature of the evaluation function for material distribution functions created via mi::neuraylib::IMdl_backend::translate_material_df() and mi::neuraylib::ILink_unit::add_material_df().

Parameters
datathe input and output structure
statethe shading state
res_datathe resources
exception_stateunused, should be NULL
arg_block_datathe target argument block data, if class compilation was used
typedef void( mi::neuraylib::Bsdf_init_function)(Shading_state_material *state, const Resource_data *res_data, const void *exception_state, const char *arg_block_data)

Signature of the initialization function for material distribution functions created via mi::neuraylib::IMdl_backend::translate_material_df() and mi::neuraylib::ILink_unit::add_material_df().

This function updates the normal field of the shading state with the result of "geometry.normal" and, if the "num_texture_results" backend option has been set to non-zero, fills the text_results fields of the state.

Parameters
statethe shading state
res_datathe resources
exception_stateunused, should be NULL
arg_block_datathe target argument block data, if class compilation was used
typedef void( mi::neuraylib::Bsdf_pdf_function)(Bsdf_pdf_data *data, const Shading_state_material *state, const Resource_data *res_data, const void *exception_state, const char *arg_block_data)

Signature of the probability density function for material distribution functions created via mi::neuraylib::IMdl_backend::translate_material_df() and mi::neuraylib::ILink_unit::add_material_df().

Parameters
datathe input and output structure
statethe shading state
res_datathe resources
exception_stateunused, should be NULL
arg_block_datathe target argument block data, if class compilation was used
typedef void( mi::neuraylib::Bsdf_sample_function)(Bsdf_sample_data *data, const Shading_state_material *state, const Resource_data *res_data, const void *exception_state, const char *arg_block_data)

Signature of the importance sampling function for material distribution functions created via mi::neuraylib::IMdl_backend::translate_material_df() and mi::neuraylib::ILink_unit::add_material_df().

Parameters
datathe input and output structure
statethe shading state
res_datathe resources
exception_stateunused, should be NULL
arg_block_datathe target argument block data, if class compilation was used
typedef void( mi::neuraylib::Edf_evaluate_function)(Edf_evaluate_data *data, Shading_state_material const *state, Resource_data const *res_data, void const *exception_state, char const *arg_block_data)

Signature of the evaluation function for material distribution functions created via mi::neuraylib::IMdl_backend::translate_material_df() and mi::neuraylib::ILink_unit::add_material_df().

Parameters
datathe input and output structure
statethe shading state
res_datathe resources
exception_stateunused, should be NULL
arg_block_datathe target argument block data, if class compilation was used
typedef void( mi::neuraylib::Edf_init_function)(Shading_state_material *state, Resource_data const *res_data, void const *exception_state, char const *arg_block_data)

Signature of the initialization function for material distribution functions created via mi::neuraylib::IMdl_backend::translate_material_df() and mi::neuraylib::ILink_unit::add_material_df().

This function updates the normal field of the shading state with the result of "geometry.normal" and, if the "num_texture_results" backend option has been set to non-zero, fills the text_results fields of the state.

Parameters
statethe shading state
res_datathe resources
exception_stateunused, should be NULL
arg_block_datathe target argument block data, if class compilation was used
typedef void( mi::neuraylib::Edf_pdf_function)(Edf_pdf_data *data, Shading_state_material const *state, Resource_data const *res_data, void const *exception_state, char const *arg_block_data)

Signature of the probability density function for material distribution functions created via mi::neuraylib::IMdl_backend::translate_material_df() and mi::neuraylib::ILink_unit::add_material_df().

Parameters
datathe input and output structure
statethe shading state
res_datathe resources
exception_stateunused, should be NULL
arg_block_datathe target argument block data, if class compilation was used
typedef void( mi::neuraylib::Edf_sample_function)(Edf_sample_data *data, Shading_state_material const *state, Resource_data const *res_data, void const *exception_state, char const *arg_block_data)

Signature of the importance sampling function for material distribution functions created via mi::neuraylib::IMdl_backend::translate_material_df() and mi::neuraylib::ILink_unit::add_material_df().

Parameters
datathe input and output structure
statethe shading state
res_datathe resources
exception_stateunused, should be NULL
arg_block_datathe target argument block data, if class compilation was used
typedef void( mi::neuraylib::Environment_function)(void *result, const Shading_state_environment *state, const Resource_data *res_data, const void *exception_state, const char *arg_block_data)

Signature of environment functions created via mi::neuraylib::IMdl_backend::translate_environment() and mi::neuraylib::ILink_unit::add_environment().

Parameters
resultpointer to the result buffer which must be large enough for the result
statethe shading state
res_datathe resources
exception_stateunused, should be NULL
arg_block_dataunused, should be NULL
typedef void( mi::neuraylib::Material_expr_function)(void *result, const Shading_state_material *state, const Resource_data *res_data, const void *exception_state, const char *arg_block_data)

Signature of material expression functions created via mi::neuraylib::IMdl_backend::translate_material_expression() and mi::neuraylib::ILink_unit::add_material_expression().

Parameters
resultpointer to the result buffer which must be large enough for the result
statethe shading state
res_datathe resources
exception_stateunused, should be NULL
arg_block_datathe target argument block data, if class compilation was used

Enumeration Type Documentation

The type of events created by BSDF importance sampling.

The type of events created by EDF importance sampling.

The texture wrap modes as defined by tex::wrap_mode in the MDL specification.

It determines the texture lookup behavior if a lookup coordinate is exceeding the normalized half-open texture space range of [0, 1).

Enumerator
TEX_WRAP_CLAMP 

tex::wrap_clamp: clamps the lookup coordinate to the range

TEX_WRAP_REPEAT 

tex::wrap_repeat: takes the fractional part of the lookup coordinate effectively repeating the texture along this axis

TEX_WRAP_MIRRORED_REPEAT 

tex::wrap_mirrored_repeat: like wrap_repeat but takes one minus the fractional part every other interval to mirror every second instance of the texture

TEX_WRAP_CLIP 

tex::wrap_clip: makes the texture lookup return zero for texture coordinates outside of the range

Variable Documentation

tct_float mi::neuraylib::Shading_state_material::animation_time

The result of state::animation_time().

It represents the time of the current sample in seconds.

tct_float3 mi::neuraylib::Bsdf_evaluate_data::bsdf

bsdf * dot(normal, k2)

tct_float3 mi::neuraylib::Bsdf_sample_data::bsdf_over_pdf

bsdf * dot(normal, k2) / pdf

float mi::neuraylib::Edf_evaluate_data::cos

dot(normal, k1)

tct_float3 mi::neuraylib::Shading_state_environment::direction

The result of state::direction().

It represents the lookup direction for the environment lookup.

tct_float3 mi::neuraylib::Edf_evaluate_data::edf

edf

tct_float3 mi::neuraylib::Edf_sample_data::edf_over_pdf

< pdf (non-projected hemisphere)

Bsdf_event_type mi::neuraylib::Bsdf_sample_data::event_type

the type of event for the generated sample

Edf_event_type mi::neuraylib::Edf_sample_data::event_type

< edf * dot(normal,k1) / pdf

tct_float3 mi::neuraylib::Shading_state_material::geom_normal

The result of state::geometry_normal().

It represents the geometry normal as determined by the renderer.

tct_float3 mi::neuraylib::Bsdf_sample_data::ior1

IOR current medium.

tct_float3 mi::neuraylib::Bsdf_evaluate_data::ior1

IOR current medium.

tct_float3 mi::neuraylib::Bsdf_pdf_data::ior1

IOR current medium.

tct_float3 mi::neuraylib::Bsdf_sample_data::ior2

IOR other side.

tct_float3 mi::neuraylib::Bsdf_evaluate_data::ior2

IOR other side.

tct_float3 mi::neuraylib::Bsdf_pdf_data::ior2

IOR other side.

tct_float3 mi::neuraylib::Bsdf_sample_data::k1

outgoing direction

tct_float3 mi::neuraylib::Bsdf_evaluate_data::k1

outgoing direction

tct_float3 mi::neuraylib::Bsdf_pdf_data::k1

outgoing direction

tct_float3 mi::neuraylib::Edf_evaluate_data::k1

outgoing direction

tct_float3 mi::neuraylib::Edf_pdf_data::k1

outgoing direction

tct_float3 mi::neuraylib::Bsdf_sample_data::k2

incoming direction

tct_float3 mi::neuraylib::Bsdf_evaluate_data::k2

incoming direction

tct_float3 mi::neuraylib::Bsdf_pdf_data::k2

incoming direction

void(* mi::neuraylib::Texture_handler_vtable::m_tex_lookup_float3_2d)(tct_float result[3], const Texture_handler_base *self, tct_uint texture_idx, const tct_float coord[2], Tex_wrap_mode wrap_u, Tex_wrap_mode wrap_v, const tct_float crop_u[2], const tct_float crop_v[2])

Implementation of tex::lookup_float3() for a texture_2d texture.

void(* mi::neuraylib::Texture_handler_vtable::m_tex_lookup_float3_3d)(tct_float result[3], const Texture_handler_base *self, tct_uint texture_idx, const tct_float coord[3], Tex_wrap_mode wrap_u, Tex_wrap_mode wrap_v, Tex_wrap_mode wrap_w, const tct_float crop_u[2], const tct_float crop_v[2], const tct_float crop_w[2])

Implementation of tex::lookup_float3() for a texture_3d texture.

void(* mi::neuraylib::Texture_handler_vtable::m_tex_lookup_float3_cube)(tct_float result[3], const Texture_handler_base *self, tct_uint texture_idx, const tct_float coord[3])

Implementation of tex::lookup_float3() for a texture_cube texture.

void(* mi::neuraylib::Texture_handler_vtable::m_tex_lookup_float4_2d)(tct_float result[4], const Texture_handler_base *self, tct_uint texture_idx, const tct_float coord[2], Tex_wrap_mode wrap_u, Tex_wrap_mode wrap_v, const tct_float crop_u[2], const tct_float crop_v[2])

Implementation of tex::lookup_float4() for a texture_2d texture.

void(* mi::neuraylib::Texture_handler_vtable::m_tex_lookup_float4_3d)(tct_float result[4], const Texture_handler_base *self, tct_uint texture_idx, const tct_float coord[3], Tex_wrap_mode wrap_u, Tex_wrap_mode wrap_v, Tex_wrap_mode wrap_w, const tct_float crop_u[2], const tct_float crop_v[2], const tct_float crop_w[2])

Implementation of tex::lookup_float4() for a texture_3d texture.

void(* mi::neuraylib::Texture_handler_vtable::m_tex_lookup_float4_cube)(tct_float result[4], const Texture_handler_base *self, tct_uint texture_idx, const tct_float coord[3])

Implementation of tex::lookup_float4() for a texture_cube texture.

void(* mi::neuraylib::Texture_handler_vtable::m_tex_resolution_2d)(tct_int result[2], const Texture_handler_base *self, tct_uint texture_idx, const tct_int uv_tile[2])

Implementation of resolution_2d function needed by generated code, which retrieves the width and height of the given texture.

void(* mi::neuraylib::Texture_handler_vtable::m_tex_texel_float4_2d)(tct_float result[4], const Texture_handler_base *self, tct_uint texture_idx, const tct_int coord[2], const tct_int uv_tile[2])

Implementation of tex::texel_float4() for a texture_2d texture.

void(* mi::neuraylib::Texture_handler_vtable::m_tex_texel_float4_3d)(tct_float result[4], const Texture_handler_base *self, tct_uint texture_idx, const tct_int coord[3])

Implementation of tex::texel_float4() for a texture_3d texture.

tct_float3 mi::neuraylib::Shading_state_material::normal

The result of state::normal().

It represents the shading normal as determined by the renderer. This field will be updated to the result of "geometry.normal" by BSDF init functions, if requested during code generation.

tct_int mi::neuraylib::Shading_state_material::object_id

The result of state::object_id().

It is an application-specific identifier of the hit object as provided in a scene. It can be used to make instanced objects look different in spite of the same used material. This field is only used if the uniform state is included.

const tct_float4* mi::neuraylib::Shading_state_material::object_to_world

A 4x4 transformation matrix transforming from object to world coordinates.

It is used by the state::transform_*() methods. This field is only used if the uniform state is included.

tct_float mi::neuraylib::Bsdf_sample_data::pdf

pdf (non-projected hemisphere)

tct_float mi::neuraylib::Bsdf_evaluate_data::pdf

pdf (non-projected hemisphere)

tct_float mi::neuraylib::Bsdf_pdf_data::pdf

pdf (non-projected hemisphere)

float mi::neuraylib::Edf_sample_data::pdf

< outgoing direction

float mi::neuraylib::Edf_evaluate_data::pdf

pdf (non-projected hemisphere)

float mi::neuraylib::Edf_pdf_data::pdf

pdf (non-projected hemisphere)

tct_float3 mi::neuraylib::Shading_state_material::position

The result of state::position().

It represents the position where the material should be evaluated.

const char* mi::neuraylib::Shading_state_material::ro_data_segment

A pointer to a read-only data segment.

For "PTX" and "LLVM-IR" backend:

  • If the MDL code contains large data arrays, compilation time may increase noticeably, as a lot of source code will be generated for the arrays. To avoid this, you can set the "enable_ro_segment" option to "on" via the mi::neuraylib::IMdl_backend::set_option() method. Then, data of arrays larger than 1024 bytes will be stored in a read-only data segment, which is accessible as the first segment (index 0) returned by mi::neuraylib::ITarget_code::get_ro_data_segment_data(). The generated code will expect, that you make this data available via the ro_data_segment field of the MDL material state. Depending on the target platform this may require copying the data to the GPU.

For other backends, this should be NULL.

const void* mi::neuraylib::Resource_data::shared_data

currently unused, should be NULL

const tct_float3* mi::neuraylib::Shading_state_material::tangent_u

An array containing the results of state::texture_tangent_u(i).

The i-th entry represents the texture tangent vector of the i-th texture space at the current position, which points in the direction of the projection of the tangent to the positive u axis of this texture space onto the plane defined by the original surface normal.

const tct_float3* mi::neuraylib::Shading_state_material::tangent_v

An array containing the results of state::texture_tangent_v(i).

The i-th entry represents the texture bitangent vector of the i-th texture space at the current position, which points in the general direction of the positive v axis of this texture space, but is orthogonal to both the original surface normal and the tangent of this texture space.

const tct_float3* mi::neuraylib::Shading_state_material::text_coords

An array containing the results of state::texture_coordinate(i).

The i-th entry represents the texture coordinates of the i-th texture space at the current position.

tct_float4* mi::neuraylib::Shading_state_material::text_results

The texture results lookup table.

Values will be modified by BSDF init functions to avoid duplicate texture fetches and duplicate calculation of values. This field is only relevant for code generated with mi::neuraylib::IMdl_backend::translate_material_df() or mi::neuraylib::ILink_unit::add_material_df(). In other cases this may be NULL.

const Texture_handler_base* mi::neuraylib::Resource_data::texture_handler

will be provided as "self" parameter to texture functions

const Texture_handler_vtable* mi::neuraylib::Texture_handler_base::vtable

In vtable-mode, the vtable field is used to call the texturing functions.

Otherwise, this field may be NULL.

const tct_float4* mi::neuraylib::Shading_state_material::world_to_object

A 4x4 transformation matrix transforming from world to object coordinates.

It is used by the state::transform_*() methods. This field is only used if the uniform state is included.

tct_float3 mi::neuraylib::Bsdf_sample_data::xi

pseudo-random sample number

tct_float3 mi::neuraylib::Edf_sample_data::xi

pseudo-random sample number