Material Definition Language API nvidia_logo_transpbg.gif Up
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
imdl_distiller_api.h
Go to the documentation of this file.
1 /***************************************************************************************************
2  * Copyright 2020 NVIDIA Corporation. All rights reserved.
3  **************************************************************************************************/
6 
7 #ifndef MI_NEURAYLIB_IMDL_DISTILLER_H
8 #define MI_NEURAYLIB_IMDL_DISTILLER_H
9 
11 
12 namespace mi {
13 
14 class IData;
15 class IMap;
16 
17 namespace neuraylib {
18 
19 class IBaker;
20 class ICanvas;
21 class ICompiled_material;
22 
27 enum Baker_resource {
31 
38  // Undocumented, for alignment only.
39  BAKER_RESOURCE_FORCE_32_BIT = 0xffffffffU
40 };
41 
42 mi_static_assert( sizeof( Baker_resource) == sizeof( Uint32));
43 
45 class IMdl_distiller_api : public
46  mi::base::Interface_declare<0x074709ef,0x11b0,0x4196,0x82,0x1c,0xab,0x64,0x1a,0xa2,0x50,0xdb>
47 {
48 public:
50  virtual Size get_target_count() const = 0;
51 
54  virtual const char* get_target_name( Size index) const = 0;
55 
71 
146 
187  virtual const ICompiled_material* distill_material(
188  const ICompiled_material* material,
189  const char* target,
190  const IMap* distiller_options = 0,
191  Sint32* errors = 0) const = 0;
192 
205  virtual const IBaker* create_baker(
206  const ICompiled_material* material,
207  const char* path,
208  Baker_resource resource = BAKE_ON_CPU,
209  Uint32 gpu_device_id = 0) const = 0;
210 };
211 
214 class IBaker : public
215  mi::base::Interface_declare<0x4dba1b1d,0x8fce,0x43d9,0x80,0xa7,0xa2,0x24,0xf3,0x1e,0xdc,0xe7>
216 {
217 public:
219  virtual const char* get_pixel_type() const = 0;
220 
225  virtual bool is_uniform() const = 0;
226 
239  virtual Sint32 bake_texture( ICanvas* texture, Uint32 samples = 1) const = 0;
240 
256  virtual Sint32 bake_constant( IData* constant, Uint32 samples = 1) const = 0;
257 };
258  // end group mi_neuray_mdl_types
260 
261 } // namespace neuraylib
262 
263 } // namespace mi
264 
265 #endif // MI_NEURAYLIB_IMDL_DISTILLER_H