Iray SDK API nvidia_logo_transpbg.gif Up
imdl_distiller_api.h
Go to the documentation of this file.
1/***************************************************************************************************
2 * Copyright 2025 NVIDIA Corporation. All rights reserved.
3 **************************************************************************************************/
6
7#ifndef MI_NEURAYLIB_IMDL_DISTILLER_H
8#define MI_NEURAYLIB_IMDL_DISTILLER_H
9
11#include <mi/neuraylib/version.h> // for MI_NEURAYLIB_DEPRECATED_ENUM_VALUE
12
13namespace mi {
14
15class IData;
16class IMap;
17
18namespace neuraylib {
19
20class IBaker;
21class ICanvas;
22class ICompiled_material;
23
32
39 MI_NEURAYLIB_DEPRECATED_ENUM_VALUE(BAKER_RESOURCE_FORCE_32_BIT, 0xffffffffU)
40};
41
43class IMdl_distiller_api : public
44 mi::base::Interface_declare<0x074709ef,0x11b0,0x4196,0x82,0x1c,0xab,0x64,0x1a,0xa2,0x50,0xdb>
45{
46public:
48 virtual Size get_target_count() const = 0;
49
52 virtual const char* get_target_name( Size index) const = 0;
53
172 const ICompiled_material* material,
173 const char* target,
174 const IMap* distiller_options = nullptr,
175 Sint32* errors = nullptr) const = 0;
176
196 virtual const IBaker* create_baker(
197 const ICompiled_material* material,
198 const char* path,
199 Baker_resource resource = BAKE_ON_CPU,
200 Uint32 gpu_device_id = 0) const = 0;
201
213 virtual Size get_required_module_count( const char* target) const = 0;
214
223 virtual const char* get_required_module_name( const char* target, Size index) const = 0;
224
234 virtual const char* get_required_module_code( const char* target, Size index) const = 0;
235};
236
273class IBaker : public
274 mi::base::Interface_declare<0x4dba1b1d,0x8fce,0x43d9,0x80,0xa7,0xa2,0x24,0xf3,0x1e,0xdc,0xe7>
275{
276public:
283 virtual const char* get_pixel_type() const = 0;
284
291 virtual const char* get_type_name() const = 0;
292
301 virtual bool is_uniform() const = 0;
302
315 virtual Sint32 bake_texture( ICanvas* texture, Uint32 samples = 1) const = 0;
316
335 ICanvas* texture,
336 Float32 min_u,
337 Float32 max_u,
338 Float32 min_v,
339 Float32 max_v,
340 Float32 animation_time,
341 Uint32 samples) const = 0;
342
343#ifdef MI_NEURAYLIB_DEPRECATED_15_1
344 inline Sint32 bake_texture(
345 ICanvas* texture,
346 Float32 min_u,
347 Float32 max_u,
348 Float32 min_v,
349 Float32 max_v,
350 Uint32 samples = 1) const
351 {
352 return bake_texture( texture, min_u, max_u, min_v, max_v, 0.0f, samples);
353 }
354#endif // MI_NEURAYLIB_DEPRECATED_15_1
355
387 ICanvas* texture, IData* constant, bool& is_constant, Uint32 samples) const = 0;
388
427 ICanvas* texture,
428 IData* constant,
429 bool& is_constant,
430 Float32 min_u,
431 Float32 max_u,
432 Float32 min_v,
433 Float32 max_v,
434 Float32 animation_time,
435 Uint32 samples) const = 0;
436
450 virtual Sint32 bake_constant( IData* constant, Uint32 samples = 1) const = 0;
451};
452 // end group mi_neuray_mdl_misc
454
455} // namespace neuraylib
456
457} // namespace mi
458
459#endif // MI_NEURAYLIB_IMDL_DISTILLER_H
This interface is the base interface of all types.
Definition: idata.h:297
This interface represents maps, i.e., a key-value based data structure.
Definition: imap.h:41
Mixin class template for deriving new interface declarations.
Definition: interface_declare.h:43
Allows to bake a varying or uniform expression of a compiled material into a texture or constant.
Definition: imdl_distiller_api.h:275
virtual bool is_uniform() const =0
Indicates whether the expression to be baked is uniform or varying.
virtual const char * get_type_name() const =0
Returns the required type name for constants.
virtual Sint32 bake_texture(ICanvas *texture, Float32 min_u, Float32 max_u, Float32 min_v, Float32 max_v, Float32 animation_time, Uint32 samples) const =0
Bakes the expression as texture (supports UV ranges and animated textures).
virtual const char * get_pixel_type() const =0
Returns the pixel type that matches the expression to be baked best.
virtual Sint32 bake_texture_with_constant_detection(ICanvas *texture, IData *constant, bool &is_constant, Uint32 samples) const =0
Bakes the expression as texture (supports detection of constants).
virtual Sint32 bake_texture(ICanvas *texture, Uint32 samples=1) const =0
Bakes the expression as texture.
virtual Sint32 bake_texture_with_constant_detection(ICanvas *texture, IData *constant, bool &is_constant, Float32 min_u, Float32 max_u, Float32 min_v, Float32 max_v, Float32 animation_time, Uint32 samples) const =0
Bakes the expression as texture (supports detection of constants, and UV ranges and animated textures...
virtual Sint32 bake_constant(IData *constant, Uint32 samples=1) const =0
Bakes the expression as constant.
Abstract interface for a canvas represented by a rectangular array of tiles.
Definition: icanvas.h:89
This interface represents a compiled material.
Definition: icompiled_material.h:94
Provides access to various functionality related to MDL distilling.
Definition: imdl_distiller_api.h:45
virtual const char * get_target_name(Size index) const =0
Returns the index -th target name supported for distilling, or nullptr if index is out of bounds.
virtual const char * get_required_module_code(const char *target, Size index) const =0
Returns the MDL source code of the required MDL module with the given index for the given target.
virtual ICompiled_material * distill_material(const ICompiled_material *material, const char *target, const IMap *distiller_options=nullptr, Sint32 *errors=nullptr) const =0
Distills a material.
virtual Size get_target_count() const =0
Returns the number of targets supported for distilling.
virtual Size get_required_module_count(const char *target) const =0
Returns the number of required MDL modules for the given target.
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.
virtual const char * get_required_module_name(const char *target, Size index) const =0
Returns the MDL name of the required MDL module with the given index for the given target.
int Sint32
32-bit signed integer.
Definition: types.h:46
float Float32
32-bit float.
Definition: types.h:51
Uint64 Size
Unsigned integral type that is large enough to hold the size of all types.
Definition: types.h:112
unsigned int Uint32
32-bit unsigned integer.
Definition: types.h:49
Baker_resource
Identifies the resource(s) to be used by a baker.
Definition: imdl_distiller_api.h:31
@ BAKE_ON_CPU
Use only the CPU for texture baking.
Definition: imdl_distiller_api.h:34
@ BAKE_ON_GPU_WITH_CPU_FALLBACK
Prefer using the GPU for texture baking, use the CPU as fallback.
Definition: imdl_distiller_api.h:38
@ BAKE_ON_GPU
Use only the GPU for texture baking.
Definition: imdl_distiller_api.h:36
Mixin class template for deriving new interface declarations.
Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH.
Definition: neuraylib.h:179
Major and minor version number and an optional qualifier.