GraphicsAPI_2020C
material.h
Go to the documentation of this file.
1 /*
2 ---------------------------------------------------------------------------
3 Open Asset Import Library (assimp)
4 ---------------------------------------------------------------------------
5 
6 Copyright (c) 2006-2017, assimp team
7 
8 
9 All rights reserved.
10 
11 Redistribution and use of this software in source and binary forms,
12 with or without modification, are permitted provided that the following
13 conditions are met:
14 
15 * Redistributions of source code must retain the above
16  copyright notice, this list of conditions and the
17  following disclaimer.
18 
19 * Redistributions in binary form must reproduce the above
20  copyright notice, this list of conditions and the
21  following disclaimer in the documentation and/or other
22  materials provided with the distribution.
23 
24 * Neither the name of the assimp team, nor the names of its
25  contributors may be used to endorse or promote products
26  derived from this software without specific prior
27  written permission of the assimp team.
28 
29 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
30 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
31 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
32 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
33 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
34 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
35 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
36 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
37 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
39 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40 ---------------------------------------------------------------------------
41 */
42 
46 #pragma once
47 #ifndef AI_MATERIAL_H_INC
48 #define AI_MATERIAL_H_INC
49 
50 #include "types.h"
51 
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55 
56 // Name for default materials (2nd is used if meshes have UV coords)
57 #define AI_DEFAULT_MATERIAL_NAME "DefaultMaterial"
58 
59 // ---------------------------------------------------------------------------
79 {
82 
85 
88 
91 
94 
97 
98 
99 #ifndef SWIG
100  _aiTextureOp_Force32Bit = INT_MAX
101 #endif
102 };
103 
104 // ---------------------------------------------------------------------------
110 {
114 
119 
124 
129 
130 #ifndef SWIG
131  _aiTextureMapMode_Force32Bit = INT_MAX
132 #endif
133 };
134 
135 // ---------------------------------------------------------------------------
145 {
153 
156 
159 
162 
165 
168 
169 
170 #ifndef SWIG
171  _aiTextureMapping_Force32Bit = INT_MAX
172 #endif
173 };
174 
175 // ---------------------------------------------------------------------------
191 {
199 
200 
201 
206 
211 
216 
221 
228 
236 
245 
252 
259 
268 
275 
283 
284 
285 #ifndef SWIG
286  _aiTextureType_Force32Bit = INT_MAX
287 #endif
288 };
289 
290 #define AI_TEXTURE_TYPE_MAX aiTextureType_UNKNOWN
291 
292 // ---------------------------------------------------------------------------
305 {
310 
314 
318 
322 
328 
335 
342 
348 
352 
356 
357 
358 #ifndef SWIG
359  _aiShadingMode_Force32Bit = INT_MAX
360 #endif
361 };
362 
363 
364 // ---------------------------------------------------------------------------
376 {
380 
391 
398 
399 #ifndef SWIG
400  _aiTextureFlags_Force32Bit = INT_MAX
401 #endif
402 };
403 
404 
405 // ---------------------------------------------------------------------------
422 {
430 
439 
440  // we don't need more for the moment, but we might need them
441  // in future versions ...
442 
443 #ifndef SWIG
444  _aiBlendMode_Force32Bit = INT_MAX
445 #endif
446 };
447 
448 
449 #include "./Compiler/pushpack1.h"
450 
451 // ---------------------------------------------------------------------------
462 {
468 
474 
481  ai_real mRotation;
482 
483 
484 #ifdef __cplusplus
485  aiUVTransform()
486  : mTranslation (0.0,0.0)
487  , mScaling (1.0,1.0)
488  , mRotation (0.0)
489  {
490  // nothing to be done here ...
491  }
492 #endif
493 
494 } PACK_STRUCT;
495 
496 #include "./Compiler/poppack1.h"
497 
499 // ---------------------------------------------------------------------------
503 enum aiPropertyTypeInfo
504 {
511  aiPTI_Float = 0x1,
512 
519  aiPTI_Double = 0x2,
520 
526  aiPTI_String = 0x3,
527 
534  aiPTI_Integer = 0x4,
535 
536 
539  aiPTI_Buffer = 0x5,
540 
541 
545 #ifndef SWIG
546  _aiPTI_Force32Bit = INT_MAX
547 #endif
548 };
549 
550 // ---------------------------------------------------------------------------
570 struct aiMaterialProperty
571 {
575  C_STRUCT aiString mKey;
576 
581  unsigned int mSemantic;
582 
586  unsigned int mIndex;
587 
591  unsigned int mDataLength;
592 
600  C_ENUM aiPropertyTypeInfo mType;
601 
605  char* mData;
606 
607 #ifdef __cplusplus
608 
609  aiMaterialProperty()
610  : mSemantic( 0 )
611  , mIndex( 0 )
612  , mDataLength( 0 )
613  , mType( aiPTI_Float )
614  , mData( NULL )
615  {
616  }
617 
618  ~aiMaterialProperty() {
619  delete[] mData;
620  }
621 
622 #endif
623 };
625 
626 #ifdef __cplusplus
627 } // We need to leave the "C" block here to allow template member functions
628 #endif
629 
630 // ---------------------------------------------------------------------------
639 #ifdef __cplusplus
640 struct ASSIMP_API aiMaterial
641 #else
643 #endif
644 {
645 
646 #ifdef __cplusplus
647 
648 public:
649 
650  aiMaterial();
651  ~aiMaterial();
652 
653  // -------------------------------------------------------------------
665  template <typename Type>
666  aiReturn Get(const char* pKey,unsigned int type,
667  unsigned int idx, Type* pOut, unsigned int* pMax) const;
668 
669  aiReturn Get(const char* pKey,unsigned int type,
670  unsigned int idx, int* pOut, unsigned int* pMax) const;
671 
672  aiReturn Get(const char* pKey,unsigned int type,
673  unsigned int idx, ai_real* pOut, unsigned int* pMax) const;
674 
675  // -------------------------------------------------------------------
685  template <typename Type>
686  aiReturn Get(const char* pKey,unsigned int type,
687  unsigned int idx,Type& pOut) const;
688 
689 
690  aiReturn Get(const char* pKey,unsigned int type,
691  unsigned int idx, int& pOut) const;
692 
693  aiReturn Get(const char* pKey,unsigned int type,
694  unsigned int idx, ai_real& pOut) const;
695 
696  aiReturn Get(const char* pKey,unsigned int type,
697  unsigned int idx, aiString& pOut) const;
698 
699  aiReturn Get(const char* pKey,unsigned int type,
700  unsigned int idx, aiColor3D& pOut) const;
701 
702  aiReturn Get(const char* pKey,unsigned int type,
703  unsigned int idx, aiColor4D& pOut) const;
704 
705  aiReturn Get(const char* pKey,unsigned int type,
706  unsigned int idx, aiUVTransform& pOut) const;
707 
708  // -------------------------------------------------------------------
713  unsigned int GetTextureCount(aiTextureType type) const;
714 
715  // -------------------------------------------------------------------
745  // -------------------------------------------------------------------
746  aiReturn GetTexture(aiTextureType type,
747  unsigned int index,
748  C_STRUCT aiString* path,
749  aiTextureMapping* mapping = NULL,
750  unsigned int* uvindex = NULL,
751  ai_real* blend = NULL,
752  aiTextureOp* op = NULL,
753  aiTextureMapMode* mapmode = NULL) const;
754 
755 
756  // Setters
757 
758 
759  // ------------------------------------------------------------------------------
769  aiReturn AddBinaryProperty (const void* pInput,
770  unsigned int pSizeInBytes,
771  const char* pKey,
772  unsigned int type ,
773  unsigned int index ,
774  aiPropertyTypeInfo pType);
775 
776  // ------------------------------------------------------------------------------
784  aiReturn AddProperty (const aiString* pInput,
785  const char* pKey,
786  unsigned int type = 0,
787  unsigned int index = 0);
788 
789  // ------------------------------------------------------------------------------
796  template<class TYPE>
797  aiReturn AddProperty (const TYPE* pInput,
798  unsigned int pNumValues,
799  const char* pKey,
800  unsigned int type = 0,
801  unsigned int index = 0);
802 
803  aiReturn AddProperty (const aiVector3D* pInput,
804  unsigned int pNumValues,
805  const char* pKey,
806  unsigned int type = 0,
807  unsigned int index = 0);
808 
809  aiReturn AddProperty (const aiColor3D* pInput,
810  unsigned int pNumValues,
811  const char* pKey,
812  unsigned int type = 0,
813  unsigned int index = 0);
814 
815  aiReturn AddProperty (const aiColor4D* pInput,
816  unsigned int pNumValues,
817  const char* pKey,
818  unsigned int type = 0,
819  unsigned int index = 0);
820 
821  aiReturn AddProperty (const int* pInput,
822  unsigned int pNumValues,
823  const char* pKey,
824  unsigned int type = 0,
825  unsigned int index = 0);
826 
827  aiReturn AddProperty (const float* pInput,
828  unsigned int pNumValues,
829  const char* pKey,
830  unsigned int type = 0,
831  unsigned int index = 0);
832 
833  aiReturn AddProperty (const double* pInput,
834  unsigned int pNumValues,
835  const char* pKey,
836  unsigned int type = 0,
837  unsigned int index = 0);
838 
839  aiReturn AddProperty (const aiUVTransform* pInput,
840  unsigned int pNumValues,
841  const char* pKey,
842  unsigned int type = 0,
843  unsigned int index = 0);
844 
845  // ------------------------------------------------------------------------------
852  aiReturn RemoveProperty (const char* pKey,
853  unsigned int type = 0,
854  unsigned int index = 0);
855 
856  // ------------------------------------------------------------------------------
860  void Clear();
861 
862  // ------------------------------------------------------------------------------
867  static void CopyPropertyList(aiMaterial* pcDest,
868  const aiMaterial* pcSrc);
869 
870 
871 #endif
872 
874  C_STRUCT aiMaterialProperty** mProperties;
875 
877  unsigned int mNumProperties;
878 
880  unsigned int mNumAllocated;
881 };
882 
883 // Go back to extern "C" again
884 #ifdef __cplusplus
885 extern "C" {
886 #endif
887 
888 // ---------------------------------------------------------------------------
889 #define AI_MATKEY_NAME "?mat.name",0,0
890 #define AI_MATKEY_TWOSIDED "$mat.twosided",0,0
891 #define AI_MATKEY_SHADING_MODEL "$mat.shadingm",0,0
892 #define AI_MATKEY_ENABLE_WIREFRAME "$mat.wireframe",0,0
893 #define AI_MATKEY_BLEND_FUNC "$mat.blend",0,0
894 #define AI_MATKEY_OPACITY "$mat.opacity",0,0
895 #define AI_MATKEY_BUMPSCALING "$mat.bumpscaling",0,0
896 #define AI_MATKEY_SHININESS "$mat.shininess",0,0
897 #define AI_MATKEY_REFLECTIVITY "$mat.reflectivity",0,0
898 #define AI_MATKEY_SHININESS_STRENGTH "$mat.shinpercent",0,0
899 #define AI_MATKEY_REFRACTI "$mat.refracti",0,0
900 #define AI_MATKEY_COLOR_DIFFUSE "$clr.diffuse",0,0
901 #define AI_MATKEY_COLOR_AMBIENT "$clr.ambient",0,0
902 #define AI_MATKEY_COLOR_SPECULAR "$clr.specular",0,0
903 #define AI_MATKEY_COLOR_EMISSIVE "$clr.emissive",0,0
904 #define AI_MATKEY_COLOR_TRANSPARENT "$clr.transparent",0,0
905 #define AI_MATKEY_COLOR_REFLECTIVE "$clr.reflective",0,0
906 #define AI_MATKEY_GLOBAL_BACKGROUND_IMAGE "?bg.global",0,0
907 
908 // ---------------------------------------------------------------------------
909 // Pure key names for all texture-related properties
911 #define _AI_MATKEY_TEXTURE_BASE "$tex.file"
912 #define _AI_MATKEY_UVWSRC_BASE "$tex.uvwsrc"
913 #define _AI_MATKEY_TEXOP_BASE "$tex.op"
914 #define _AI_MATKEY_MAPPING_BASE "$tex.mapping"
915 #define _AI_MATKEY_TEXBLEND_BASE "$tex.blend"
916 #define _AI_MATKEY_MAPPINGMODE_U_BASE "$tex.mapmodeu"
917 #define _AI_MATKEY_MAPPINGMODE_V_BASE "$tex.mapmodev"
918 #define _AI_MATKEY_TEXMAP_AXIS_BASE "$tex.mapaxis"
919 #define _AI_MATKEY_UVTRANSFORM_BASE "$tex.uvtrafo"
920 #define _AI_MATKEY_TEXFLAGS_BASE "$tex.flags"
921 
923 // ---------------------------------------------------------------------------
924 #define AI_MATKEY_TEXTURE(type, N) _AI_MATKEY_TEXTURE_BASE,type,N
925 
926 // For backward compatibility and simplicity
928 #define AI_MATKEY_TEXTURE_DIFFUSE(N) \
929  AI_MATKEY_TEXTURE(aiTextureType_DIFFUSE,N)
930 
931 #define AI_MATKEY_TEXTURE_SPECULAR(N) \
932  AI_MATKEY_TEXTURE(aiTextureType_SPECULAR,N)
933 
934 #define AI_MATKEY_TEXTURE_AMBIENT(N) \
935  AI_MATKEY_TEXTURE(aiTextureType_AMBIENT,N)
936 
937 #define AI_MATKEY_TEXTURE_EMISSIVE(N) \
938  AI_MATKEY_TEXTURE(aiTextureType_EMISSIVE,N)
939 
940 #define AI_MATKEY_TEXTURE_NORMALS(N) \
941  AI_MATKEY_TEXTURE(aiTextureType_NORMALS,N)
942 
943 #define AI_MATKEY_TEXTURE_HEIGHT(N) \
944  AI_MATKEY_TEXTURE(aiTextureType_HEIGHT,N)
945 
946 #define AI_MATKEY_TEXTURE_SHININESS(N) \
947  AI_MATKEY_TEXTURE(aiTextureType_SHININESS,N)
948 
949 #define AI_MATKEY_TEXTURE_OPACITY(N) \
950  AI_MATKEY_TEXTURE(aiTextureType_OPACITY,N)
951 
952 #define AI_MATKEY_TEXTURE_DISPLACEMENT(N) \
953  AI_MATKEY_TEXTURE(aiTextureType_DISPLACEMENT,N)
954 
955 #define AI_MATKEY_TEXTURE_LIGHTMAP(N) \
956  AI_MATKEY_TEXTURE(aiTextureType_LIGHTMAP,N)
957 
958 #define AI_MATKEY_TEXTURE_REFLECTION(N) \
959  AI_MATKEY_TEXTURE(aiTextureType_REFLECTION,N)
960 
962 
963 // ---------------------------------------------------------------------------
964 #define AI_MATKEY_UVWSRC(type, N) _AI_MATKEY_UVWSRC_BASE,type,N
965 
966 // For backward compatibility and simplicity
968 #define AI_MATKEY_UVWSRC_DIFFUSE(N) \
969  AI_MATKEY_UVWSRC(aiTextureType_DIFFUSE,N)
970 
971 #define AI_MATKEY_UVWSRC_SPECULAR(N) \
972  AI_MATKEY_UVWSRC(aiTextureType_SPECULAR,N)
973 
974 #define AI_MATKEY_UVWSRC_AMBIENT(N) \
975  AI_MATKEY_UVWSRC(aiTextureType_AMBIENT,N)
976 
977 #define AI_MATKEY_UVWSRC_EMISSIVE(N) \
978  AI_MATKEY_UVWSRC(aiTextureType_EMISSIVE,N)
979 
980 #define AI_MATKEY_UVWSRC_NORMALS(N) \
981  AI_MATKEY_UVWSRC(aiTextureType_NORMALS,N)
982 
983 #define AI_MATKEY_UVWSRC_HEIGHT(N) \
984  AI_MATKEY_UVWSRC(aiTextureType_HEIGHT,N)
985 
986 #define AI_MATKEY_UVWSRC_SHININESS(N) \
987  AI_MATKEY_UVWSRC(aiTextureType_SHININESS,N)
988 
989 #define AI_MATKEY_UVWSRC_OPACITY(N) \
990  AI_MATKEY_UVWSRC(aiTextureType_OPACITY,N)
991 
992 #define AI_MATKEY_UVWSRC_DISPLACEMENT(N) \
993  AI_MATKEY_UVWSRC(aiTextureType_DISPLACEMENT,N)
994 
995 #define AI_MATKEY_UVWSRC_LIGHTMAP(N) \
996  AI_MATKEY_UVWSRC(aiTextureType_LIGHTMAP,N)
997 
998 #define AI_MATKEY_UVWSRC_REFLECTION(N) \
999  AI_MATKEY_UVWSRC(aiTextureType_REFLECTION,N)
1000 
1002 // ---------------------------------------------------------------------------
1003 #define AI_MATKEY_TEXOP(type, N) _AI_MATKEY_TEXOP_BASE,type,N
1004 
1005 // For backward compatibility and simplicity
1007 #define AI_MATKEY_TEXOP_DIFFUSE(N) \
1008  AI_MATKEY_TEXOP(aiTextureType_DIFFUSE,N)
1009 
1010 #define AI_MATKEY_TEXOP_SPECULAR(N) \
1011  AI_MATKEY_TEXOP(aiTextureType_SPECULAR,N)
1012 
1013 #define AI_MATKEY_TEXOP_AMBIENT(N) \
1014  AI_MATKEY_TEXOP(aiTextureType_AMBIENT,N)
1015 
1016 #define AI_MATKEY_TEXOP_EMISSIVE(N) \
1017  AI_MATKEY_TEXOP(aiTextureType_EMISSIVE,N)
1018 
1019 #define AI_MATKEY_TEXOP_NORMALS(N) \
1020  AI_MATKEY_TEXOP(aiTextureType_NORMALS,N)
1021 
1022 #define AI_MATKEY_TEXOP_HEIGHT(N) \
1023  AI_MATKEY_TEXOP(aiTextureType_HEIGHT,N)
1024 
1025 #define AI_MATKEY_TEXOP_SHININESS(N) \
1026  AI_MATKEY_TEXOP(aiTextureType_SHININESS,N)
1027 
1028 #define AI_MATKEY_TEXOP_OPACITY(N) \
1029  AI_MATKEY_TEXOP(aiTextureType_OPACITY,N)
1030 
1031 #define AI_MATKEY_TEXOP_DISPLACEMENT(N) \
1032  AI_MATKEY_TEXOP(aiTextureType_DISPLACEMENT,N)
1033 
1034 #define AI_MATKEY_TEXOP_LIGHTMAP(N) \
1035  AI_MATKEY_TEXOP(aiTextureType_LIGHTMAP,N)
1036 
1037 #define AI_MATKEY_TEXOP_REFLECTION(N) \
1038  AI_MATKEY_TEXOP(aiTextureType_REFLECTION,N)
1039 
1041 // ---------------------------------------------------------------------------
1042 #define AI_MATKEY_MAPPING(type, N) _AI_MATKEY_MAPPING_BASE,type,N
1043 
1044 // For backward compatibility and simplicity
1046 #define AI_MATKEY_MAPPING_DIFFUSE(N) \
1047  AI_MATKEY_MAPPING(aiTextureType_DIFFUSE,N)
1048 
1049 #define AI_MATKEY_MAPPING_SPECULAR(N) \
1050  AI_MATKEY_MAPPING(aiTextureType_SPECULAR,N)
1051 
1052 #define AI_MATKEY_MAPPING_AMBIENT(N) \
1053  AI_MATKEY_MAPPING(aiTextureType_AMBIENT,N)
1054 
1055 #define AI_MATKEY_MAPPING_EMISSIVE(N) \
1056  AI_MATKEY_MAPPING(aiTextureType_EMISSIVE,N)
1057 
1058 #define AI_MATKEY_MAPPING_NORMALS(N) \
1059  AI_MATKEY_MAPPING(aiTextureType_NORMALS,N)
1060 
1061 #define AI_MATKEY_MAPPING_HEIGHT(N) \
1062  AI_MATKEY_MAPPING(aiTextureType_HEIGHT,N)
1063 
1064 #define AI_MATKEY_MAPPING_SHININESS(N) \
1065  AI_MATKEY_MAPPING(aiTextureType_SHININESS,N)
1066 
1067 #define AI_MATKEY_MAPPING_OPACITY(N) \
1068  AI_MATKEY_MAPPING(aiTextureType_OPACITY,N)
1069 
1070 #define AI_MATKEY_MAPPING_DISPLACEMENT(N) \
1071  AI_MATKEY_MAPPING(aiTextureType_DISPLACEMENT,N)
1072 
1073 #define AI_MATKEY_MAPPING_LIGHTMAP(N) \
1074  AI_MATKEY_MAPPING(aiTextureType_LIGHTMAP,N)
1075 
1076 #define AI_MATKEY_MAPPING_REFLECTION(N) \
1077  AI_MATKEY_MAPPING(aiTextureType_REFLECTION,N)
1078 
1080 // ---------------------------------------------------------------------------
1081 #define AI_MATKEY_TEXBLEND(type, N) _AI_MATKEY_TEXBLEND_BASE,type,N
1082 
1083 // For backward compatibility and simplicity
1085 #define AI_MATKEY_TEXBLEND_DIFFUSE(N) \
1086  AI_MATKEY_TEXBLEND(aiTextureType_DIFFUSE,N)
1087 
1088 #define AI_MATKEY_TEXBLEND_SPECULAR(N) \
1089  AI_MATKEY_TEXBLEND(aiTextureType_SPECULAR,N)
1090 
1091 #define AI_MATKEY_TEXBLEND_AMBIENT(N) \
1092  AI_MATKEY_TEXBLEND(aiTextureType_AMBIENT,N)
1093 
1094 #define AI_MATKEY_TEXBLEND_EMISSIVE(N) \
1095  AI_MATKEY_TEXBLEND(aiTextureType_EMISSIVE,N)
1096 
1097 #define AI_MATKEY_TEXBLEND_NORMALS(N) \
1098  AI_MATKEY_TEXBLEND(aiTextureType_NORMALS,N)
1099 
1100 #define AI_MATKEY_TEXBLEND_HEIGHT(N) \
1101  AI_MATKEY_TEXBLEND(aiTextureType_HEIGHT,N)
1102 
1103 #define AI_MATKEY_TEXBLEND_SHININESS(N) \
1104  AI_MATKEY_TEXBLEND(aiTextureType_SHININESS,N)
1105 
1106 #define AI_MATKEY_TEXBLEND_OPACITY(N) \
1107  AI_MATKEY_TEXBLEND(aiTextureType_OPACITY,N)
1108 
1109 #define AI_MATKEY_TEXBLEND_DISPLACEMENT(N) \
1110  AI_MATKEY_TEXBLEND(aiTextureType_DISPLACEMENT,N)
1111 
1112 #define AI_MATKEY_TEXBLEND_LIGHTMAP(N) \
1113  AI_MATKEY_TEXBLEND(aiTextureType_LIGHTMAP,N)
1114 
1115 #define AI_MATKEY_TEXBLEND_REFLECTION(N) \
1116  AI_MATKEY_TEXBLEND(aiTextureType_REFLECTION,N)
1117 
1119 // ---------------------------------------------------------------------------
1120 #define AI_MATKEY_MAPPINGMODE_U(type, N) _AI_MATKEY_MAPPINGMODE_U_BASE,type,N
1121 
1122 // For backward compatibility and simplicity
1124 #define AI_MATKEY_MAPPINGMODE_U_DIFFUSE(N) \
1125  AI_MATKEY_MAPPINGMODE_U(aiTextureType_DIFFUSE,N)
1126 
1127 #define AI_MATKEY_MAPPINGMODE_U_SPECULAR(N) \
1128  AI_MATKEY_MAPPINGMODE_U(aiTextureType_SPECULAR,N)
1129 
1130 #define AI_MATKEY_MAPPINGMODE_U_AMBIENT(N) \
1131  AI_MATKEY_MAPPINGMODE_U(aiTextureType_AMBIENT,N)
1132 
1133 #define AI_MATKEY_MAPPINGMODE_U_EMISSIVE(N) \
1134  AI_MATKEY_MAPPINGMODE_U(aiTextureType_EMISSIVE,N)
1135 
1136 #define AI_MATKEY_MAPPINGMODE_U_NORMALS(N) \
1137  AI_MATKEY_MAPPINGMODE_U(aiTextureType_NORMALS,N)
1138 
1139 #define AI_MATKEY_MAPPINGMODE_U_HEIGHT(N) \
1140  AI_MATKEY_MAPPINGMODE_U(aiTextureType_HEIGHT,N)
1141 
1142 #define AI_MATKEY_MAPPINGMODE_U_SHININESS(N) \
1143  AI_MATKEY_MAPPINGMODE_U(aiTextureType_SHININESS,N)
1144 
1145 #define AI_MATKEY_MAPPINGMODE_U_OPACITY(N) \
1146  AI_MATKEY_MAPPINGMODE_U(aiTextureType_OPACITY,N)
1147 
1148 #define AI_MATKEY_MAPPINGMODE_U_DISPLACEMENT(N) \
1149  AI_MATKEY_MAPPINGMODE_U(aiTextureType_DISPLACEMENT,N)
1150 
1151 #define AI_MATKEY_MAPPINGMODE_U_LIGHTMAP(N) \
1152  AI_MATKEY_MAPPINGMODE_U(aiTextureType_LIGHTMAP,N)
1153 
1154 #define AI_MATKEY_MAPPINGMODE_U_REFLECTION(N) \
1155  AI_MATKEY_MAPPINGMODE_U(aiTextureType_REFLECTION,N)
1156 
1158 // ---------------------------------------------------------------------------
1159 #define AI_MATKEY_MAPPINGMODE_V(type, N) _AI_MATKEY_MAPPINGMODE_V_BASE,type,N
1160 
1161 // For backward compatibility and simplicity
1163 #define AI_MATKEY_MAPPINGMODE_V_DIFFUSE(N) \
1164  AI_MATKEY_MAPPINGMODE_V(aiTextureType_DIFFUSE,N)
1165 
1166 #define AI_MATKEY_MAPPINGMODE_V_SPECULAR(N) \
1167  AI_MATKEY_MAPPINGMODE_V(aiTextureType_SPECULAR,N)
1168 
1169 #define AI_MATKEY_MAPPINGMODE_V_AMBIENT(N) \
1170  AI_MATKEY_MAPPINGMODE_V(aiTextureType_AMBIENT,N)
1171 
1172 #define AI_MATKEY_MAPPINGMODE_V_EMISSIVE(N) \
1173  AI_MATKEY_MAPPINGMODE_V(aiTextureType_EMISSIVE,N)
1174 
1175 #define AI_MATKEY_MAPPINGMODE_V_NORMALS(N) \
1176  AI_MATKEY_MAPPINGMODE_V(aiTextureType_NORMALS,N)
1177 
1178 #define AI_MATKEY_MAPPINGMODE_V_HEIGHT(N) \
1179  AI_MATKEY_MAPPINGMODE_V(aiTextureType_HEIGHT,N)
1180 
1181 #define AI_MATKEY_MAPPINGMODE_V_SHININESS(N) \
1182  AI_MATKEY_MAPPINGMODE_V(aiTextureType_SHININESS,N)
1183 
1184 #define AI_MATKEY_MAPPINGMODE_V_OPACITY(N) \
1185  AI_MATKEY_MAPPINGMODE_V(aiTextureType_OPACITY,N)
1186 
1187 #define AI_MATKEY_MAPPINGMODE_V_DISPLACEMENT(N) \
1188  AI_MATKEY_MAPPINGMODE_V(aiTextureType_DISPLACEMENT,N)
1189 
1190 #define AI_MATKEY_MAPPINGMODE_V_LIGHTMAP(N) \
1191  AI_MATKEY_MAPPINGMODE_V(aiTextureType_LIGHTMAP,N)
1192 
1193 #define AI_MATKEY_MAPPINGMODE_V_REFLECTION(N) \
1194  AI_MATKEY_MAPPINGMODE_V(aiTextureType_REFLECTION,N)
1195 
1197 // ---------------------------------------------------------------------------
1198 #define AI_MATKEY_TEXMAP_AXIS(type, N) _AI_MATKEY_TEXMAP_AXIS_BASE,type,N
1199 
1200 // For backward compatibility and simplicity
1202 #define AI_MATKEY_TEXMAP_AXIS_DIFFUSE(N) \
1203  AI_MATKEY_TEXMAP_AXIS(aiTextureType_DIFFUSE,N)
1204 
1205 #define AI_MATKEY_TEXMAP_AXIS_SPECULAR(N) \
1206  AI_MATKEY_TEXMAP_AXIS(aiTextureType_SPECULAR,N)
1207 
1208 #define AI_MATKEY_TEXMAP_AXIS_AMBIENT(N) \
1209  AI_MATKEY_TEXMAP_AXIS(aiTextureType_AMBIENT,N)
1210 
1211 #define AI_MATKEY_TEXMAP_AXIS_EMISSIVE(N) \
1212  AI_MATKEY_TEXMAP_AXIS(aiTextureType_EMISSIVE,N)
1213 
1214 #define AI_MATKEY_TEXMAP_AXIS_NORMALS(N) \
1215  AI_MATKEY_TEXMAP_AXIS(aiTextureType_NORMALS,N)
1216 
1217 #define AI_MATKEY_TEXMAP_AXIS_HEIGHT(N) \
1218  AI_MATKEY_TEXMAP_AXIS(aiTextureType_HEIGHT,N)
1219 
1220 #define AI_MATKEY_TEXMAP_AXIS_SHININESS(N) \
1221  AI_MATKEY_TEXMAP_AXIS(aiTextureType_SHININESS,N)
1222 
1223 #define AI_MATKEY_TEXMAP_AXIS_OPACITY(N) \
1224  AI_MATKEY_TEXMAP_AXIS(aiTextureType_OPACITY,N)
1225 
1226 #define AI_MATKEY_TEXMAP_AXIS_DISPLACEMENT(N) \
1227  AI_MATKEY_TEXMAP_AXIS(aiTextureType_DISPLACEMENT,N)
1228 
1229 #define AI_MATKEY_TEXMAP_AXIS_LIGHTMAP(N) \
1230  AI_MATKEY_TEXMAP_AXIS(aiTextureType_LIGHTMAP,N)
1231 
1232 #define AI_MATKEY_TEXMAP_AXIS_REFLECTION(N) \
1233  AI_MATKEY_TEXMAP_AXIS(aiTextureType_REFLECTION,N)
1234 
1236 // ---------------------------------------------------------------------------
1237 #define AI_MATKEY_UVTRANSFORM(type, N) _AI_MATKEY_UVTRANSFORM_BASE,type,N
1238 
1239 // For backward compatibility and simplicity
1241 #define AI_MATKEY_UVTRANSFORM_DIFFUSE(N) \
1242  AI_MATKEY_UVTRANSFORM(aiTextureType_DIFFUSE,N)
1243 
1244 #define AI_MATKEY_UVTRANSFORM_SPECULAR(N) \
1245  AI_MATKEY_UVTRANSFORM(aiTextureType_SPECULAR,N)
1246 
1247 #define AI_MATKEY_UVTRANSFORM_AMBIENT(N) \
1248  AI_MATKEY_UVTRANSFORM(aiTextureType_AMBIENT,N)
1249 
1250 #define AI_MATKEY_UVTRANSFORM_EMISSIVE(N) \
1251  AI_MATKEY_UVTRANSFORM(aiTextureType_EMISSIVE,N)
1252 
1253 #define AI_MATKEY_UVTRANSFORM_NORMALS(N) \
1254  AI_MATKEY_UVTRANSFORM(aiTextureType_NORMALS,N)
1255 
1256 #define AI_MATKEY_UVTRANSFORM_HEIGHT(N) \
1257  AI_MATKEY_UVTRANSFORM(aiTextureType_HEIGHT,N)
1258 
1259 #define AI_MATKEY_UVTRANSFORM_SHININESS(N) \
1260  AI_MATKEY_UVTRANSFORM(aiTextureType_SHININESS,N)
1261 
1262 #define AI_MATKEY_UVTRANSFORM_OPACITY(N) \
1263  AI_MATKEY_UVTRANSFORM(aiTextureType_OPACITY,N)
1264 
1265 #define AI_MATKEY_UVTRANSFORM_DISPLACEMENT(N) \
1266  AI_MATKEY_UVTRANSFORM(aiTextureType_DISPLACEMENT,N)
1267 
1268 #define AI_MATKEY_UVTRANSFORM_LIGHTMAP(N) \
1269  AI_MATKEY_UVTRANSFORM(aiTextureType_LIGHTMAP,N)
1270 
1271 #define AI_MATKEY_UVTRANSFORM_REFLECTION(N) \
1272  AI_MATKEY_UVTRANSFORM(aiTextureType_REFLECTION,N)
1273 
1274 #define AI_MATKEY_UVTRANSFORM_UNKNOWN(N) \
1275  AI_MATKEY_UVTRANSFORM(aiTextureType_UNKNOWN,N)
1276 
1278 // ---------------------------------------------------------------------------
1279 #define AI_MATKEY_TEXFLAGS(type, N) _AI_MATKEY_TEXFLAGS_BASE,type,N
1280 
1281 // For backward compatibility and simplicity
1283 #define AI_MATKEY_TEXFLAGS_DIFFUSE(N) \
1284  AI_MATKEY_TEXFLAGS(aiTextureType_DIFFUSE,N)
1285 
1286 #define AI_MATKEY_TEXFLAGS_SPECULAR(N) \
1287  AI_MATKEY_TEXFLAGS(aiTextureType_SPECULAR,N)
1288 
1289 #define AI_MATKEY_TEXFLAGS_AMBIENT(N) \
1290  AI_MATKEY_TEXFLAGS(aiTextureType_AMBIENT,N)
1291 
1292 #define AI_MATKEY_TEXFLAGS_EMISSIVE(N) \
1293  AI_MATKEY_TEXFLAGS(aiTextureType_EMISSIVE,N)
1294 
1295 #define AI_MATKEY_TEXFLAGS_NORMALS(N) \
1296  AI_MATKEY_TEXFLAGS(aiTextureType_NORMALS,N)
1297 
1298 #define AI_MATKEY_TEXFLAGS_HEIGHT(N) \
1299  AI_MATKEY_TEXFLAGS(aiTextureType_HEIGHT,N)
1300 
1301 #define AI_MATKEY_TEXFLAGS_SHININESS(N) \
1302  AI_MATKEY_TEXFLAGS(aiTextureType_SHININESS,N)
1303 
1304 #define AI_MATKEY_TEXFLAGS_OPACITY(N) \
1305  AI_MATKEY_TEXFLAGS(aiTextureType_OPACITY,N)
1306 
1307 #define AI_MATKEY_TEXFLAGS_DISPLACEMENT(N) \
1308  AI_MATKEY_TEXFLAGS(aiTextureType_DISPLACEMENT,N)
1309 
1310 #define AI_MATKEY_TEXFLAGS_LIGHTMAP(N) \
1311  AI_MATKEY_TEXFLAGS(aiTextureType_LIGHTMAP,N)
1312 
1313 #define AI_MATKEY_TEXFLAGS_REFLECTION(N) \
1314  AI_MATKEY_TEXFLAGS(aiTextureType_REFLECTION,N)
1315 
1316 #define AI_MATKEY_TEXFLAGS_UNKNOWN(N) \
1317  AI_MATKEY_TEXFLAGS(aiTextureType_UNKNOWN,N)
1318 
1321 // ---------------------------------------------------------------------------
1331 // ---------------------------------------------------------------------------
1332 ASSIMP_API C_ENUM aiReturn aiGetMaterialProperty(
1333  const C_STRUCT aiMaterial* pMat,
1334  const char* pKey,
1335  unsigned int type,
1336  unsigned int index,
1337  const C_STRUCT aiMaterialProperty** pPropOut);
1338 
1339 // ---------------------------------------------------------------------------
1364 // ---------------------------------------------------------------------------
1365 ASSIMP_API C_ENUM aiReturn aiGetMaterialFloatArray(
1366  const C_STRUCT aiMaterial* pMat,
1367  const char* pKey,
1368  unsigned int type,
1369  unsigned int index,
1370  ai_real* pOut,
1371  unsigned int* pMax);
1372 
1373 
1374 #ifdef __cplusplus
1375 
1376 // ---------------------------------------------------------------------------
1394 // ---------------------------------------------------------------------------
1395 inline aiReturn aiGetMaterialFloat(const aiMaterial* pMat,
1396  const char* pKey,
1397  unsigned int type,
1398  unsigned int index,
1399  ai_real* pOut)
1400 {
1401  return aiGetMaterialFloatArray(pMat,pKey,type,index,pOut,(unsigned int*)0x0);
1402 }
1403 
1404 #else
1405 
1406 // Use our friend, the C preprocessor
1407 #define aiGetMaterialFloat (pMat, type, index, pKey, pOut) \
1408  aiGetMaterialFloatArray(pMat, type, index, pKey, pOut, NULL)
1409 
1410 #endif
1411 
1412 
1413 // ---------------------------------------------------------------------------
1418 ASSIMP_API C_ENUM aiReturn aiGetMaterialIntegerArray(const C_STRUCT aiMaterial* pMat,
1419  const char* pKey,
1420  unsigned int type,
1421  unsigned int index,
1422  int* pOut,
1423  unsigned int* pMax);
1424 
1425 
1426 #ifdef __cplusplus
1427 
1428 // ---------------------------------------------------------------------------
1432 // ---------------------------------------------------------------------------
1433 inline aiReturn aiGetMaterialInteger(const C_STRUCT aiMaterial* pMat,
1434  const char* pKey,
1435  unsigned int type,
1436  unsigned int index,
1437  int* pOut)
1438 {
1439  return aiGetMaterialIntegerArray(pMat,pKey,type,index,pOut,(unsigned int*)0x0);
1440 }
1441 
1442 #else
1443 
1444 // use our friend, the C preprocessor
1445 #define aiGetMaterialInteger (pMat, type, index, pKey, pOut) \
1446  aiGetMaterialIntegerArray(pMat, type, index, pKey, pOut, NULL)
1447 
1448 #endif
1449 
1450 
1451 
1452 // ---------------------------------------------------------------------------
1456 // ---------------------------------------------------------------------------
1457 ASSIMP_API C_ENUM aiReturn aiGetMaterialColor(const C_STRUCT aiMaterial* pMat,
1458  const char* pKey,
1459  unsigned int type,
1460  unsigned int index,
1461  C_STRUCT aiColor4D* pOut);
1462 
1463 
1464 // ---------------------------------------------------------------------------
1468 // ---------------------------------------------------------------------------
1469 ASSIMP_API C_ENUM aiReturn aiGetMaterialUVTransform(const C_STRUCT aiMaterial* pMat,
1470  const char* pKey,
1471  unsigned int type,
1472  unsigned int index,
1473  C_STRUCT aiUVTransform* pOut);
1474 
1475 
1476 // ---------------------------------------------------------------------------
1480 // ---------------------------------------------------------------------------
1481 ASSIMP_API C_ENUM aiReturn aiGetMaterialString(const C_STRUCT aiMaterial* pMat,
1482  const char* pKey,
1483  unsigned int type,
1484  unsigned int index,
1485  C_STRUCT aiString* pOut);
1486 
1487 // ---------------------------------------------------------------------------
1493 // ---------------------------------------------------------------------------
1494 ASSIMP_API unsigned int aiGetMaterialTextureCount(const C_STRUCT aiMaterial* pMat,
1495  C_ENUM aiTextureType type);
1496 
1497 // ---------------------------------------------------------------------------
1533 // ---------------------------------------------------------------------------
1534 #ifdef __cplusplus
1535 ASSIMP_API aiReturn aiGetMaterialTexture(const C_STRUCT aiMaterial* mat,
1536  aiTextureType type,
1537  unsigned int index,
1538  aiString* path,
1539  aiTextureMapping* mapping = NULL,
1540  unsigned int* uvindex = NULL,
1541  ai_real* blend = NULL,
1542  aiTextureOp* op = NULL,
1543  aiTextureMapMode* mapmode = NULL,
1544  unsigned int* flags = NULL);
1545 #else
1546 C_ENUM aiReturn aiGetMaterialTexture(const C_STRUCT aiMaterial* mat,
1547  C_ENUM aiTextureType type,
1548  unsigned int index,
1549  C_STRUCT aiString* path,
1550  C_ENUM aiTextureMapping* mapping /*= NULL*/,
1551  unsigned int* uvindex /*= NULL*/,
1552  ai_real* blend /*= NULL*/,
1553  C_ENUM aiTextureOp* op /*= NULL*/,
1554  C_ENUM aiTextureMapMode* mapmode /*= NULL*/,
1555  unsigned int* flags /*= NULL*/);
1556 #endif // !#ifdef __cplusplus
1557 
1558 #ifdef __cplusplus
1559 }
1560 
1561 #include "material.inl"
1562 
1563 #endif
1564 #endif
ASSIMP_API C_ENUM aiReturn aiGetMaterialProperty(const C_STRUCT aiMaterial *pMat, const char *pKey, unsigned int type, unsigned int index, const C_STRUCT aiMaterialProperty **pPropOut)
Retrieve a material property with a specific key from the material.
T = T1 / T2.
Definition: material.h:90
T = T1 + (T2-0.5)
Definition: material.h:96
No shading at all.
Definition: material.h:351
T = T1 * T2.
Definition: material.h:81
Formula:
Definition: material.h:429
aiBlendMode
Defines alpha-blend flags.
Definition: material.h:421
OrenNayar-Shading per pixel.
Definition: material.h:334
A texture coordinate u|v is translated to u%1|v%1.
Definition: material.h:113
Basic data types and primitives, such as vectors or colors.
T = T1 - T2.
Definition: material.h:87
ASSIMP_API C_ENUM aiReturn aiGetMaterialIntegerArray(const C_STRUCT aiMaterial *pMat, const char *pKey, unsigned int type, unsigned int index, int *pOut, unsigned int *pMax)
__cplusplus
The texture is a (tangent space) normal-map.
Definition: material.h:235
Explicit request to the application to process the alpha channel of the texture.
Definition: material.h:390
The texture is a height map.
Definition: material.h:227
aiTextureFlags
Defines some mixed flags for a particular texture.
Definition: material.h:375
ASSIMP_API unsigned int aiGetMaterialTextureCount(const C_STRUCT aiMaterial *pMat, C_ENUM aiTextureType type)
Get the number of textures for a particular texture type.
Planar mapping.
Definition: material.h:164
Represents a two-dimensional vector.
Definition: vector2.h:108
unsigned int mNumProperties
Number of properties in the data base.
Definition: material.h:877
ASSIMP_API C_ENUM aiReturn aiGetMaterialUVTransform(const C_STRUCT aiMaterial *pMat, const char *pKey, unsigned int type, unsigned int index, C_STRUCT aiUVTransform *pOut)
Retrieve a aiUVTransform value from the material property table.
Undefined mapping.
Definition: material.h:167
Flat shading.
Definition: material.h:309
T = (T1 + T2) - (T1 * T2)
Definition: material.h:93
Cylindrical mapping.
Definition: material.h:158
Texture coordinates outside [0...1] are clamped to the nearest valid value.
Definition: material.h:118
Fresnel shading.
Definition: material.h:355
ASSIMP_API C_ENUM aiReturn aiGetMaterialFloatArray(const C_STRUCT aiMaterial *pMat, const char *pKey, unsigned int type, unsigned int index, ai_real *pOut, unsigned int *pMax)
Retrieve an array of float values with a specific key from the material.
aiReturn
Standard return type for some library functions.
Definition: types.h:375
aiShadingMode
Defines all shading models supported by the library.
Definition: material.h:304
C_STRUCT aiVector2D mTranslation
Translation on the u and v axes.
Definition: material.h:467
Cubic mapping.
Definition: material.h:161
The texture is combined with the result of the ambient lighting equation.
Definition: material.h:215
Unknown texture.
Definition: material.h:282
Defines the C++ getters for the material system.
ai_real mRotation
Rotation - in counter-clockwise direction.
Definition: material.h:481
ASSIMP_API C_ENUM aiReturn aiGetMaterialColor(const C_STRUCT aiMaterial *pMat, const char *pKey, unsigned int type, unsigned int index, C_STRUCT aiColor4D *pOut)
__cplusplus
Dummy value.
Definition: material.h:198
Displacement texture.
Definition: material.h:258
Represents an UTF-8 string, zero byte terminated.
Definition: types.h:252
aiTextureMapMode
Defines how UV coordinates outside the [0...1] range are handled.
Definition: material.h:109
unsigned int mNumAllocated
Storage allocated.
Definition: material.h:880
The texture is added to the result of the lighting calculation.
Definition: material.h:220
CookTorrance-Shading per pixel.
Definition: material.h:347
Defines how an UV channel is transformed.
Definition: material.h:461
Phong-Blinn-Shading.
Definition: material.h:321
A texture coordinate u|v becomes u%1|v%1 if (u-(u%1))%2 is zero and 1-(u%1)|1-(v%1) otherwise...
Definition: material.h:128
aiTextureMapping
Defines how the mapping coords for a texture are generated.
Definition: material.h:144
The texture is combined with the result of the specular lighting equation.
Definition: material.h:210
C_STRUCT aiVector2D mScaling
Scaling on the u and v axes.
Definition: material.h:473
Definition: vector3.h:135
The mapping coordinates are taken from an UV channel.
Definition: material.h:152
Represents a color in Red-Green-Blue space.
Definition: types.h:158
The texture is combined with the result of the diffuse lighting equation.
Definition: material.h:205
Additive blending.
Definition: material.h:438
The texture&#39;s color values have to be inverted (componentwise 1-n)
Definition: material.h:379
Spherical mapping.
Definition: material.h:155
aiTextureOp
Defines how the Nth texture of a specific type is combined with the result of all previous layers...
Definition: material.h:78
aiTextureType
Defines the purpose of a texture.
Definition: material.h:190
Toon-Shading per pixel.
Definition: material.h:327
Definition: color4.h:98
T = T1 + T2.
Definition: material.h:84
The texture defines per-pixel opacity.
Definition: material.h:251
Explicit request to the application to ignore the alpha channel of the texture.
Definition: material.h:397
ASSIMP_API C_ENUM aiReturn aiGetMaterialString(const C_STRUCT aiMaterial *pMat, const char *pKey, unsigned int type, unsigned int index, C_STRUCT aiString *pOut)
Retrieve a string from the material property table.
Phong-Shading -.
Definition: material.h:317
If the texture coordinates for a pixel are outside [0...1] the texture is not applied to that pixel...
Definition: material.h:123
Lightmap texture (aka Ambient Occlusion)
Definition: material.h:267
Simple Gouraud shading.
Definition: material.h:313
Minnaert-Shading per pixel.
Definition: material.h:341
Data structure for a material.
Definition: material.h:642
Reflection texture.
Definition: material.h:274
The texture defines the glossiness of the material.
Definition: material.h:244
C_ENUM aiReturn aiGetMaterialTexture(const C_STRUCT aiMaterial *mat, C_ENUM aiTextureType type, unsigned int index, C_STRUCT aiString *path, C_ENUM aiTextureMapping *mapping, unsigned int *uvindex, ai_real *blend, C_ENUM aiTextureOp *op, C_ENUM aiTextureMapMode *mapmode, unsigned int *flags)
Helper function to get all values pertaining to a particular texture slot from a material structure...