1 | /* |
2 | --------------------------------------------------------------------------- |
3 | Open Asset Import Library (assimp) |
4 | --------------------------------------------------------------------------- |
5 | |
6 | Copyright (c) 2006-2024, assimp team |
7 | |
8 | All rights reserved. |
9 | |
10 | Redistribution and use of this software in source and binary forms, |
11 | with or without modification, are permitted provided that the following |
12 | conditions are met: |
13 | |
14 | * Redistributions of source code must retain the above |
15 | copyright notice, this list of conditions and the |
16 | following disclaimer. |
17 | |
18 | * Redistributions in binary form must reproduce the above |
19 | copyright notice, this list of conditions and the |
20 | following disclaimer in the documentation and/or other |
21 | materials provided with the distribution. |
22 | |
23 | * Neither the name of the assimp team, nor the names of its |
24 | contributors may be used to endorse or promote products |
25 | derived from this software without specific prior |
26 | written permission of the assimp team. |
27 | |
28 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
29 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
30 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
31 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
32 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
33 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
34 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
35 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
36 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
37 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
38 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
39 | --------------------------------------------------------------------------- |
40 | */ |
41 | |
42 | /** @file material.h |
43 | * @brief Defines the material system of the library |
44 | */ |
45 | #pragma once |
46 | #ifndef AI_MATERIAL_H_INC |
47 | #define AI_MATERIAL_H_INC |
48 | |
49 | #ifdef __GNUC__ |
50 | #pragma GCC system_header |
51 | #endif |
52 | |
53 | #include <assimp/types.h> |
54 | |
55 | #ifdef __cplusplus |
56 | extern "C" { |
57 | #endif |
58 | |
59 | // Name for default materials (2nd is used if meshes have UV coords) |
60 | #define AI_DEFAULT_MATERIAL_NAME "DefaultMaterial" |
61 | |
62 | // --------------------------------------------------------------------------- |
63 | /** @brief Defines how the Nth texture of a specific type is combined with |
64 | * the result of all previous layers. |
65 | * |
66 | * Example (left: key, right: value): <br> |
67 | * @code |
68 | * DiffColor0 - gray |
69 | * DiffTextureOp0 - aiTextureOpMultiply |
70 | * DiffTexture0 - tex1.png |
71 | * DiffTextureOp0 - aiTextureOpAdd |
72 | * DiffTexture1 - tex2.png |
73 | * @endcode |
74 | * Written as equation, the final diffuse term for a specific pixel would be: |
75 | * @code |
76 | * diffFinal = DiffColor0 * sampleTex(DiffTexture0,UV0) + |
77 | * sampleTex(DiffTexture1,UV0) * diffContrib; |
78 | * @endcode |
79 | * where 'diffContrib' is the intensity of the incoming light for that pixel. |
80 | */ |
81 | enum aiTextureOp { |
82 | /** T = T1 * T2 */ |
83 | aiTextureOp_Multiply = 0x0, |
84 | |
85 | /** T = T1 + T2 */ |
86 | aiTextureOp_Add = 0x1, |
87 | |
88 | /** T = T1 - T2 */ |
89 | aiTextureOp_Subtract = 0x2, |
90 | |
91 | /** T = T1 / T2 */ |
92 | aiTextureOp_Divide = 0x3, |
93 | |
94 | /** T = (T1 + T2) - (T1 * T2) */ |
95 | aiTextureOp_SmoothAdd = 0x4, |
96 | |
97 | /** T = T1 + (T2-0.5) */ |
98 | aiTextureOp_SignedAdd = 0x5, |
99 | |
100 | #ifndef SWIG |
101 | _aiTextureOp_Force32Bit = INT_MAX |
102 | #endif |
103 | }; |
104 | |
105 | // --------------------------------------------------------------------------- |
106 | /** @brief Defines how UV coordinates outside the [0...1] range are handled. |
107 | * |
108 | * Commonly referred to as 'wrapping mode'. |
109 | */ |
110 | enum aiTextureMapMode { |
111 | /** A texture coordinate u|v is translated to u%1|v%1 |
112 | */ |
113 | aiTextureMapMode_Wrap = 0x0, |
114 | |
115 | /** Texture coordinates outside [0...1] |
116 | * are clamped to the nearest valid value. |
117 | */ |
118 | aiTextureMapMode_Clamp = 0x1, |
119 | |
120 | /** If the texture coordinates for a pixel are outside [0...1] |
121 | * the texture is not applied to that pixel |
122 | */ |
123 | aiTextureMapMode_Decal = 0x3, |
124 | |
125 | /** A texture coordinate u|v becomes u%1|v%1 if (u-(u%1))%2 is zero and |
126 | * 1-(u%1)|1-(v%1) otherwise |
127 | */ |
128 | aiTextureMapMode_Mirror = 0x2, |
129 | |
130 | #ifndef SWIG |
131 | _aiTextureMapMode_Force32Bit = INT_MAX |
132 | #endif |
133 | }; |
134 | |
135 | // --------------------------------------------------------------------------- |
136 | /** @brief Defines how the mapping coords for a texture are generated. |
137 | * |
138 | * Real-time applications typically require full UV coordinates, so the use of |
139 | * the aiProcess_GenUVCoords step is highly recommended. It generates proper |
140 | * UV channels for non-UV mapped objects, as long as an accurate description |
141 | * how the mapping should look like (e.g spherical) is given. |
142 | * See the #AI_MATKEY_MAPPING property for more details. |
143 | */ |
144 | enum aiTextureMapping { |
145 | /** The mapping coordinates are taken from an UV channel. |
146 | * |
147 | * #AI_MATKEY_UVWSRC property specifies from which UV channel |
148 | * the texture coordinates are to be taken from (remember, |
149 | * meshes can have more than one UV channel). |
150 | */ |
151 | aiTextureMapping_UV = 0x0, |
152 | |
153 | /** Spherical mapping */ |
154 | aiTextureMapping_SPHERE = 0x1, |
155 | |
156 | /** Cylindrical mapping */ |
157 | aiTextureMapping_CYLINDER = 0x2, |
158 | |
159 | /** Cubic mapping */ |
160 | aiTextureMapping_BOX = 0x3, |
161 | |
162 | /** Planar mapping */ |
163 | aiTextureMapping_PLANE = 0x4, |
164 | |
165 | /** Undefined mapping. Have fun. */ |
166 | aiTextureMapping_OTHER = 0x5, |
167 | |
168 | #ifndef SWIG |
169 | _aiTextureMapping_Force32Bit = INT_MAX |
170 | #endif |
171 | }; |
172 | |
173 | // --------------------------------------------------------------------------- |
174 | /** @brief Defines the purpose of a texture |
175 | * |
176 | * This is a very difficult topic. Different 3D packages support different |
177 | * kinds of textures. For very common texture types, such as bumpmaps, the |
178 | * rendering results depend on implementation details in the rendering |
179 | * pipelines of these applications. Assimp loads all texture references from |
180 | * the model file and tries to determine which of the predefined texture |
181 | * types below is the best choice to match the original use of the texture |
182 | * as closely as possible.<br> |
183 | * |
184 | * In content pipelines you'll usually define how textures have to be handled, |
185 | * and the artists working on models have to conform to this specification, |
186 | * regardless which 3D tool they're using. |
187 | */ |
188 | enum aiTextureType { |
189 | /** Dummy value. |
190 | * |
191 | * No texture, but the value to be used as 'texture semantic' |
192 | * (#aiMaterialProperty::mSemantic) for all material properties |
193 | * *not* related to textures. |
194 | */ |
195 | aiTextureType_NONE = 0, |
196 | |
197 | /** LEGACY API MATERIALS |
198 | * Legacy refers to materials which |
199 | * Were originally implemented in the specifications around 2000. |
200 | * These must never be removed, as most engines support them. |
201 | */ |
202 | |
203 | /** The texture is combined with the result of the diffuse |
204 | * lighting equation. |
205 | * OR |
206 | * PBR Specular/Glossiness |
207 | */ |
208 | aiTextureType_DIFFUSE = 1, |
209 | |
210 | /** The texture is combined with the result of the specular |
211 | * lighting equation. |
212 | * OR |
213 | * PBR Specular/Glossiness |
214 | */ |
215 | aiTextureType_SPECULAR = 2, |
216 | |
217 | /** The texture is combined with the result of the ambient |
218 | * lighting equation. |
219 | */ |
220 | aiTextureType_AMBIENT = 3, |
221 | |
222 | /** The texture is added to the result of the lighting |
223 | * calculation. It isn't influenced by incoming light. |
224 | */ |
225 | aiTextureType_EMISSIVE = 4, |
226 | |
227 | /** The texture is a height map. |
228 | * |
229 | * By convention, higher gray-scale values stand for |
230 | * higher elevations from the base height. |
231 | */ |
232 | aiTextureType_HEIGHT = 5, |
233 | |
234 | /** The texture is a (tangent space) normal-map. |
235 | * |
236 | * Again, there are several conventions for tangent-space |
237 | * normal maps. Assimp does (intentionally) not |
238 | * distinguish here. |
239 | */ |
240 | aiTextureType_NORMALS = 6, |
241 | |
242 | /** The texture defines the glossiness of the material. |
243 | * |
244 | * The glossiness is in fact the exponent of the specular |
245 | * (phong) lighting equation. Usually there is a conversion |
246 | * function defined to map the linear color values in the |
247 | * texture to a suitable exponent. Have fun. |
248 | */ |
249 | aiTextureType_SHININESS = 7, |
250 | |
251 | /** The texture defines per-pixel opacity. |
252 | * |
253 | * Usually 'white' means opaque and 'black' means |
254 | * 'transparency'. Or quite the opposite. Have fun. |
255 | */ |
256 | aiTextureType_OPACITY = 8, |
257 | |
258 | /** Displacement texture |
259 | * |
260 | * The exact purpose and format is application-dependent. |
261 | * Higher color values stand for higher vertex displacements. |
262 | */ |
263 | aiTextureType_DISPLACEMENT = 9, |
264 | |
265 | /** Lightmap texture (aka Ambient Occlusion) |
266 | * |
267 | * Both 'Lightmaps' and dedicated 'ambient occlusion maps' are |
268 | * covered by this material property. The texture contains a |
269 | * scaling value for the final color value of a pixel. Its |
270 | * intensity is not affected by incoming light. |
271 | */ |
272 | aiTextureType_LIGHTMAP = 10, |
273 | |
274 | /** Reflection texture |
275 | * |
276 | * Contains the color of a perfect mirror reflection. |
277 | * Rarely used, almost never for real-time applications. |
278 | */ |
279 | aiTextureType_REFLECTION = 11, |
280 | |
281 | /** PBR Materials |
282 | * PBR definitions from maya and other modelling packages now use this standard. |
283 | * This was originally introduced around 2012. |
284 | * Support for this is in game engines like Godot, Unreal or Unity3D. |
285 | * Modelling packages which use this are very common now. |
286 | */ |
287 | |
288 | aiTextureType_BASE_COLOR = 12, |
289 | aiTextureType_NORMAL_CAMERA = 13, |
290 | aiTextureType_EMISSION_COLOR = 14, |
291 | aiTextureType_METALNESS = 15, |
292 | aiTextureType_DIFFUSE_ROUGHNESS = 16, |
293 | aiTextureType_AMBIENT_OCCLUSION = 17, |
294 | |
295 | /** Unknown texture |
296 | * |
297 | * A texture reference that does not match any of the definitions |
298 | * above is considered to be 'unknown'. It is still imported, |
299 | * but is excluded from any further post-processing. |
300 | */ |
301 | aiTextureType_UNKNOWN = 18, |
302 | |
303 | /** PBR Material Modifiers |
304 | * Some modern renderers have further PBR modifiers that may be overlaid |
305 | * on top of the 'base' PBR materials for additional realism. |
306 | * These use multiple texture maps, so only the base type is directly defined |
307 | */ |
308 | |
309 | /** Sheen |
310 | * Generally used to simulate textiles that are covered in a layer of microfibers |
311 | * eg velvet |
312 | * https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_sheen |
313 | */ |
314 | aiTextureType_SHEEN = 19, |
315 | |
316 | /** Clearcoat |
317 | * Simulates a layer of 'polish' or 'lacquer' layered on top of a PBR substrate |
318 | * https://autodesk.github.io/standard-surface/#closures/coating |
319 | * https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_clearcoat |
320 | */ |
321 | aiTextureType_CLEARCOAT = 20, |
322 | |
323 | /** Transmission |
324 | * Simulates transmission through the surface |
325 | * May include further information such as wall thickness |
326 | */ |
327 | aiTextureType_TRANSMISSION = 21, |
328 | |
329 | /** |
330 | * Maya material declarations |
331 | */ |
332 | aiTextureType_MAYA_BASE = 22, |
333 | aiTextureType_MAYA_SPECULAR = 23, |
334 | aiTextureType_MAYA_SPECULAR_COLOR = 24, |
335 | aiTextureType_MAYA_SPECULAR_ROUGHNESS = 25, |
336 | |
337 | #ifndef SWIG |
338 | _aiTextureType_Force32Bit = INT_MAX |
339 | #endif |
340 | }; |
341 | |
342 | #define AI_TEXTURE_TYPE_MAX aiTextureType_MAYA_SPECULAR_ROUGHNESS |
343 | |
344 | // ------------------------------------------------------------------------------- |
345 | /** |
346 | * @brief Get a string for a given aiTextureType |
347 | * |
348 | * @param in The texture type |
349 | * @return The description string for the texture type. |
350 | */ |
351 | ASSIMP_API const char *aiTextureTypeToString(enum aiTextureType in); |
352 | |
353 | // --------------------------------------------------------------------------- |
354 | /** @brief Defines all shading models supported by the library |
355 | * |
356 | * Property: #AI_MATKEY_SHADING_MODEL |
357 | * |
358 | * The list of shading modes has been taken from Blender. |
359 | * See Blender documentation for more information. The API does |
360 | * not distinguish between "specular" and "diffuse" shaders (thus the |
361 | * specular term for diffuse shading models like Oren-Nayar remains |
362 | * undefined). <br> |
363 | * Again, this value is just a hint. Assimp tries to select the shader whose |
364 | * most common implementation matches the original rendering results of the |
365 | * 3D modeler which wrote a particular model as closely as possible. |
366 | * |
367 | */ |
368 | enum aiShadingMode { |
369 | /** Flat shading. Shading is done on per-face base, |
370 | * diffuse only. Also known as 'faceted shading'. |
371 | */ |
372 | aiShadingMode_Flat = 0x1, |
373 | |
374 | /** Simple Gouraud shading. |
375 | */ |
376 | aiShadingMode_Gouraud = 0x2, |
377 | |
378 | /** Phong-Shading - |
379 | */ |
380 | aiShadingMode_Phong = 0x3, |
381 | |
382 | /** Phong-Blinn-Shading |
383 | */ |
384 | aiShadingMode_Blinn = 0x4, |
385 | |
386 | /** Toon-Shading per pixel |
387 | * |
388 | * Also known as 'comic' shader. |
389 | */ |
390 | aiShadingMode_Toon = 0x5, |
391 | |
392 | /** OrenNayar-Shading per pixel |
393 | * |
394 | * Extension to standard Lambertian shading, taking the |
395 | * roughness of the material into account |
396 | */ |
397 | aiShadingMode_OrenNayar = 0x6, |
398 | |
399 | /** Minnaert-Shading per pixel |
400 | * |
401 | * Extension to standard Lambertian shading, taking the |
402 | * "darkness" of the material into account |
403 | */ |
404 | aiShadingMode_Minnaert = 0x7, |
405 | |
406 | /** CookTorrance-Shading per pixel |
407 | * |
408 | * Special shader for metallic surfaces. |
409 | */ |
410 | aiShadingMode_CookTorrance = 0x8, |
411 | |
412 | /** No shading at all. Constant light influence of 1.0. |
413 | * Also known as "Unlit" |
414 | */ |
415 | aiShadingMode_NoShading = 0x9, |
416 | aiShadingMode_Unlit = aiShadingMode_NoShading, // Alias |
417 | |
418 | /** Fresnel shading |
419 | */ |
420 | aiShadingMode_Fresnel = 0xa, |
421 | |
422 | /** Physically-Based Rendering (PBR) shading using |
423 | * Bidirectional scattering/reflectance distribution function (BSDF/BRDF) |
424 | * There are multiple methods under this banner, and model files may provide |
425 | * data for more than one PBR-BRDF method. |
426 | * Applications should use the set of provided properties to determine which |
427 | * of their preferred PBR rendering methods are likely to be available |
428 | * eg: |
429 | * - If AI_MATKEY_METALLIC_FACTOR is set, then a Metallic/Roughness is available |
430 | * - If AI_MATKEY_GLOSSINESS_FACTOR is set, then a Specular/Glossiness is available |
431 | * Note that some PBR methods allow layering of techniques |
432 | */ |
433 | aiShadingMode_PBR_BRDF = 0xb, |
434 | |
435 | #ifndef SWIG |
436 | _aiShadingMode_Force32Bit = INT_MAX |
437 | #endif |
438 | }; |
439 | |
440 | // --------------------------------------------------------------------------- |
441 | /** |
442 | * @brief Defines some mixed flags for a particular texture. |
443 | * |
444 | * Usually you'll instruct your cg artists how textures have to look like ... |
445 | * and how they will be processed in your application. However, if you use |
446 | * Assimp for completely generic loading purposes you might also need to |
447 | * process these flags in order to display as many 'unknown' 3D models as |
448 | * possible correctly. |
449 | * |
450 | * This corresponds to the #AI_MATKEY_TEXFLAGS property. |
451 | */ |
452 | enum aiTextureFlags { |
453 | /** The texture's color values have to be inverted (component-wise 1-n) |
454 | */ |
455 | aiTextureFlags_Invert = 0x1, |
456 | |
457 | /** Explicit request to the application to process the alpha channel |
458 | * of the texture. |
459 | * |
460 | * Mutually exclusive with #aiTextureFlags_IgnoreAlpha. These |
461 | * flags are set if the library can say for sure that the alpha |
462 | * channel is used/is not used. If the model format does not |
463 | * define this, it is left to the application to decide whether |
464 | * the texture alpha channel - if any - is evaluated or not. |
465 | */ |
466 | aiTextureFlags_UseAlpha = 0x2, |
467 | |
468 | /** Explicit request to the application to ignore the alpha channel |
469 | * of the texture. |
470 | * |
471 | * Mutually exclusive with #aiTextureFlags_UseAlpha. |
472 | */ |
473 | aiTextureFlags_IgnoreAlpha = 0x4, |
474 | |
475 | #ifndef SWIG |
476 | _aiTextureFlags_Force32Bit = INT_MAX |
477 | #endif |
478 | }; |
479 | |
480 | // --------------------------------------------------------------------------- |
481 | /** |
482 | * @brief Defines alpha-blend flags. |
483 | * |
484 | * If you're familiar with OpenGL or D3D, these flags aren't new to you. |
485 | * They define *how* the final color value of a pixel is computed, basing |
486 | * on the previous color at that pixel and the new color value from the |
487 | * material. |
488 | * The blend formula is: |
489 | * @code |
490 | * SourceColor * SourceBlend + DestColor * DestBlend |
491 | * @endcode |
492 | * where DestColor is the previous color in the frame-buffer at this |
493 | * position and SourceColor is the material color before the transparency |
494 | * calculation.<br> |
495 | * This corresponds to the #AI_MATKEY_BLEND_FUNC property. |
496 | */ |
497 | enum aiBlendMode { |
498 | /** |
499 | * Formula: |
500 | * @code |
501 | * SourceColor*SourceAlpha + DestColor*(1-SourceAlpha) |
502 | * @endcode |
503 | */ |
504 | aiBlendMode_Default = 0x0, |
505 | |
506 | /** Additive blending |
507 | * |
508 | * Formula: |
509 | * @code |
510 | * SourceColor*1 + DestColor*1 |
511 | * @endcode |
512 | */ |
513 | aiBlendMode_Additive = 0x1, |
514 | |
515 | // we don't need more for the moment, but we might need them |
516 | // in future versions ... |
517 | |
518 | #ifndef SWIG |
519 | _aiBlendMode_Force32Bit = INT_MAX |
520 | #endif |
521 | }; |
522 | |
523 | #include "./Compiler/pushpack1.h" |
524 | |
525 | // --------------------------------------------------------------------------- |
526 | /** |
527 | * @brief Defines how an UV channel is transformed. |
528 | * |
529 | * This is just a helper structure for the #AI_MATKEY_UVTRANSFORM key. |
530 | * See its documentation for more details. |
531 | * |
532 | * Typically you'll want to build a matrix of this information. However, |
533 | * we keep separate scaling/translation/rotation values to make it |
534 | * easier to process and optimize UV transformations internally. |
535 | */ |
536 | struct aiUVTransform { |
537 | /** Translation on the u and v axes. |
538 | * |
539 | * The default value is (0|0). |
540 | */ |
541 | C_STRUCT aiVector2D mTranslation; |
542 | |
543 | /** Scaling on the u and v axes. |
544 | * |
545 | * The default value is (1|1). |
546 | */ |
547 | C_STRUCT aiVector2D mScaling; |
548 | |
549 | /** Rotation - in counter-clockwise direction. |
550 | * |
551 | * The rotation angle is specified in radians. The |
552 | * rotation center is 0.5f|0.5f. The default value |
553 | * 0.f. |
554 | */ |
555 | ai_real mRotation; |
556 | |
557 | #ifdef __cplusplus |
558 | aiUVTransform() AI_NO_EXCEPT |
559 | : mTranslation(0.0, 0.0), |
560 | mScaling(1.0, 1.0), |
561 | mRotation(0.0) { |
562 | // nothing to be done here ... |
563 | } |
564 | #endif |
565 | }; |
566 | |
567 | #include "./Compiler/poppack1.h" |
568 | |
569 | //! @cond AI_DOX_INCLUDE_INTERNAL |
570 | // --------------------------------------------------------------------------- |
571 | /** |
572 | * @brief A very primitive RTTI system for the contents of material properties. |
573 | */ |
574 | enum aiPropertyTypeInfo { |
575 | /** Array of single-precision (32 Bit) floats |
576 | * |
577 | * It is possible to use aiGetMaterialInteger[Array]() (or the C++-API |
578 | * aiMaterial::Get()) to query properties stored in floating-point format. |
579 | * The material system performs the type conversion automatically. |
580 | */ |
581 | aiPTI_Float = 0x1, |
582 | |
583 | /** Array of double-precision (64 Bit) floats |
584 | * |
585 | * It is possible to use aiGetMaterialInteger[Array]() (or the C++-API |
586 | * aiMaterial::Get()) to query properties stored in floating-point format. |
587 | * The material system performs the type conversion automatically. |
588 | */ |
589 | aiPTI_Double = 0x2, |
590 | |
591 | /** The material property is an aiString. |
592 | * |
593 | * Arrays of strings aren't possible, aiGetMaterialString() (or the |
594 | * C++-API aiMaterial::Get()) *must* be used to query a string property. |
595 | */ |
596 | aiPTI_String = 0x3, |
597 | |
598 | /** Array of (32 Bit) integers |
599 | * |
600 | * It is possible to use aiGetMaterialFloat[Array]() (or the C++-API |
601 | * aiMaterial::Get()) to query properties stored in integer format. |
602 | * The material system performs the type conversion automatically. |
603 | */ |
604 | aiPTI_Integer = 0x4, |
605 | |
606 | /** Simple binary buffer, content undefined. Not convertible to anything. |
607 | */ |
608 | aiPTI_Buffer = 0x5, |
609 | |
610 | /** This value is not used. It is just there to force the |
611 | * compiler to map this enum to a 32 Bit integer. |
612 | */ |
613 | #ifndef SWIG |
614 | _aiPTI_Force32Bit = INT_MAX |
615 | #endif |
616 | }; |
617 | |
618 | // --------------------------------------------------------------------------- |
619 | /** @brief Data structure for a single material property |
620 | * |
621 | * As an user, you'll probably never need to deal with this data structure. |
622 | * Just use the provided aiGetMaterialXXX() or aiMaterial::Get() family |
623 | * of functions to query material properties easily. Processing them |
624 | * manually is faster, but it is not the recommended way. It isn't worth |
625 | * the effort. <br> |
626 | * Material property names follow a simple scheme: |
627 | * @code |
628 | * $<name> |
629 | * ?<name> |
630 | * A public property, there must be corresponding AI_MATKEY_XXX define |
631 | * 2nd: Public, but ignored by the #aiProcess_RemoveRedundantMaterials |
632 | * post-processing step. |
633 | * ~<name> |
634 | * A temporary property for internal use. |
635 | * @endcode |
636 | * @see aiMaterial |
637 | */ |
638 | struct aiMaterialProperty { |
639 | /** Specifies the name of the property (key) |
640 | * Keys are generally case insensitive. |
641 | */ |
642 | C_STRUCT aiString mKey; |
643 | |
644 | /** Textures: Specifies their exact usage semantic. |
645 | * For non-texture properties, this member is always 0 |
646 | * (or, better-said, #aiTextureType_NONE). |
647 | */ |
648 | unsigned int mSemantic; |
649 | |
650 | /** Textures: Specifies the index of the texture. |
651 | * For non-texture properties, this member is always 0. |
652 | */ |
653 | unsigned int mIndex; |
654 | |
655 | /** Size of the buffer mData is pointing to, in bytes. |
656 | * This value may not be 0. |
657 | */ |
658 | unsigned int mDataLength; |
659 | |
660 | /** Type information for the property. |
661 | * |
662 | * Defines the data layout inside the data buffer. This is used |
663 | * by the library internally to perform debug checks and to |
664 | * utilize proper type conversions. |
665 | * (It's probably a hacky solution, but it works.) |
666 | */ |
667 | C_ENUM aiPropertyTypeInfo mType; |
668 | |
669 | /** Binary buffer to hold the property's value. |
670 | * The size of the buffer is always mDataLength. |
671 | */ |
672 | char *mData; |
673 | |
674 | #ifdef __cplusplus |
675 | |
676 | aiMaterialProperty() AI_NO_EXCEPT |
677 | : mSemantic(0), |
678 | mIndex(0), |
679 | mDataLength(0), |
680 | mType(aiPTI_Float), |
681 | mData(nullptr) { |
682 | // empty |
683 | } |
684 | |
685 | ~aiMaterialProperty() { |
686 | delete[] mData; |
687 | mData = nullptr; |
688 | } |
689 | |
690 | #endif |
691 | }; |
692 | //! @endcond |
693 | |
694 | #ifdef __cplusplus |
695 | } // We need to leave the "C" block here to allow template member functions |
696 | #endif |
697 | |
698 | // --------------------------------------------------------------------------- |
699 | /** @brief Data structure for a material |
700 | * |
701 | * Material data is stored using a key-value structure. A single key-value |
702 | * pair is called a 'material property'. C++ users should use the provided |
703 | * member functions of aiMaterial to process material properties, C users |
704 | * have to stick with the aiMaterialGetXXX family of unbound functions. |
705 | * The library defines a set of standard keys (AI_MATKEY_XXX). |
706 | */ |
707 | #ifdef __cplusplus |
708 | struct ASSIMP_API aiMaterial |
709 | #else |
710 | struct aiMaterial |
711 | #endif |
712 | { |
713 | |
714 | #ifdef __cplusplus |
715 | |
716 | public: |
717 | /** |
718 | * @brief The class constructor. |
719 | */ |
720 | aiMaterial(); |
721 | |
722 | /** |
723 | * @brief The class destructor. |
724 | */ |
725 | ~aiMaterial(); |
726 | |
727 | // ------------------------------------------------------------------- |
728 | /** |
729 | * @brief Returns the name of the material. |
730 | * @return The name of the material. |
731 | */ |
732 | // ------------------------------------------------------------------- |
733 | aiString GetName() const; |
734 | |
735 | // ------------------------------------------------------------------- |
736 | /** @brief Retrieve an array of Type values with a specific key |
737 | * from the material |
738 | * |
739 | * @param pKey Key to search for. One of the AI_MATKEY_XXX constants. |
740 | * @param type .. set by AI_MATKEY_XXX |
741 | * @param idx .. set by AI_MATKEY_XXX |
742 | * @param pOut Pointer to a buffer to receive the result. |
743 | * @param pMax Specifies the size of the given buffer, in Type's. |
744 | * Receives the number of values (not bytes!) read. |
745 | * NULL is a valid value for this parameter. |
746 | */ |
747 | template <typename Type> |
748 | aiReturn Get(const char *pKey, unsigned int type, |
749 | unsigned int idx, Type *pOut, unsigned int *pMax) const; |
750 | |
751 | aiReturn Get(const char *pKey, unsigned int type, |
752 | unsigned int idx, int *pOut, unsigned int *pMax) const; |
753 | |
754 | aiReturn Get(const char *pKey, unsigned int type, |
755 | unsigned int idx, ai_real *pOut, unsigned int *pMax) const; |
756 | |
757 | // ------------------------------------------------------------------- |
758 | /** @brief Retrieve a Type value with a specific key |
759 | * from the material |
760 | * |
761 | * @param pKey Key to search for. One of the AI_MATKEY_XXX constants. |
762 | * @param type Specifies the type of the texture to be retrieved ( |
763 | * e.g. diffuse, specular, height map ...) |
764 | * @param idx Index of the texture to be retrieved. |
765 | * @param pOut Reference to receive the output value |
766 | */ |
767 | template <typename Type> |
768 | aiReturn Get(const char *pKey, unsigned int type, |
769 | unsigned int idx, Type &pOut) const; |
770 | |
771 | aiReturn Get(const char *pKey, unsigned int type, |
772 | unsigned int idx, int &pOut) const; |
773 | |
774 | aiReturn Get(const char *pKey, unsigned int type, |
775 | unsigned int idx, ai_real &pOut) const; |
776 | |
777 | aiReturn Get(const char *pKey, unsigned int type, |
778 | unsigned int idx, aiString &pOut) const; |
779 | |
780 | aiReturn Get(const char *pKey, unsigned int type, |
781 | unsigned int idx, aiColor3D &pOut) const; |
782 | |
783 | aiReturn Get(const char *pKey, unsigned int type, |
784 | unsigned int idx, aiColor4D &pOut) const; |
785 | |
786 | aiReturn Get(const char *pKey, unsigned int type, |
787 | unsigned int idx, aiUVTransform &pOut) const; |
788 | |
789 | // ------------------------------------------------------------------- |
790 | /** Get the number of textures for a particular texture type. |
791 | * @param type Texture type to check for |
792 | * @return Number of textures for this type. |
793 | * @note A texture can be easily queried using #GetTexture() */ |
794 | unsigned int GetTextureCount(aiTextureType type) const; |
795 | |
796 | // ------------------------------------------------------------------- |
797 | /** Helper function to get all parameters pertaining to a |
798 | * particular texture slot from a material. |
799 | * |
800 | * This function is provided just for convenience, you could also |
801 | * read the single material properties manually. |
802 | * @param type Specifies the type of the texture to be retrieved ( |
803 | * e.g. diffuse, specular, height map ...) |
804 | * @param index Index of the texture to be retrieved. The function fails |
805 | * if there is no texture of that type with this index. |
806 | * #GetTextureCount() can be used to determine the number of textures |
807 | * per texture type. |
808 | * @param path Receives the path to the texture. |
809 | * Use aiScene::GetEmbeddedTexture() method to determine if returned path |
810 | * is an image file to be opened or a string key of embedded texture stored in the corresponding scene |
811 | * (could be a '*' followed by the id of the texture in case of no name) |
812 | * NULL is a valid value. |
813 | * @param mapping The texture mapping. |
814 | * NULL is allowed as value. |
815 | * @param uvindex Receives the UV index of the texture. |
816 | * NULL is a valid value. |
817 | * @param blend Receives the blend factor for the texture |
818 | * NULL is a valid value. |
819 | * @param op Receives the texture operation to be performed between |
820 | * this texture and the previous texture. NULL is allowed as value. |
821 | * @param mapmode Receives the mapping modes to be used for the texture. |
822 | * The parameter may be NULL but if it is a valid pointer it MUST |
823 | * point to an array of 3 aiTextureMapMode's (one for each |
824 | * axis: UVW order (=XYZ)). |
825 | */ |
826 | // ------------------------------------------------------------------- |
827 | aiReturn GetTexture(aiTextureType type, |
828 | unsigned int index, |
829 | C_STRUCT aiString *path, |
830 | aiTextureMapping *mapping = NULL, |
831 | unsigned int *uvindex = NULL, |
832 | ai_real *blend = NULL, |
833 | aiTextureOp *op = NULL, |
834 | aiTextureMapMode *mapmode = NULL) const; |
835 | |
836 | // Setters |
837 | |
838 | // ------------------------------------------------------------------------------ |
839 | /** @brief Add a property with a given key and type info to the material |
840 | * structure |
841 | * |
842 | * @param pInput Pointer to input data |
843 | * @param pSizeInBytes Size of input data |
844 | * @param pKey Key/Usage of the property (AI_MATKEY_XXX) |
845 | * @param type Set by the AI_MATKEY_XXX macro |
846 | * @param index Set by the AI_MATKEY_XXX macro |
847 | * @param pType Type information hint */ |
848 | aiReturn AddBinaryProperty(const void *pInput, |
849 | unsigned int pSizeInBytes, |
850 | const char *pKey, |
851 | unsigned int type, |
852 | unsigned int index, |
853 | aiPropertyTypeInfo pType); |
854 | |
855 | // ------------------------------------------------------------------------------ |
856 | /** @brief Add a string property with a given key and type info to the |
857 | * material structure |
858 | * |
859 | * @param pInput Input string |
860 | * @param pKey Key/Usage of the property (AI_MATKEY_XXX) |
861 | * @param type Set by the AI_MATKEY_XXX macro |
862 | * @param index Set by the AI_MATKEY_XXX macro */ |
863 | aiReturn AddProperty(const aiString *pInput, |
864 | const char *pKey, |
865 | unsigned int type = 0, |
866 | unsigned int index = 0); |
867 | |
868 | // ------------------------------------------------------------------------------ |
869 | /** @brief Add a property with a given key to the material structure |
870 | * @param pInput Pointer to the input data |
871 | * @param pNumValues Number of values in the array |
872 | * @param pKey Key/Usage of the property (AI_MATKEY_XXX) |
873 | * @param type Set by the AI_MATKEY_XXX macro |
874 | * @param index Set by the AI_MATKEY_XXX macro */ |
875 | template <class TYPE> |
876 | aiReturn AddProperty(const TYPE *pInput, |
877 | unsigned int pNumValues, |
878 | const char *pKey, |
879 | unsigned int type = 0, |
880 | unsigned int index = 0); |
881 | |
882 | aiReturn AddProperty(const aiVector3D *pInput, |
883 | unsigned int pNumValues, |
884 | const char *pKey, |
885 | unsigned int type = 0, |
886 | unsigned int index = 0); |
887 | |
888 | aiReturn AddProperty(const aiColor3D *pInput, |
889 | unsigned int pNumValues, |
890 | const char *pKey, |
891 | unsigned int type = 0, |
892 | unsigned int index = 0); |
893 | |
894 | aiReturn AddProperty(const aiColor4D *pInput, |
895 | unsigned int pNumValues, |
896 | const char *pKey, |
897 | unsigned int type = 0, |
898 | unsigned int index = 0); |
899 | |
900 | aiReturn AddProperty(const int *pInput, |
901 | unsigned int pNumValues, |
902 | const char *pKey, |
903 | unsigned int type = 0, |
904 | unsigned int index = 0); |
905 | |
906 | aiReturn AddProperty(const float *pInput, |
907 | unsigned int pNumValues, |
908 | const char *pKey, |
909 | unsigned int type = 0, |
910 | unsigned int index = 0); |
911 | |
912 | aiReturn AddProperty(const double *pInput, |
913 | unsigned int pNumValues, |
914 | const char *pKey, |
915 | unsigned int type = 0, |
916 | unsigned int index = 0); |
917 | |
918 | aiReturn AddProperty(const aiUVTransform *pInput, |
919 | unsigned int pNumValues, |
920 | const char *pKey, |
921 | unsigned int type = 0, |
922 | unsigned int index = 0); |
923 | |
924 | // ------------------------------------------------------------------------------ |
925 | /** @brief Remove a given key from the list. |
926 | * |
927 | * The function fails if the key isn't found |
928 | * @param pKey Key to be deleted |
929 | * @param type Set by the AI_MATKEY_XXX macro |
930 | * @param index Set by the AI_MATKEY_XXX macro */ |
931 | aiReturn RemoveProperty(const char *pKey, |
932 | unsigned int type = 0, |
933 | unsigned int index = 0); |
934 | |
935 | // ------------------------------------------------------------------------------ |
936 | /** @brief Removes all properties from the material. |
937 | * |
938 | * The data array remains allocated so adding new properties is quite fast. */ |
939 | void Clear(); |
940 | |
941 | // ------------------------------------------------------------------------------ |
942 | /** Copy the property list of a material |
943 | * @param pcDest Destination material |
944 | * @param pcSrc Source material |
945 | */ |
946 | static void CopyPropertyList(aiMaterial *pcDest, |
947 | const aiMaterial *pcSrc); |
948 | |
949 | #endif |
950 | |
951 | /** List of all material properties loaded. */ |
952 | C_STRUCT aiMaterialProperty **mProperties; |
953 | |
954 | /** Number of properties in the data base */ |
955 | unsigned int mNumProperties; |
956 | |
957 | /** Storage allocated */ |
958 | unsigned int mNumAllocated; |
959 | }; |
960 | |
961 | // Go back to extern "C" again |
962 | #ifdef __cplusplus |
963 | extern "C" { |
964 | #endif |
965 | |
966 | // --------------------------------------------------------------------------- |
967 | #define AI_MATKEY_NAME "?mat.name", 0, 0 |
968 | #define AI_MATKEY_TWOSIDED "$mat.twosided", 0, 0 |
969 | #define AI_MATKEY_SHADING_MODEL "$mat.shadingm", 0, 0 |
970 | #define AI_MATKEY_ENABLE_WIREFRAME "$mat.wireframe", 0, 0 |
971 | #define AI_MATKEY_BLEND_FUNC "$mat.blend", 0, 0 |
972 | #define AI_MATKEY_OPACITY "$mat.opacity", 0, 0 |
973 | #define AI_MATKEY_TRANSPARENCYFACTOR "$mat.transparencyfactor", 0, 0 |
974 | #define AI_MATKEY_BUMPSCALING "$mat.bumpscaling", 0, 0 |
975 | #define AI_MATKEY_SHININESS "$mat.shininess", 0, 0 |
976 | #define AI_MATKEY_REFLECTIVITY "$mat.reflectivity", 0, 0 |
977 | #define AI_MATKEY_SHININESS_STRENGTH "$mat.shinpercent", 0, 0 |
978 | #define AI_MATKEY_REFRACTI "$mat.refracti", 0, 0 |
979 | #define AI_MATKEY_COLOR_DIFFUSE "$clr.diffuse", 0, 0 |
980 | #define AI_MATKEY_COLOR_AMBIENT "$clr.ambient", 0, 0 |
981 | #define AI_MATKEY_COLOR_SPECULAR "$clr.specular", 0, 0 |
982 | #define AI_MATKEY_COLOR_EMISSIVE "$clr.emissive", 0, 0 |
983 | #define AI_MATKEY_COLOR_TRANSPARENT "$clr.transparent", 0, 0 |
984 | #define AI_MATKEY_COLOR_REFLECTIVE "$clr.reflective", 0, 0 |
985 | #define AI_MATKEY_GLOBAL_BACKGROUND_IMAGE "?bg.global", 0, 0 |
986 | #define AI_MATKEY_GLOBAL_SHADERLANG "?sh.lang", 0, 0 |
987 | #define AI_MATKEY_SHADER_VERTEX "?sh.vs", 0, 0 |
988 | #define AI_MATKEY_SHADER_FRAGMENT "?sh.fs", 0, 0 |
989 | #define AI_MATKEY_SHADER_GEO "?sh.gs", 0, 0 |
990 | #define AI_MATKEY_SHADER_TESSELATION "?sh.ts", 0, 0 |
991 | #define AI_MATKEY_SHADER_PRIMITIVE "?sh.ps", 0, 0 |
992 | #define AI_MATKEY_SHADER_COMPUTE "?sh.cs", 0, 0 |
993 | |
994 | // --------------------------------------------------------------------------- |
995 | // PBR material support |
996 | // -------------------- |
997 | // Properties defining PBR rendering techniques |
998 | #define AI_MATKEY_USE_COLOR_MAP "$mat.useColorMap", 0, 0 |
999 | |
1000 | // Metallic/Roughness Workflow |
1001 | // --------------------------- |
1002 | // Base RGBA color factor. Will be multiplied by final base color texture values if extant |
1003 | // Note: Importers may choose to copy this into AI_MATKEY_COLOR_DIFFUSE for compatibility |
1004 | // with renderers and formats that do not support Metallic/Roughness PBR |
1005 | #define AI_MATKEY_BASE_COLOR "$clr.base", 0, 0 |
1006 | #define AI_MATKEY_BASE_COLOR_TEXTURE aiTextureType_BASE_COLOR, 0 |
1007 | #define AI_MATKEY_USE_METALLIC_MAP "$mat.useMetallicMap", 0, 0 |
1008 | // Metallic factor. 0.0 = Full Dielectric, 1.0 = Full Metal |
1009 | #define AI_MATKEY_METALLIC_FACTOR "$mat.metallicFactor", 0, 0 |
1010 | #define AI_MATKEY_METALLIC_TEXTURE aiTextureType_METALNESS, 0 |
1011 | #define AI_MATKEY_USE_ROUGHNESS_MAP "$mat.useRoughnessMap", 0, 0 |
1012 | // Roughness factor. 0.0 = Perfectly Smooth, 1.0 = Completely Rough |
1013 | #define AI_MATKEY_ROUGHNESS_FACTOR "$mat.roughnessFactor", 0, 0 |
1014 | #define AI_MATKEY_ROUGHNESS_TEXTURE aiTextureType_DIFFUSE_ROUGHNESS, 0 |
1015 | // Anisotropy factor. 0.0 = isotropic, 1.0 = anisotropy along tangent direction, |
1016 | // -1.0 = anisotropy along bitangent direction |
1017 | #define AI_MATKEY_ANISOTROPY_FACTOR "$mat.anisotropyFactor", 0, 0 |
1018 | |
1019 | // Specular/Glossiness Workflow |
1020 | // --------------------------- |
1021 | // Diffuse/Albedo Color. Note: Pure Metals have a diffuse of {0,0,0} |
1022 | // AI_MATKEY_COLOR_DIFFUSE |
1023 | // Specular Color. |
1024 | // Note: Metallic/Roughness may also have a Specular Color |
1025 | // AI_MATKEY_COLOR_SPECULAR |
1026 | #define AI_MATKEY_SPECULAR_FACTOR "$mat.specularFactor", 0, 0 |
1027 | // Glossiness factor. 0.0 = Completely Rough, 1.0 = Perfectly Smooth |
1028 | #define AI_MATKEY_GLOSSINESS_FACTOR "$mat.glossinessFactor", 0, 0 |
1029 | |
1030 | // Sheen |
1031 | // ----- |
1032 | // Sheen base RGB color. Default {0,0,0} |
1033 | #define AI_MATKEY_SHEEN_COLOR_FACTOR "$clr.sheen.factor", 0, 0 |
1034 | // Sheen Roughness Factor. |
1035 | #define AI_MATKEY_SHEEN_ROUGHNESS_FACTOR "$mat.sheen.roughnessFactor", 0, 0 |
1036 | #define AI_MATKEY_SHEEN_COLOR_TEXTURE aiTextureType_SHEEN, 0 |
1037 | #define AI_MATKEY_SHEEN_ROUGHNESS_TEXTURE aiTextureType_SHEEN, 1 |
1038 | |
1039 | // Clearcoat |
1040 | // --------- |
1041 | // Clearcoat layer intensity. 0.0 = none (disabled) |
1042 | #define AI_MATKEY_CLEARCOAT_FACTOR "$mat.clearcoat.factor", 0, 0 |
1043 | #define AI_MATKEY_CLEARCOAT_ROUGHNESS_FACTOR "$mat.clearcoat.roughnessFactor", 0, 0 |
1044 | #define AI_MATKEY_CLEARCOAT_TEXTURE aiTextureType_CLEARCOAT, 0 |
1045 | #define AI_MATKEY_CLEARCOAT_ROUGHNESS_TEXTURE aiTextureType_CLEARCOAT, 1 |
1046 | #define AI_MATKEY_CLEARCOAT_NORMAL_TEXTURE aiTextureType_CLEARCOAT, 2 |
1047 | |
1048 | // Transmission |
1049 | // ------------ |
1050 | // https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_transmission |
1051 | // Base percentage of light transmitted through the surface. 0.0 = Opaque, 1.0 = Fully transparent |
1052 | #define AI_MATKEY_TRANSMISSION_FACTOR "$mat.transmission.factor", 0, 0 |
1053 | // Texture defining percentage of light transmitted through the surface. |
1054 | // Multiplied by AI_MATKEY_TRANSMISSION_FACTOR |
1055 | #define AI_MATKEY_TRANSMISSION_TEXTURE aiTextureType_TRANSMISSION, 0 |
1056 | |
1057 | // Volume |
1058 | // ------------ |
1059 | // https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_volume |
1060 | // The thickness of the volume beneath the surface. If the value is 0 the material is thin-walled. Otherwise the material is a volume boundary. |
1061 | #define AI_MATKEY_VOLUME_THICKNESS_FACTOR "$mat.volume.thicknessFactor", 0, 0 |
1062 | // Texture that defines the thickness. |
1063 | // Multiplied by AI_MATKEY_THICKNESS_FACTOR |
1064 | #define AI_MATKEY_VOLUME_THICKNESS_TEXTURE aiTextureType_TRANSMISSION, 1 |
1065 | // Density of the medium given as the average distance that light travels in the medium before interacting with a particle. |
1066 | #define AI_MATKEY_VOLUME_ATTENUATION_DISTANCE "$mat.volume.attenuationDistance", 0, 0 |
1067 | // The color that white light turns into due to absorption when reaching the attenuation distance. |
1068 | #define AI_MATKEY_VOLUME_ATTENUATION_COLOR "$mat.volume.attenuationColor", 0, 0 |
1069 | |
1070 | // Emissive |
1071 | // -------- |
1072 | #define AI_MATKEY_USE_EMISSIVE_MAP "$mat.useEmissiveMap", 0, 0 |
1073 | #define AI_MATKEY_EMISSIVE_INTENSITY "$mat.emissiveIntensity", 0, 0 |
1074 | #define AI_MATKEY_USE_AO_MAP "$mat.useAOMap", 0, 0 |
1075 | |
1076 | // --------------------------------------------------------------------------- |
1077 | // Pure key names for all texture-related properties |
1078 | //! @cond MATS_DOC_FULL |
1079 | #define _AI_MATKEY_TEXTURE_BASE "$tex.file" |
1080 | #define _AI_MATKEY_UVWSRC_BASE "$tex.uvwsrc" |
1081 | #define _AI_MATKEY_TEXOP_BASE "$tex.op" |
1082 | #define _AI_MATKEY_MAPPING_BASE "$tex.mapping" |
1083 | #define _AI_MATKEY_TEXBLEND_BASE "$tex.blend" |
1084 | #define _AI_MATKEY_MAPPINGMODE_U_BASE "$tex.mapmodeu" |
1085 | #define _AI_MATKEY_MAPPINGMODE_V_BASE "$tex.mapmodev" |
1086 | #define _AI_MATKEY_TEXMAP_AXIS_BASE "$tex.mapaxis" |
1087 | #define _AI_MATKEY_UVTRANSFORM_BASE "$tex.uvtrafo" |
1088 | #define _AI_MATKEY_TEXFLAGS_BASE "$tex.flags" |
1089 | //! @endcond |
1090 | |
1091 | // --------------------------------------------------------------------------- |
1092 | #define AI_MATKEY_TEXTURE(type, N) _AI_MATKEY_TEXTURE_BASE, type, N |
1093 | |
1094 | // For backward compatibility and simplicity |
1095 | //! @cond MATS_DOC_FULL |
1096 | #define AI_MATKEY_TEXTURE_DIFFUSE(N) \ |
1097 | AI_MATKEY_TEXTURE(aiTextureType_DIFFUSE, N) |
1098 | |
1099 | #define AI_MATKEY_TEXTURE_SPECULAR(N) \ |
1100 | AI_MATKEY_TEXTURE(aiTextureType_SPECULAR, N) |
1101 | |
1102 | #define AI_MATKEY_TEXTURE_AMBIENT(N) \ |
1103 | AI_MATKEY_TEXTURE(aiTextureType_AMBIENT, N) |
1104 | |
1105 | #define AI_MATKEY_TEXTURE_EMISSIVE(N) \ |
1106 | AI_MATKEY_TEXTURE(aiTextureType_EMISSIVE, N) |
1107 | |
1108 | #define AI_MATKEY_TEXTURE_NORMALS(N) \ |
1109 | AI_MATKEY_TEXTURE(aiTextureType_NORMALS, N) |
1110 | |
1111 | #define AI_MATKEY_TEXTURE_HEIGHT(N) \ |
1112 | AI_MATKEY_TEXTURE(aiTextureType_HEIGHT, N) |
1113 | |
1114 | #define AI_MATKEY_TEXTURE_SHININESS(N) \ |
1115 | AI_MATKEY_TEXTURE(aiTextureType_SHININESS, N) |
1116 | |
1117 | #define AI_MATKEY_TEXTURE_OPACITY(N) \ |
1118 | AI_MATKEY_TEXTURE(aiTextureType_OPACITY, N) |
1119 | |
1120 | #define AI_MATKEY_TEXTURE_DISPLACEMENT(N) \ |
1121 | AI_MATKEY_TEXTURE(aiTextureType_DISPLACEMENT, N) |
1122 | |
1123 | #define AI_MATKEY_TEXTURE_LIGHTMAP(N) \ |
1124 | AI_MATKEY_TEXTURE(aiTextureType_LIGHTMAP, N) |
1125 | |
1126 | #define AI_MATKEY_TEXTURE_REFLECTION(N) \ |
1127 | AI_MATKEY_TEXTURE(aiTextureType_REFLECTION, N) |
1128 | |
1129 | //! @endcond |
1130 | |
1131 | // --------------------------------------------------------------------------- |
1132 | #define AI_MATKEY_UVWSRC(type, N) _AI_MATKEY_UVWSRC_BASE, type, N |
1133 | |
1134 | // For backward compatibility and simplicity |
1135 | //! @cond MATS_DOC_FULL |
1136 | #define AI_MATKEY_UVWSRC_DIFFUSE(N) \ |
1137 | AI_MATKEY_UVWSRC(aiTextureType_DIFFUSE, N) |
1138 | |
1139 | #define AI_MATKEY_UVWSRC_SPECULAR(N) \ |
1140 | AI_MATKEY_UVWSRC(aiTextureType_SPECULAR, N) |
1141 | |
1142 | #define AI_MATKEY_UVWSRC_AMBIENT(N) \ |
1143 | AI_MATKEY_UVWSRC(aiTextureType_AMBIENT, N) |
1144 | |
1145 | #define AI_MATKEY_UVWSRC_EMISSIVE(N) \ |
1146 | AI_MATKEY_UVWSRC(aiTextureType_EMISSIVE, N) |
1147 | |
1148 | #define AI_MATKEY_UVWSRC_NORMALS(N) \ |
1149 | AI_MATKEY_UVWSRC(aiTextureType_NORMALS, N) |
1150 | |
1151 | #define AI_MATKEY_UVWSRC_HEIGHT(N) \ |
1152 | AI_MATKEY_UVWSRC(aiTextureType_HEIGHT, N) |
1153 | |
1154 | #define AI_MATKEY_UVWSRC_SHININESS(N) \ |
1155 | AI_MATKEY_UVWSRC(aiTextureType_SHININESS, N) |
1156 | |
1157 | #define AI_MATKEY_UVWSRC_OPACITY(N) \ |
1158 | AI_MATKEY_UVWSRC(aiTextureType_OPACITY, N) |
1159 | |
1160 | #define AI_MATKEY_UVWSRC_DISPLACEMENT(N) \ |
1161 | AI_MATKEY_UVWSRC(aiTextureType_DISPLACEMENT, N) |
1162 | |
1163 | #define AI_MATKEY_UVWSRC_LIGHTMAP(N) \ |
1164 | AI_MATKEY_UVWSRC(aiTextureType_LIGHTMAP, N) |
1165 | |
1166 | #define AI_MATKEY_UVWSRC_REFLECTION(N) \ |
1167 | AI_MATKEY_UVWSRC(aiTextureType_REFLECTION, N) |
1168 | |
1169 | //! @endcond |
1170 | // --------------------------------------------------------------------------- |
1171 | #define AI_MATKEY_TEXOP(type, N) _AI_MATKEY_TEXOP_BASE, type, N |
1172 | |
1173 | // For backward compatibility and simplicity |
1174 | //! @cond MATS_DOC_FULL |
1175 | #define AI_MATKEY_TEXOP_DIFFUSE(N) \ |
1176 | AI_MATKEY_TEXOP(aiTextureType_DIFFUSE, N) |
1177 | |
1178 | #define AI_MATKEY_TEXOP_SPECULAR(N) \ |
1179 | AI_MATKEY_TEXOP(aiTextureType_SPECULAR, N) |
1180 | |
1181 | #define AI_MATKEY_TEXOP_AMBIENT(N) \ |
1182 | AI_MATKEY_TEXOP(aiTextureType_AMBIENT, N) |
1183 | |
1184 | #define AI_MATKEY_TEXOP_EMISSIVE(N) \ |
1185 | AI_MATKEY_TEXOP(aiTextureType_EMISSIVE, N) |
1186 | |
1187 | #define AI_MATKEY_TEXOP_NORMALS(N) \ |
1188 | AI_MATKEY_TEXOP(aiTextureType_NORMALS, N) |
1189 | |
1190 | #define AI_MATKEY_TEXOP_HEIGHT(N) \ |
1191 | AI_MATKEY_TEXOP(aiTextureType_HEIGHT, N) |
1192 | |
1193 | #define AI_MATKEY_TEXOP_SHININESS(N) \ |
1194 | AI_MATKEY_TEXOP(aiTextureType_SHININESS, N) |
1195 | |
1196 | #define AI_MATKEY_TEXOP_OPACITY(N) \ |
1197 | AI_MATKEY_TEXOP(aiTextureType_OPACITY, N) |
1198 | |
1199 | #define AI_MATKEY_TEXOP_DISPLACEMENT(N) \ |
1200 | AI_MATKEY_TEXOP(aiTextureType_DISPLACEMENT, N) |
1201 | |
1202 | #define AI_MATKEY_TEXOP_LIGHTMAP(N) \ |
1203 | AI_MATKEY_TEXOP(aiTextureType_LIGHTMAP, N) |
1204 | |
1205 | #define AI_MATKEY_TEXOP_REFLECTION(N) \ |
1206 | AI_MATKEY_TEXOP(aiTextureType_REFLECTION, N) |
1207 | |
1208 | //! @endcond |
1209 | // --------------------------------------------------------------------------- |
1210 | #define AI_MATKEY_MAPPING(type, N) _AI_MATKEY_MAPPING_BASE, type, N |
1211 | |
1212 | // For backward compatibility and simplicity |
1213 | //! @cond MATS_DOC_FULL |
1214 | #define AI_MATKEY_MAPPING_DIFFUSE(N) \ |
1215 | AI_MATKEY_MAPPING(aiTextureType_DIFFUSE, N) |
1216 | |
1217 | #define AI_MATKEY_MAPPING_SPECULAR(N) \ |
1218 | AI_MATKEY_MAPPING(aiTextureType_SPECULAR, N) |
1219 | |
1220 | #define AI_MATKEY_MAPPING_AMBIENT(N) \ |
1221 | AI_MATKEY_MAPPING(aiTextureType_AMBIENT, N) |
1222 | |
1223 | #define AI_MATKEY_MAPPING_EMISSIVE(N) \ |
1224 | AI_MATKEY_MAPPING(aiTextureType_EMISSIVE, N) |
1225 | |
1226 | #define AI_MATKEY_MAPPING_NORMALS(N) \ |
1227 | AI_MATKEY_MAPPING(aiTextureType_NORMALS, N) |
1228 | |
1229 | #define AI_MATKEY_MAPPING_HEIGHT(N) \ |
1230 | AI_MATKEY_MAPPING(aiTextureType_HEIGHT, N) |
1231 | |
1232 | #define AI_MATKEY_MAPPING_SHININESS(N) \ |
1233 | AI_MATKEY_MAPPING(aiTextureType_SHININESS, N) |
1234 | |
1235 | #define AI_MATKEY_MAPPING_OPACITY(N) \ |
1236 | AI_MATKEY_MAPPING(aiTextureType_OPACITY, N) |
1237 | |
1238 | #define AI_MATKEY_MAPPING_DISPLACEMENT(N) \ |
1239 | AI_MATKEY_MAPPING(aiTextureType_DISPLACEMENT, N) |
1240 | |
1241 | #define AI_MATKEY_MAPPING_LIGHTMAP(N) \ |
1242 | AI_MATKEY_MAPPING(aiTextureType_LIGHTMAP, N) |
1243 | |
1244 | #define AI_MATKEY_MAPPING_REFLECTION(N) \ |
1245 | AI_MATKEY_MAPPING(aiTextureType_REFLECTION, N) |
1246 | |
1247 | //! @endcond |
1248 | // --------------------------------------------------------------------------- |
1249 | #define AI_MATKEY_TEXBLEND(type, N) _AI_MATKEY_TEXBLEND_BASE, type, N |
1250 | |
1251 | // For backward compatibility and simplicity |
1252 | //! @cond MATS_DOC_FULL |
1253 | #define AI_MATKEY_TEXBLEND_DIFFUSE(N) \ |
1254 | AI_MATKEY_TEXBLEND(aiTextureType_DIFFUSE, N) |
1255 | |
1256 | #define AI_MATKEY_TEXBLEND_SPECULAR(N) \ |
1257 | AI_MATKEY_TEXBLEND(aiTextureType_SPECULAR, N) |
1258 | |
1259 | #define AI_MATKEY_TEXBLEND_AMBIENT(N) \ |
1260 | AI_MATKEY_TEXBLEND(aiTextureType_AMBIENT, N) |
1261 | |
1262 | #define AI_MATKEY_TEXBLEND_EMISSIVE(N) \ |
1263 | AI_MATKEY_TEXBLEND(aiTextureType_EMISSIVE, N) |
1264 | |
1265 | #define AI_MATKEY_TEXBLEND_NORMALS(N) \ |
1266 | AI_MATKEY_TEXBLEND(aiTextureType_NORMALS, N) |
1267 | |
1268 | #define AI_MATKEY_TEXBLEND_HEIGHT(N) \ |
1269 | AI_MATKEY_TEXBLEND(aiTextureType_HEIGHT, N) |
1270 | |
1271 | #define AI_MATKEY_TEXBLEND_SHININESS(N) \ |
1272 | AI_MATKEY_TEXBLEND(aiTextureType_SHININESS, N) |
1273 | |
1274 | #define AI_MATKEY_TEXBLEND_OPACITY(N) \ |
1275 | AI_MATKEY_TEXBLEND(aiTextureType_OPACITY, N) |
1276 | |
1277 | #define AI_MATKEY_TEXBLEND_DISPLACEMENT(N) \ |
1278 | AI_MATKEY_TEXBLEND(aiTextureType_DISPLACEMENT, N) |
1279 | |
1280 | #define AI_MATKEY_TEXBLEND_LIGHTMAP(N) \ |
1281 | AI_MATKEY_TEXBLEND(aiTextureType_LIGHTMAP, N) |
1282 | |
1283 | #define AI_MATKEY_TEXBLEND_REFLECTION(N) \ |
1284 | AI_MATKEY_TEXBLEND(aiTextureType_REFLECTION, N) |
1285 | |
1286 | //! @endcond |
1287 | // --------------------------------------------------------------------------- |
1288 | #define AI_MATKEY_MAPPINGMODE_U(type, N) _AI_MATKEY_MAPPINGMODE_U_BASE, type, N |
1289 | |
1290 | // For backward compatibility and simplicity |
1291 | //! @cond MATS_DOC_FULL |
1292 | #define AI_MATKEY_MAPPINGMODE_U_DIFFUSE(N) \ |
1293 | AI_MATKEY_MAPPINGMODE_U(aiTextureType_DIFFUSE, N) |
1294 | |
1295 | #define AI_MATKEY_MAPPINGMODE_U_SPECULAR(N) \ |
1296 | AI_MATKEY_MAPPINGMODE_U(aiTextureType_SPECULAR, N) |
1297 | |
1298 | #define AI_MATKEY_MAPPINGMODE_U_AMBIENT(N) \ |
1299 | AI_MATKEY_MAPPINGMODE_U(aiTextureType_AMBIENT, N) |
1300 | |
1301 | #define AI_MATKEY_MAPPINGMODE_U_EMISSIVE(N) \ |
1302 | AI_MATKEY_MAPPINGMODE_U(aiTextureType_EMISSIVE, N) |
1303 | |
1304 | #define AI_MATKEY_MAPPINGMODE_U_NORMALS(N) \ |
1305 | AI_MATKEY_MAPPINGMODE_U(aiTextureType_NORMALS, N) |
1306 | |
1307 | #define AI_MATKEY_MAPPINGMODE_U_HEIGHT(N) \ |
1308 | AI_MATKEY_MAPPINGMODE_U(aiTextureType_HEIGHT, N) |
1309 | |
1310 | #define AI_MATKEY_MAPPINGMODE_U_SHININESS(N) \ |
1311 | AI_MATKEY_MAPPINGMODE_U(aiTextureType_SHININESS, N) |
1312 | |
1313 | #define AI_MATKEY_MAPPINGMODE_U_OPACITY(N) \ |
1314 | AI_MATKEY_MAPPINGMODE_U(aiTextureType_OPACITY, N) |
1315 | |
1316 | #define AI_MATKEY_MAPPINGMODE_U_DISPLACEMENT(N) \ |
1317 | AI_MATKEY_MAPPINGMODE_U(aiTextureType_DISPLACEMENT, N) |
1318 | |
1319 | #define AI_MATKEY_MAPPINGMODE_U_LIGHTMAP(N) \ |
1320 | AI_MATKEY_MAPPINGMODE_U(aiTextureType_LIGHTMAP, N) |
1321 | |
1322 | #define AI_MATKEY_MAPPINGMODE_U_REFLECTION(N) \ |
1323 | AI_MATKEY_MAPPINGMODE_U(aiTextureType_REFLECTION, N) |
1324 | |
1325 | //! @endcond |
1326 | // --------------------------------------------------------------------------- |
1327 | #define AI_MATKEY_MAPPINGMODE_V(type, N) _AI_MATKEY_MAPPINGMODE_V_BASE, type, N |
1328 | |
1329 | // For backward compatibility and simplicity |
1330 | //! @cond MATS_DOC_FULL |
1331 | #define AI_MATKEY_MAPPINGMODE_V_DIFFUSE(N) \ |
1332 | AI_MATKEY_MAPPINGMODE_V(aiTextureType_DIFFUSE, N) |
1333 | |
1334 | #define AI_MATKEY_MAPPINGMODE_V_SPECULAR(N) \ |
1335 | AI_MATKEY_MAPPINGMODE_V(aiTextureType_SPECULAR, N) |
1336 | |
1337 | #define AI_MATKEY_MAPPINGMODE_V_AMBIENT(N) \ |
1338 | AI_MATKEY_MAPPINGMODE_V(aiTextureType_AMBIENT, N) |
1339 | |
1340 | #define AI_MATKEY_MAPPINGMODE_V_EMISSIVE(N) \ |
1341 | AI_MATKEY_MAPPINGMODE_V(aiTextureType_EMISSIVE, N) |
1342 | |
1343 | #define AI_MATKEY_MAPPINGMODE_V_NORMALS(N) \ |
1344 | AI_MATKEY_MAPPINGMODE_V(aiTextureType_NORMALS, N) |
1345 | |
1346 | #define AI_MATKEY_MAPPINGMODE_V_HEIGHT(N) \ |
1347 | AI_MATKEY_MAPPINGMODE_V(aiTextureType_HEIGHT, N) |
1348 | |
1349 | #define AI_MATKEY_MAPPINGMODE_V_SHININESS(N) \ |
1350 | AI_MATKEY_MAPPINGMODE_V(aiTextureType_SHININESS, N) |
1351 | |
1352 | #define AI_MATKEY_MAPPINGMODE_V_OPACITY(N) \ |
1353 | AI_MATKEY_MAPPINGMODE_V(aiTextureType_OPACITY, N) |
1354 | |
1355 | #define AI_MATKEY_MAPPINGMODE_V_DISPLACEMENT(N) \ |
1356 | AI_MATKEY_MAPPINGMODE_V(aiTextureType_DISPLACEMENT, N) |
1357 | |
1358 | #define AI_MATKEY_MAPPINGMODE_V_LIGHTMAP(N) \ |
1359 | AI_MATKEY_MAPPINGMODE_V(aiTextureType_LIGHTMAP, N) |
1360 | |
1361 | #define AI_MATKEY_MAPPINGMODE_V_REFLECTION(N) \ |
1362 | AI_MATKEY_MAPPINGMODE_V(aiTextureType_REFLECTION, N) |
1363 | |
1364 | //! @endcond |
1365 | // --------------------------------------------------------------------------- |
1366 | #define AI_MATKEY_TEXMAP_AXIS(type, N) _AI_MATKEY_TEXMAP_AXIS_BASE, type, N |
1367 | |
1368 | // For backward compatibility and simplicity |
1369 | //! @cond MATS_DOC_FULL |
1370 | #define AI_MATKEY_TEXMAP_AXIS_DIFFUSE(N) \ |
1371 | AI_MATKEY_TEXMAP_AXIS(aiTextureType_DIFFUSE, N) |
1372 | |
1373 | #define AI_MATKEY_TEXMAP_AXIS_SPECULAR(N) \ |
1374 | AI_MATKEY_TEXMAP_AXIS(aiTextureType_SPECULAR, N) |
1375 | |
1376 | #define AI_MATKEY_TEXMAP_AXIS_AMBIENT(N) \ |
1377 | AI_MATKEY_TEXMAP_AXIS(aiTextureType_AMBIENT, N) |
1378 | |
1379 | #define AI_MATKEY_TEXMAP_AXIS_EMISSIVE(N) \ |
1380 | AI_MATKEY_TEXMAP_AXIS(aiTextureType_EMISSIVE, N) |
1381 | |
1382 | #define AI_MATKEY_TEXMAP_AXIS_NORMALS(N) \ |
1383 | AI_MATKEY_TEXMAP_AXIS(aiTextureType_NORMALS, N) |
1384 | |
1385 | #define AI_MATKEY_TEXMAP_AXIS_HEIGHT(N) \ |
1386 | AI_MATKEY_TEXMAP_AXIS(aiTextureType_HEIGHT, N) |
1387 | |
1388 | #define AI_MATKEY_TEXMAP_AXIS_SHININESS(N) \ |
1389 | AI_MATKEY_TEXMAP_AXIS(aiTextureType_SHININESS, N) |
1390 | |
1391 | #define AI_MATKEY_TEXMAP_AXIS_OPACITY(N) \ |
1392 | AI_MATKEY_TEXMAP_AXIS(aiTextureType_OPACITY, N) |
1393 | |
1394 | #define AI_MATKEY_TEXMAP_AXIS_DISPLACEMENT(N) \ |
1395 | AI_MATKEY_TEXMAP_AXIS(aiTextureType_DISPLACEMENT, N) |
1396 | |
1397 | #define AI_MATKEY_TEXMAP_AXIS_LIGHTMAP(N) \ |
1398 | AI_MATKEY_TEXMAP_AXIS(aiTextureType_LIGHTMAP, N) |
1399 | |
1400 | #define AI_MATKEY_TEXMAP_AXIS_REFLECTION(N) \ |
1401 | AI_MATKEY_TEXMAP_AXIS(aiTextureType_REFLECTION, N) |
1402 | |
1403 | //! @endcond |
1404 | // --------------------------------------------------------------------------- |
1405 | #define AI_MATKEY_UVTRANSFORM(type, N) _AI_MATKEY_UVTRANSFORM_BASE, type, N |
1406 | |
1407 | // For backward compatibility and simplicity |
1408 | //! @cond MATS_DOC_FULL |
1409 | #define AI_MATKEY_UVTRANSFORM_DIFFUSE(N) \ |
1410 | AI_MATKEY_UVTRANSFORM(aiTextureType_DIFFUSE, N) |
1411 | |
1412 | #define AI_MATKEY_UVTRANSFORM_SPECULAR(N) \ |
1413 | AI_MATKEY_UVTRANSFORM(aiTextureType_SPECULAR, N) |
1414 | |
1415 | #define AI_MATKEY_UVTRANSFORM_AMBIENT(N) \ |
1416 | AI_MATKEY_UVTRANSFORM(aiTextureType_AMBIENT, N) |
1417 | |
1418 | #define AI_MATKEY_UVTRANSFORM_EMISSIVE(N) \ |
1419 | AI_MATKEY_UVTRANSFORM(aiTextureType_EMISSIVE, N) |
1420 | |
1421 | #define AI_MATKEY_UVTRANSFORM_NORMALS(N) \ |
1422 | AI_MATKEY_UVTRANSFORM(aiTextureType_NORMALS, N) |
1423 | |
1424 | #define AI_MATKEY_UVTRANSFORM_HEIGHT(N) \ |
1425 | AI_MATKEY_UVTRANSFORM(aiTextureType_HEIGHT, N) |
1426 | |
1427 | #define AI_MATKEY_UVTRANSFORM_SHININESS(N) \ |
1428 | AI_MATKEY_UVTRANSFORM(aiTextureType_SHININESS, N) |
1429 | |
1430 | #define AI_MATKEY_UVTRANSFORM_OPACITY(N) \ |
1431 | AI_MATKEY_UVTRANSFORM(aiTextureType_OPACITY, N) |
1432 | |
1433 | #define AI_MATKEY_UVTRANSFORM_DISPLACEMENT(N) \ |
1434 | AI_MATKEY_UVTRANSFORM(aiTextureType_DISPLACEMENT, N) |
1435 | |
1436 | #define AI_MATKEY_UVTRANSFORM_LIGHTMAP(N) \ |
1437 | AI_MATKEY_UVTRANSFORM(aiTextureType_LIGHTMAP, N) |
1438 | |
1439 | #define AI_MATKEY_UVTRANSFORM_REFLECTION(N) \ |
1440 | AI_MATKEY_UVTRANSFORM(aiTextureType_REFLECTION, N) |
1441 | |
1442 | #define AI_MATKEY_UVTRANSFORM_UNKNOWN(N) \ |
1443 | AI_MATKEY_UVTRANSFORM(aiTextureType_UNKNOWN, N) |
1444 | |
1445 | //! @endcond |
1446 | // --------------------------------------------------------------------------- |
1447 | #define AI_MATKEY_TEXFLAGS(type, N) _AI_MATKEY_TEXFLAGS_BASE, type, N |
1448 | |
1449 | // For backward compatibility and simplicity |
1450 | //! @cond MATS_DOC_FULL |
1451 | #define AI_MATKEY_TEXFLAGS_DIFFUSE(N) \ |
1452 | AI_MATKEY_TEXFLAGS(aiTextureType_DIFFUSE, N) |
1453 | |
1454 | #define AI_MATKEY_TEXFLAGS_SPECULAR(N) \ |
1455 | AI_MATKEY_TEXFLAGS(aiTextureType_SPECULAR, N) |
1456 | |
1457 | #define AI_MATKEY_TEXFLAGS_AMBIENT(N) \ |
1458 | AI_MATKEY_TEXFLAGS(aiTextureType_AMBIENT, N) |
1459 | |
1460 | #define AI_MATKEY_TEXFLAGS_EMISSIVE(N) \ |
1461 | AI_MATKEY_TEXFLAGS(aiTextureType_EMISSIVE, N) |
1462 | |
1463 | #define AI_MATKEY_TEXFLAGS_NORMALS(N) \ |
1464 | AI_MATKEY_TEXFLAGS(aiTextureType_NORMALS, N) |
1465 | |
1466 | #define AI_MATKEY_TEXFLAGS_HEIGHT(N) \ |
1467 | AI_MATKEY_TEXFLAGS(aiTextureType_HEIGHT, N) |
1468 | |
1469 | #define AI_MATKEY_TEXFLAGS_SHININESS(N) \ |
1470 | AI_MATKEY_TEXFLAGS(aiTextureType_SHININESS, N) |
1471 | |
1472 | #define AI_MATKEY_TEXFLAGS_OPACITY(N) \ |
1473 | AI_MATKEY_TEXFLAGS(aiTextureType_OPACITY, N) |
1474 | |
1475 | #define AI_MATKEY_TEXFLAGS_DISPLACEMENT(N) \ |
1476 | AI_MATKEY_TEXFLAGS(aiTextureType_DISPLACEMENT, N) |
1477 | |
1478 | #define AI_MATKEY_TEXFLAGS_LIGHTMAP(N) \ |
1479 | AI_MATKEY_TEXFLAGS(aiTextureType_LIGHTMAP, N) |
1480 | |
1481 | #define AI_MATKEY_TEXFLAGS_REFLECTION(N) \ |
1482 | AI_MATKEY_TEXFLAGS(aiTextureType_REFLECTION, N) |
1483 | |
1484 | #define AI_MATKEY_TEXFLAGS_UNKNOWN(N) \ |
1485 | AI_MATKEY_TEXFLAGS(aiTextureType_UNKNOWN, N) |
1486 | |
1487 | //! @endcond |
1488 | //! |
1489 | // --------------------------------------------------------------------------- |
1490 | /** @brief Retrieve a material property with a specific key from the material |
1491 | * |
1492 | * @param pMat Pointer to the input material. May not be NULL |
1493 | * @param pKey Key to search for. One of the AI_MATKEY_XXX constants. |
1494 | * @param type Specifies the type of the texture to be retrieved ( |
1495 | * e.g. diffuse, specular, height map ...) |
1496 | * @param index Index of the texture to be retrieved. |
1497 | * @param pPropOut Pointer to receive a pointer to a valid aiMaterialProperty |
1498 | * structure or NULL if the key has not been found. */ |
1499 | // --------------------------------------------------------------------------- |
1500 | ASSIMP_API C_ENUM aiReturn aiGetMaterialProperty( |
1501 | const C_STRUCT aiMaterial *pMat, |
1502 | const char *pKey, |
1503 | unsigned int type, |
1504 | unsigned int index, |
1505 | const C_STRUCT aiMaterialProperty **pPropOut); |
1506 | |
1507 | // --------------------------------------------------------------------------- |
1508 | /** @brief Retrieve an array of float values with a specific key |
1509 | * from the material |
1510 | * |
1511 | * Pass one of the AI_MATKEY_XXX constants for the last three parameters (the |
1512 | * example reads the #AI_MATKEY_UVTRANSFORM property of the first diffuse texture) |
1513 | * @code |
1514 | * aiUVTransform trafo; |
1515 | * unsigned int max = sizeof(aiUVTransform); |
1516 | * if (AI_SUCCESS != aiGetMaterialFloatArray(mat, AI_MATKEY_UVTRANSFORM(aiTextureType_DIFFUSE,0), |
1517 | * (float*)&trafo, &max) || sizeof(aiUVTransform) != max) |
1518 | * { |
1519 | * // error handling |
1520 | * } |
1521 | * @endcode |
1522 | * |
1523 | * @param pMat Pointer to the input material. May not be NULL |
1524 | * @param pKey Key to search for. One of the AI_MATKEY_XXX constants. |
1525 | * @param pOut Pointer to a buffer to receive the result. |
1526 | * @param pMax Specifies the size of the given buffer, in float's. |
1527 | * Receives the number of values (not bytes!) read. |
1528 | * @param type (see the code sample above) |
1529 | * @param index (see the code sample above) |
1530 | * @return Specifies whether the key has been found. If not, the output |
1531 | * arrays remains unmodified and pMax is set to 0.*/ |
1532 | // --------------------------------------------------------------------------- |
1533 | ASSIMP_API C_ENUM aiReturn aiGetMaterialFloatArray( |
1534 | const C_STRUCT aiMaterial *pMat, |
1535 | const char *pKey, |
1536 | unsigned int type, |
1537 | unsigned int index, |
1538 | float *pOut, |
1539 | unsigned int *pMax); |
1540 | |
1541 | // --------------------------------------------------------------------------- |
1542 | /** @brief Retrieve a single float property with a specific key from the material. |
1543 | * |
1544 | * Pass one of the AI_MATKEY_XXX constants for the last three parameters (the |
1545 | * example reads the #AI_MATKEY_SHININESS_STRENGTH property of the first diffuse texture) |
1546 | * @code |
1547 | * float specStrength = 1.f; // default value, remains unmodified if we fail. |
1548 | * aiGetMaterialFloat(mat, AI_MATKEY_SHININESS_STRENGTH, |
1549 | * (float*)&specStrength); |
1550 | * @endcode |
1551 | * |
1552 | * @param pMat Pointer to the input material. May not be NULL |
1553 | * @param pKey Key to search for. One of the AI_MATKEY_XXX constants. |
1554 | * @param pOut Receives the output float. |
1555 | * @param type (see the code sample above) |
1556 | * @param index (see the code sample above) |
1557 | * @return Specifies whether the key has been found. If not, the output |
1558 | * float remains unmodified.*/ |
1559 | // --------------------------------------------------------------------------- |
1560 | inline aiReturn aiGetMaterialFloat(const C_STRUCT aiMaterial *pMat, |
1561 | const char *pKey, |
1562 | unsigned int type, |
1563 | unsigned int index, |
1564 | float *pOut) { |
1565 | return aiGetMaterialFloatArray(pMat, pKey, type, index, pOut, pMax: (unsigned int *)0x0); |
1566 | } |
1567 | |
1568 | // --------------------------------------------------------------------------- |
1569 | /** @brief Retrieve an array of integer values with a specific key |
1570 | * from a material |
1571 | * |
1572 | * See the sample for aiGetMaterialFloatArray for more information.*/ |
1573 | ASSIMP_API C_ENUM aiReturn aiGetMaterialIntegerArray(const C_STRUCT aiMaterial *pMat, |
1574 | const char *pKey, |
1575 | unsigned int type, |
1576 | unsigned int index, |
1577 | int *pOut, |
1578 | unsigned int *pMax); |
1579 | |
1580 | // --------------------------------------------------------------------------- |
1581 | /** @brief Retrieve an integer property with a specific key from a material |
1582 | * |
1583 | * See the sample for aiGetMaterialFloat for more information.*/ |
1584 | // --------------------------------------------------------------------------- |
1585 | inline aiReturn aiGetMaterialInteger(const C_STRUCT aiMaterial *pMat, |
1586 | const char *pKey, |
1587 | unsigned int type, |
1588 | unsigned int index, |
1589 | int *pOut) { |
1590 | return aiGetMaterialIntegerArray(pMat, pKey, type, index, pOut, pMax: (unsigned int *)0x0); |
1591 | } |
1592 | |
1593 | // --------------------------------------------------------------------------- |
1594 | /** @brief Retrieve a color value from the material property table |
1595 | * |
1596 | * See the sample for aiGetMaterialFloat for more information*/ |
1597 | // --------------------------------------------------------------------------- |
1598 | ASSIMP_API C_ENUM aiReturn aiGetMaterialColor(const C_STRUCT aiMaterial *pMat, |
1599 | const char *pKey, |
1600 | unsigned int type, |
1601 | unsigned int index, |
1602 | C_STRUCT aiColor4D *pOut); |
1603 | |
1604 | // --------------------------------------------------------------------------- |
1605 | /** @brief Retrieve a aiUVTransform value from the material property table |
1606 | * |
1607 | * See the sample for aiGetMaterialFloat for more information*/ |
1608 | // --------------------------------------------------------------------------- |
1609 | ASSIMP_API C_ENUM aiReturn aiGetMaterialUVTransform(const C_STRUCT aiMaterial *pMat, |
1610 | const char *pKey, |
1611 | unsigned int type, |
1612 | unsigned int index, |
1613 | C_STRUCT aiUVTransform *pOut); |
1614 | |
1615 | // --------------------------------------------------------------------------- |
1616 | /** @brief Retrieve a string from the material property table |
1617 | * |
1618 | * See the sample for aiGetMaterialFloat for more information.*/ |
1619 | // --------------------------------------------------------------------------- |
1620 | ASSIMP_API C_ENUM aiReturn aiGetMaterialString(const C_STRUCT aiMaterial *pMat, |
1621 | const char *pKey, |
1622 | unsigned int type, |
1623 | unsigned int index, |
1624 | C_STRUCT aiString *pOut); |
1625 | |
1626 | // --------------------------------------------------------------------------- |
1627 | /** Get the number of textures for a particular texture type. |
1628 | * @param[in] pMat Pointer to the input material. May not be NULL |
1629 | * @param type Texture type to check for |
1630 | * @return Number of textures for this type. |
1631 | * @note A texture can be easily queried using #aiGetMaterialTexture() */ |
1632 | // --------------------------------------------------------------------------- |
1633 | ASSIMP_API unsigned int aiGetMaterialTextureCount(const C_STRUCT aiMaterial *pMat, |
1634 | C_ENUM aiTextureType type); |
1635 | |
1636 | // --------------------------------------------------------------------------- |
1637 | /** @brief Helper function to get all values pertaining to a particular |
1638 | * texture slot from a material structure. |
1639 | * |
1640 | * This function is provided just for convenience. You could also read the |
1641 | * texture by parsing all of its properties manually. This function bundles |
1642 | * all of them in a huge function monster. |
1643 | * |
1644 | * @param[in] mat Pointer to the input material. May not be NULL |
1645 | * @param[in] type Specifies the texture stack to read from (e.g. diffuse, |
1646 | * specular, height map ...). |
1647 | * @param[in] index Index of the texture. The function fails if the |
1648 | * requested index is not available for this texture type. |
1649 | * #aiGetMaterialTextureCount() can be used to determine the number of |
1650 | * textures in a particular texture stack. |
1651 | * @param[out] path Receives the output path |
1652 | * If the texture is embedded, receives a '*' followed by the id of |
1653 | * the texture (for the textures stored in the corresponding scene) which |
1654 | * can be converted to an int using a function like atoi. |
1655 | * This parameter must be non-null. |
1656 | * @param mapping The texture mapping mode to be used. |
1657 | * Pass NULL if you're not interested in this information. |
1658 | * @param[out] uvindex For UV-mapped textures: receives the index of the UV |
1659 | * source channel. Unmodified otherwise. |
1660 | * Pass NULL if you're not interested in this information. |
1661 | * @param[out] blend Receives the blend factor for the texture |
1662 | * Pass NULL if you're not interested in this information. |
1663 | * @param[out] op Receives the texture blend operation to be perform between |
1664 | * this texture and the previous texture. |
1665 | * Pass NULL if you're not interested in this information. |
1666 | * @param[out] mapmode Receives the mapping modes to be used for the texture. |
1667 | * Pass NULL if you're not interested in this information. Otherwise, |
1668 | * pass a pointer to an array of two aiTextureMapMode's (one for each |
1669 | * axis, UV order). |
1670 | * @param[out] flags Receives the the texture flags. |
1671 | * @return AI_SUCCESS on success, otherwise something else. Have fun.*/ |
1672 | // --------------------------------------------------------------------------- |
1673 | #ifdef __cplusplus |
1674 | ASSIMP_API aiReturn aiGetMaterialTexture(const C_STRUCT aiMaterial *mat, |
1675 | aiTextureType type, |
1676 | unsigned int index, |
1677 | aiString *path, |
1678 | aiTextureMapping *mapping = NULL, |
1679 | unsigned int *uvindex = NULL, |
1680 | ai_real *blend = NULL, |
1681 | aiTextureOp *op = NULL, |
1682 | aiTextureMapMode *mapmode = NULL, |
1683 | unsigned int *flags = NULL); |
1684 | #else |
1685 | C_ENUM aiReturn aiGetMaterialTexture(const C_STRUCT aiMaterial *mat, |
1686 | C_ENUM aiTextureType type, |
1687 | unsigned int index, |
1688 | C_STRUCT aiString *path, |
1689 | C_ENUM aiTextureMapping *mapping /*= NULL*/, |
1690 | unsigned int *uvindex /*= NULL*/, |
1691 | ai_real *blend /*= NULL*/, |
1692 | C_ENUM aiTextureOp *op /*= NULL*/, |
1693 | C_ENUM aiTextureMapMode *mapmode /*= NULL*/, |
1694 | unsigned int *flags /*= NULL*/); |
1695 | #endif // !#ifdef __cplusplus |
1696 | |
1697 | #ifdef __cplusplus |
1698 | } |
1699 | |
1700 | #include "material.inl" |
1701 | |
1702 | #endif //!__cplusplus |
1703 | |
1704 | #endif //!!AI_MATERIAL_H_INC |
1705 | |