/src/assimp/code/Common/material.cpp
Line | Count | Source |
1 | | /* |
2 | | Open Asset Import Library (assimp) |
3 | | ---------------------------------------------------------------------- |
4 | | |
5 | | Copyright (c) 2006-2025, assimp team |
6 | | |
7 | | All rights reserved. |
8 | | |
9 | | Redistribution and use of this software in source and binary forms, |
10 | | with or without modification, are permitted provided that the |
11 | | following conditions are met: |
12 | | |
13 | | * Redistributions of source code must retain the above |
14 | | copyright notice, this list of conditions and the |
15 | | following disclaimer. |
16 | | |
17 | | * Redistributions in binary form must reproduce the above |
18 | | copyright notice, this list of conditions and the |
19 | | following disclaimer in the documentation and/or other |
20 | | materials provided with the distribution. |
21 | | |
22 | | * Neither the name of the assimp team, nor the names of its |
23 | | contributors may be used to endorse or promote products |
24 | | derived from this software without specific prior |
25 | | written permission of the assimp team. |
26 | | |
27 | | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
28 | | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
29 | | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
30 | | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
31 | | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
32 | | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
33 | | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
34 | | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
35 | | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
36 | | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
37 | | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
38 | | |
39 | | ---------------------------------------------------------------------- |
40 | | */ |
41 | | |
42 | | /// @file material.cpp |
43 | | /** Implement common material related functions. */ |
44 | | |
45 | | #include <assimp/ai_assert.h> |
46 | | #include <assimp/material.h> |
47 | | |
48 | | // ------------------------------------------------------------------------------- |
49 | 32.1k | const char *aiTextureTypeToString(aiTextureType in) { |
50 | 32.1k | switch (in) { |
51 | 0 | case aiTextureType_NONE: |
52 | 0 | return "n/a"; |
53 | 1.88k | case aiTextureType_DIFFUSE: |
54 | 1.88k | return "Diffuse"; |
55 | 1.88k | case aiTextureType_SPECULAR: |
56 | 1.88k | return "Specular"; |
57 | 1.88k | case aiTextureType_AMBIENT: |
58 | 1.88k | return "Ambient"; |
59 | 1.88k | case aiTextureType_EMISSIVE: |
60 | 1.88k | return "Emissive"; |
61 | 1.88k | case aiTextureType_OPACITY: |
62 | 1.88k | return "Opacity"; |
63 | 1.88k | case aiTextureType_NORMALS: |
64 | 1.88k | return "Normals"; |
65 | 1.88k | case aiTextureType_HEIGHT: |
66 | 1.88k | return "Height"; |
67 | 1.88k | case aiTextureType_SHININESS: |
68 | 1.88k | return "Shininess"; |
69 | 1.88k | case aiTextureType_DISPLACEMENT: |
70 | 1.88k | return "Displacement"; |
71 | 1.88k | case aiTextureType_LIGHTMAP: |
72 | 1.88k | return "Lightmap"; |
73 | 1.88k | case aiTextureType_REFLECTION: |
74 | 1.88k | return "Reflection"; |
75 | 1.88k | case aiTextureType_BASE_COLOR: |
76 | 1.88k | return "BaseColor"; |
77 | 1.88k | case aiTextureType_NORMAL_CAMERA: |
78 | 1.88k | return "NormalCamera"; |
79 | 1.88k | case aiTextureType_EMISSION_COLOR: |
80 | 1.88k | return "EmissionColor"; |
81 | 1.88k | case aiTextureType_METALNESS: |
82 | 1.88k | return "Metalness"; |
83 | 1.88k | case aiTextureType_DIFFUSE_ROUGHNESS: |
84 | 1.88k | return "DiffuseRoughness"; |
85 | 1.88k | case aiTextureType_AMBIENT_OCCLUSION: |
86 | 1.88k | return "AmbientOcclusion"; |
87 | 0 | case aiTextureType_SHEEN: |
88 | 0 | return "Sheen"; |
89 | 0 | case aiTextureType_CLEARCOAT: |
90 | 0 | return "Clearcoat"; |
91 | 0 | case aiTextureType_TRANSMISSION: |
92 | 0 | return "Transmission"; |
93 | 0 | case aiTextureType_MAYA_BASE: |
94 | 0 | return "MayaBase"; |
95 | 0 | case aiTextureType_MAYA_SPECULAR: |
96 | 0 | return "MayaSpecular"; |
97 | 0 | case aiTextureType_MAYA_SPECULAR_COLOR: |
98 | 0 | return "MayaSpecularColor"; |
99 | 0 | case aiTextureType_MAYA_SPECULAR_ROUGHNESS: |
100 | 0 | return "MayaSpecularRoughness"; |
101 | 0 | case aiTextureType_ANISOTROPY: |
102 | 0 | return "Anisotropy"; |
103 | 0 | case aiTextureType_GLTF_METALLIC_ROUGHNESS: |
104 | 0 | return "glTFMetallicRoughness"; |
105 | 0 | case aiTextureType_UNKNOWN: |
106 | 0 | return "Unknown"; |
107 | 0 | default: |
108 | 0 | break; |
109 | 32.1k | } |
110 | 0 | ai_assert(false); |
111 | 0 | return "BUG"; |
112 | 32.1k | } |