MDL SDK API nvidia_logo_transpbg.gif Up
imdl_distiller_api.h
Go to the documentation of this file.
1/***************************************************************************************************
2 * Copyright 2024 NVIDIA Corporation. All rights reserved.
3 **************************************************************************************************/
6
7#ifndef MI_NEURAYLIB_IMDL_DISTILLER_H
8#define MI_NEURAYLIB_IMDL_DISTILLER_H
9
11
12namespace mi {
13
14class IData;
15class IMap;
16
17namespace neuraylib {
18
19class IBaker;
20class ICanvas;
21class ICompiled_material;
22
31
38 // Undocumented, for alignment only.
39 BAKER_RESOURCE_FORCE_32_BIT = 0xffffffffU
40};
41
42mi_static_assert( sizeof( Baker_resource) == sizeof( Uint32));
43
45class IMdl_distiller_api : public
46 mi::base::Interface_declare<0x074709ef,0x11b0,0x4196,0x82,0x1c,0xab,0x64,0x1a,0xa2,0x50,0xdb>
47{
48public:
50 virtual Size get_target_count() const = 0;
51
54 virtual const char* get_target_name( Size index) const = 0;
55
174 const ICompiled_material* material,
175 const char* target,
176 const IMap* distiller_options = 0,
177 Sint32* errors = 0) const = 0;
178
191 virtual const IBaker* create_baker(
192 const ICompiled_material* material,
193 const char* path,
194 Baker_resource resource = BAKE_ON_CPU,
195 Uint32 gpu_device_id = 0) const = 0;
196
208 virtual Size get_required_module_count( const char* target) const = 0;
209
218 virtual const char* get_required_module_name( const char* target, Size index) const = 0;
219
229 virtual const char* get_required_module_code( const char* target, Size index) const = 0;
230};
231
234class IBaker : public
235 mi::base::Interface_declare<0x4dba1b1d,0x8fce,0x43d9,0x80,0xa7,0xa2,0x24,0xf3,0x1e,0xdc,0xe7>
236{
237public:
239 virtual const char* get_pixel_type() const = 0;
240
245 virtual bool is_uniform() const = 0;
246
259 virtual Sint32 bake_texture( ICanvas* texture, Uint32 samples = 1) const = 0;
260
278 ICanvas* texture,
279 Float32 min_u, Float32 max_u, Float32 min_v, Float32 max_v,
280 Uint32 samples = 1) const = 0;
281
297 virtual Sint32 bake_constant( IData* constant, Uint32 samples = 1) const = 0;
298};
299 // end group mi_neuray_mdl_misc
301
302} // namespace neuraylib
303
304} // namespace mi
305
306#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:236
virtual bool is_uniform() const =0
Indicates whether the expression to be baked is uniform or varying.
virtual const char * get_pixel_type() const =0
Returns the pixel type that matches the expression to be baked best.
virtual Sint32 bake_texture(ICanvas *texture, Uint32 samples=1) const =0
Bakes the expression as texture.
virtual Sint32 bake_constant(IData *constant, Uint32 samples=1) const =0
Bakes the expression as constant.
virtual Sint32 bake_texture(ICanvas *texture, Float32 min_u, Float32 max_u, Float32 min_v, Float32 max_v, Uint32 samples=1) const =0
Bakes the expression as texture.
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:97
Provides access to various functionality related to MDL distilling.
Definition: imdl_distiller_api.h:47
virtual ICompiled_material * distill_material(const ICompiled_material *material, const char *target, const IMap *distiller_options=0, Sint32 *errors=0) const =0
Distills a material.
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.
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 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.
#define mi_static_assert(expr)
Compile time assertion that raises a compilation error if the constant expression expr evaluates to f...
Definition: assert.h:58
unsigned int Uint32
32-bit unsigned integer.
Definition: types.h:49
Uint64 Size
Unsigned integral type that is large enough to hold the size of all types.
Definition: types.h:112
float Float32
32-bit float.
Definition: types.h:51
signed int Sint32
32-bit signed integer.
Definition: types.h:46
Baker_resource
Identifies the resource(s) to be used by a baker.
Definition: imdl_distiller_api.h:30
@ BAKE_ON_CPU
Use only the CPU for texture baking.
Definition: imdl_distiller_api.h:33
@ BAKE_ON_GPU_WITH_CPU_FALLBACK
Prefer using the GPU for texture baking, use the CPU as fallback.
Definition: imdl_distiller_api.h:37
@ BAKE_ON_GPU
Use only the GPU for texture baking.
Definition: imdl_distiller_api.h:35
Mixin class template for deriving new interface declarations.
Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH.
Definition: example_derivatives.dox:5