1 | /* |
2 | Open Asset Import Library (assimp) |
3 | ---------------------------------------------------------------------- |
4 | |
5 | Copyright (c) 2006-2019, assimp team |
6 | |
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 |
12 | following 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 | |
43 | /** @file postprocess.h |
44 | * @brief Definitions for import post processing steps |
45 | */ |
46 | #pragma once |
47 | #ifndef AI_POSTPROCESS_H_INC |
48 | #define AI_POSTPROCESS_H_INC |
49 | |
50 | #include "types.h" |
51 | |
52 | #ifdef __cplusplus |
53 | extern "C" { |
54 | #endif |
55 | |
56 | // ----------------------------------------------------------------------------------- |
57 | /** @enum aiPostProcessSteps |
58 | * @brief Defines the flags for all possible post processing steps. |
59 | * |
60 | * @note Some steps are influenced by properties set on the Assimp::Importer itself |
61 | * |
62 | * @see Assimp::Importer::ReadFile() |
63 | * @see Assimp::Importer::SetPropertyInteger() |
64 | * @see aiImportFile |
65 | * @see aiImportFileEx |
66 | */ |
67 | // ----------------------------------------------------------------------------------- |
68 | enum aiPostProcessSteps |
69 | { |
70 | |
71 | // ------------------------------------------------------------------------- |
72 | /** <hr>Calculates the tangents and bitangents for the imported meshes. |
73 | * |
74 | * Does nothing if a mesh does not have normals. You might want this post |
75 | * processing step to be executed if you plan to use tangent space calculations |
76 | * such as normal mapping applied to the meshes. There's an importer property, |
77 | * <tt>#AI_CONFIG_PP_CT_MAX_SMOOTHING_ANGLE</tt>, which allows you to specify |
78 | * a maximum smoothing angle for the algorithm. However, usually you'll |
79 | * want to leave it at the default value. |
80 | */ |
81 | aiProcess_CalcTangentSpace = 0x1, |
82 | |
83 | // ------------------------------------------------------------------------- |
84 | /** <hr>Identifies and joins identical vertex data sets within all |
85 | * imported meshes. |
86 | * |
87 | * After this step is run, each mesh contains unique vertices, |
88 | * so a vertex may be used by multiple faces. You usually want |
89 | * to use this post processing step. If your application deals with |
90 | * indexed geometry, this step is compulsory or you'll just waste rendering |
91 | * time. <b>If this flag is not specified</b>, no vertices are referenced by |
92 | * more than one face and <b>no index buffer is required</b> for rendering. |
93 | */ |
94 | aiProcess_JoinIdenticalVertices = 0x2, |
95 | |
96 | // ------------------------------------------------------------------------- |
97 | /** <hr>Converts all the imported data to a left-handed coordinate space. |
98 | * |
99 | * By default the data is returned in a right-handed coordinate space (which |
100 | * OpenGL prefers). In this space, +X points to the right, |
101 | * +Z points towards the viewer, and +Y points upwards. In the DirectX |
102 | * coordinate space +X points to the right, +Y points upwards, and +Z points |
103 | * away from the viewer. |
104 | * |
105 | * You'll probably want to consider this flag if you use Direct3D for |
106 | * rendering. The #aiProcess_ConvertToLeftHanded flag supersedes this |
107 | * setting and bundles all conversions typically required for D3D-based |
108 | * applications. |
109 | */ |
110 | aiProcess_MakeLeftHanded = 0x4, |
111 | |
112 | // ------------------------------------------------------------------------- |
113 | /** <hr>Triangulates all faces of all meshes. |
114 | * |
115 | * By default the imported mesh data might contain faces with more than 3 |
116 | * indices. For rendering you'll usually want all faces to be triangles. |
117 | * This post processing step splits up faces with more than 3 indices into |
118 | * triangles. Line and point primitives are *not* modified! If you want |
119 | * 'triangles only' with no other kinds of primitives, try the following |
120 | * solution: |
121 | * <ul> |
122 | * <li>Specify both #aiProcess_Triangulate and #aiProcess_SortByPType </li> |
123 | * <li>Ignore all point and line meshes when you process assimp's output</li> |
124 | * </ul> |
125 | */ |
126 | aiProcess_Triangulate = 0x8, |
127 | |
128 | // ------------------------------------------------------------------------- |
129 | /** <hr>Removes some parts of the data structure (animations, materials, |
130 | * light sources, cameras, textures, vertex components). |
131 | * |
132 | * The components to be removed are specified in a separate |
133 | * importer property, <tt>#AI_CONFIG_PP_RVC_FLAGS</tt>. This is quite useful |
134 | * if you don't need all parts of the output structure. Vertex colors |
135 | * are rarely used today for example... Calling this step to remove unneeded |
136 | * data from the pipeline as early as possible results in increased |
137 | * performance and a more optimized output data structure. |
138 | * This step is also useful if you want to force Assimp to recompute |
139 | * normals or tangents. The corresponding steps don't recompute them if |
140 | * they're already there (loaded from the source asset). By using this |
141 | * step you can make sure they are NOT there. |
142 | * |
143 | * This flag is a poor one, mainly because its purpose is usually |
144 | * misunderstood. Consider the following case: a 3D model has been exported |
145 | * from a CAD app, and it has per-face vertex colors. Vertex positions can't be |
146 | * shared, thus the #aiProcess_JoinIdenticalVertices step fails to |
147 | * optimize the data because of these nasty little vertex colors. |
148 | * Most apps don't even process them, so it's all for nothing. By using |
149 | * this step, unneeded components are excluded as early as possible |
150 | * thus opening more room for internal optimizations. |
151 | */ |
152 | aiProcess_RemoveComponent = 0x10, |
153 | |
154 | // ------------------------------------------------------------------------- |
155 | /** <hr>Generates normals for all faces of all meshes. |
156 | * |
157 | * This is ignored if normals are already there at the time this flag |
158 | * is evaluated. Model importers try to load them from the source file, so |
159 | * they're usually already there. Face normals are shared between all points |
160 | * of a single face, so a single point can have multiple normals, which |
161 | * forces the library to duplicate vertices in some cases. |
162 | * #aiProcess_JoinIdenticalVertices is *senseless* then. |
163 | * |
164 | * This flag may not be specified together with #aiProcess_GenSmoothNormals. |
165 | */ |
166 | aiProcess_GenNormals = 0x20, |
167 | |
168 | // ------------------------------------------------------------------------- |
169 | /** <hr>Generates smooth normals for all vertices in the mesh. |
170 | * |
171 | * This is ignored if normals are already there at the time this flag |
172 | * is evaluated. Model importers try to load them from the source file, so |
173 | * they're usually already there. |
174 | * |
175 | * This flag may not be specified together with |
176 | * #aiProcess_GenNormals. There's a importer property, |
177 | * <tt>#AI_CONFIG_PP_GSN_MAX_SMOOTHING_ANGLE</tt> which allows you to specify |
178 | * an angle maximum for the normal smoothing algorithm. Normals exceeding |
179 | * this limit are not smoothed, resulting in a 'hard' seam between two faces. |
180 | * Using a decent angle here (e.g. 80 degrees) results in very good visual |
181 | * appearance. |
182 | */ |
183 | aiProcess_GenSmoothNormals = 0x40, |
184 | |
185 | // ------------------------------------------------------------------------- |
186 | /** <hr>Splits large meshes into smaller sub-meshes. |
187 | * |
188 | * This is quite useful for real-time rendering, where the number of triangles |
189 | * which can be maximally processed in a single draw-call is limited |
190 | * by the video driver/hardware. The maximum vertex buffer is usually limited |
191 | * too. Both requirements can be met with this step: you may specify both a |
192 | * triangle and vertex limit for a single mesh. |
193 | * |
194 | * The split limits can (and should!) be set through the |
195 | * <tt>#AI_CONFIG_PP_SLM_VERTEX_LIMIT</tt> and <tt>#AI_CONFIG_PP_SLM_TRIANGLE_LIMIT</tt> |
196 | * importer properties. The default values are <tt>#AI_SLM_DEFAULT_MAX_VERTICES</tt> and |
197 | * <tt>#AI_SLM_DEFAULT_MAX_TRIANGLES</tt>. |
198 | * |
199 | * Note that splitting is generally a time-consuming task, but only if there's |
200 | * something to split. The use of this step is recommended for most users. |
201 | */ |
202 | aiProcess_SplitLargeMeshes = 0x80, |
203 | |
204 | // ------------------------------------------------------------------------- |
205 | /** <hr>Removes the node graph and pre-transforms all vertices with |
206 | * the local transformation matrices of their nodes. |
207 | * |
208 | * The output scene still contains nodes, however there is only a |
209 | * root node with children, each one referencing only one mesh, |
210 | * and each mesh referencing one material. For rendering, you can |
211 | * simply render all meshes in order - you don't need to pay |
212 | * attention to local transformations and the node hierarchy. |
213 | * Animations are removed during this step. |
214 | * This step is intended for applications without a scenegraph. |
215 | * The step CAN cause some problems: if e.g. a mesh of the asset |
216 | * contains normals and another, using the same material index, does not, |
217 | * they will be brought together, but the first meshes's part of |
218 | * the normal list is zeroed. However, these artifacts are rare. |
219 | * @note The <tt>#AI_CONFIG_PP_PTV_NORMALIZE</tt> configuration property |
220 | * can be set to normalize the scene's spatial dimension to the -1...1 |
221 | * range. |
222 | */ |
223 | aiProcess_PreTransformVertices = 0x100, |
224 | |
225 | // ------------------------------------------------------------------------- |
226 | /** <hr>Limits the number of bones simultaneously affecting a single vertex |
227 | * to a maximum value. |
228 | * |
229 | * If any vertex is affected by more than the maximum number of bones, the least |
230 | * important vertex weights are removed and the remaining vertex weights are |
231 | * renormalized so that the weights still sum up to 1. |
232 | * The default bone weight limit is 4 (defined as <tt>#AI_LMW_MAX_WEIGHTS</tt> in |
233 | * config.h), but you can use the <tt>#AI_CONFIG_PP_LBW_MAX_WEIGHTS</tt> importer |
234 | * property to supply your own limit to the post processing step. |
235 | * |
236 | * If you intend to perform the skinning in hardware, this post processing |
237 | * step might be of interest to you. |
238 | */ |
239 | aiProcess_LimitBoneWeights = 0x200, |
240 | |
241 | // ------------------------------------------------------------------------- |
242 | /** <hr>Validates the imported scene data structure. |
243 | * This makes sure that all indices are valid, all animations and |
244 | * bones are linked correctly, all material references are correct .. etc. |
245 | * |
246 | * It is recommended that you capture Assimp's log output if you use this flag, |
247 | * so you can easily find out what's wrong if a file fails the |
248 | * validation. The validator is quite strict and will find *all* |
249 | * inconsistencies in the data structure... It is recommended that plugin |
250 | * developers use it to debug their loaders. There are two types of |
251 | * validation failures: |
252 | * <ul> |
253 | * <li>Error: There's something wrong with the imported data. Further |
254 | * postprocessing is not possible and the data is not usable at all. |
255 | * The import fails. #Importer::GetErrorString() or #aiGetErrorString() |
256 | * carry the error message around.</li> |
257 | * <li>Warning: There are some minor issues (e.g. 1000000 animation |
258 | * keyframes with the same time), but further postprocessing and use |
259 | * of the data structure is still safe. Warning details are written |
260 | * to the log file, <tt>#AI_SCENE_FLAGS_VALIDATION_WARNING</tt> is set |
261 | * in #aiScene::mFlags</li> |
262 | * </ul> |
263 | * |
264 | * This post-processing step is not time-consuming. Its use is not |
265 | * compulsory, but recommended. |
266 | */ |
267 | aiProcess_ValidateDataStructure = 0x400, |
268 | |
269 | // ------------------------------------------------------------------------- |
270 | /** <hr>Reorders triangles for better vertex cache locality. |
271 | * |
272 | * The step tries to improve the ACMR (average post-transform vertex cache |
273 | * miss ratio) for all meshes. The implementation runs in O(n) and is |
274 | * roughly based on the 'tipsify' algorithm (see <a href=" |
275 | * http://www.cs.princeton.edu/gfx/pubs/Sander_2007_%3ETR/tipsy.pdf">this |
276 | * paper</a>). |
277 | * |
278 | * If you intend to render huge models in hardware, this step might |
279 | * be of interest to you. The <tt>#AI_CONFIG_PP_ICL_PTCACHE_SIZE</tt> |
280 | * importer property can be used to fine-tune the cache optimization. |
281 | */ |
282 | aiProcess_ImproveCacheLocality = 0x800, |
283 | |
284 | // ------------------------------------------------------------------------- |
285 | /** <hr>Searches for redundant/unreferenced materials and removes them. |
286 | * |
287 | * This is especially useful in combination with the |
288 | * #aiProcess_PreTransformVertices and #aiProcess_OptimizeMeshes flags. |
289 | * Both join small meshes with equal characteristics, but they can't do |
290 | * their work if two meshes have different materials. Because several |
291 | * material settings are lost during Assimp's import filters, |
292 | * (and because many exporters don't check for redundant materials), huge |
293 | * models often have materials which are are defined several times with |
294 | * exactly the same settings. |
295 | * |
296 | * Several material settings not contributing to the final appearance of |
297 | * a surface are ignored in all comparisons (e.g. the material name). |
298 | * So, if you're passing additional information through the |
299 | * content pipeline (probably using *magic* material names), don't |
300 | * specify this flag. Alternatively take a look at the |
301 | * <tt>#AI_CONFIG_PP_RRM_EXCLUDE_LIST</tt> importer property. |
302 | */ |
303 | aiProcess_RemoveRedundantMaterials = 0x1000, |
304 | |
305 | // ------------------------------------------------------------------------- |
306 | /** <hr>This step tries to determine which meshes have normal vectors |
307 | * that are facing inwards and inverts them. |
308 | * |
309 | * The algorithm is simple but effective: |
310 | * the bounding box of all vertices + their normals is compared against |
311 | * the volume of the bounding box of all vertices without their normals. |
312 | * This works well for most objects, problems might occur with planar |
313 | * surfaces. However, the step tries to filter such cases. |
314 | * The step inverts all in-facing normals. Generally it is recommended |
315 | * to enable this step, although the result is not always correct. |
316 | */ |
317 | aiProcess_FixInfacingNormals = 0x2000, |
318 | |
319 | // ------------------------------------------------------------------------- |
320 | /** <hr>This step splits meshes with more than one primitive type in |
321 | * homogeneous sub-meshes. |
322 | * |
323 | * The step is executed after the triangulation step. After the step |
324 | * returns, just one bit is set in aiMesh::mPrimitiveTypes. This is |
325 | * especially useful for real-time rendering where point and line |
326 | * primitives are often ignored or rendered separately. |
327 | * You can use the <tt>#AI_CONFIG_PP_SBP_REMOVE</tt> importer property to |
328 | * specify which primitive types you need. This can be used to easily |
329 | * exclude lines and points, which are rarely used, from the import. |
330 | */ |
331 | aiProcess_SortByPType = 0x8000, |
332 | |
333 | // ------------------------------------------------------------------------- |
334 | /** <hr>This step searches all meshes for degenerate primitives and |
335 | * converts them to proper lines or points. |
336 | * |
337 | * A face is 'degenerate' if one or more of its points are identical. |
338 | * To have the degenerate stuff not only detected and collapsed but |
339 | * removed, try one of the following procedures: |
340 | * <br><b>1.</b> (if you support lines and points for rendering but don't |
341 | * want the degenerates)<br> |
342 | * <ul> |
343 | * <li>Specify the #aiProcess_FindDegenerates flag. |
344 | * </li> |
345 | * <li>Set the <tt>#AI_CONFIG_PP_FD_REMOVE</tt> importer property to |
346 | * 1. This will cause the step to remove degenerate triangles from the |
347 | * import as soon as they're detected. They won't pass any further |
348 | * pipeline steps. |
349 | * </li> |
350 | * </ul> |
351 | * <br><b>2.</b>(if you don't support lines and points at all)<br> |
352 | * <ul> |
353 | * <li>Specify the #aiProcess_FindDegenerates flag. |
354 | * </li> |
355 | * <li>Specify the #aiProcess_SortByPType flag. This moves line and |
356 | * point primitives to separate meshes. |
357 | * </li> |
358 | * <li>Set the <tt>#AI_CONFIG_PP_SBP_REMOVE</tt> importer property to |
359 | * @code aiPrimitiveType_POINTS | aiPrimitiveType_LINES |
360 | * @endcode to cause SortByPType to reject point |
361 | * and line meshes from the scene. |
362 | * </li> |
363 | * </ul> |
364 | * |
365 | * This step also removes very small triangles with a surface area smaller |
366 | * than 10^-6. If you rely on having these small triangles, or notice holes |
367 | * in your model, set the property <tt>#AI_CONFIG_PP_FD_CHECKAREA</tt> to |
368 | * false. |
369 | * @note Degenerate polygons are not necessarily evil and that's why |
370 | * they're not removed by default. There are several file formats which |
371 | * don't support lines or points, and some exporters bypass the |
372 | * format specification and write them as degenerate triangles instead. |
373 | */ |
374 | aiProcess_FindDegenerates = 0x10000, |
375 | |
376 | // ------------------------------------------------------------------------- |
377 | /** <hr>This step searches all meshes for invalid data, such as zeroed |
378 | * normal vectors or invalid UV coords and removes/fixes them. This is |
379 | * intended to get rid of some common exporter errors. |
380 | * |
381 | * This is especially useful for normals. If they are invalid, and |
382 | * the step recognizes this, they will be removed and can later |
383 | * be recomputed, i.e. by the #aiProcess_GenSmoothNormals flag.<br> |
384 | * The step will also remove meshes that are infinitely small and reduce |
385 | * animation tracks consisting of hundreds if redundant keys to a single |
386 | * key. The <tt>AI_CONFIG_PP_FID_ANIM_ACCURACY</tt> config property decides |
387 | * the accuracy of the check for duplicate animation tracks. |
388 | */ |
389 | aiProcess_FindInvalidData = 0x20000, |
390 | |
391 | // ------------------------------------------------------------------------- |
392 | /** <hr>This step converts non-UV mappings (such as spherical or |
393 | * cylindrical mapping) to proper texture coordinate channels. |
394 | * |
395 | * Most applications will support UV mapping only, so you will |
396 | * probably want to specify this step in every case. Note that Assimp is not |
397 | * always able to match the original mapping implementation of the |
398 | * 3D app which produced a model perfectly. It's always better to let the |
399 | * modelling app compute the UV channels - 3ds max, Maya, Blender, |
400 | * LightWave, and Modo do this for example. |
401 | * |
402 | * @note If this step is not requested, you'll need to process the |
403 | * <tt>#AI_MATKEY_MAPPING</tt> material property in order to display all assets |
404 | * properly. |
405 | */ |
406 | aiProcess_GenUVCoords = 0x40000, |
407 | |
408 | // ------------------------------------------------------------------------- |
409 | /** <hr>This step applies per-texture UV transformations and bakes |
410 | * them into stand-alone vtexture coordinate channels. |
411 | * |
412 | * UV transformations are specified per-texture - see the |
413 | * <tt>#AI_MATKEY_UVTRANSFORM</tt> material key for more information. |
414 | * This step processes all textures with |
415 | * transformed input UV coordinates and generates a new (pre-transformed) UV channel |
416 | * which replaces the old channel. Most applications won't support UV |
417 | * transformations, so you will probably want to specify this step. |
418 | * |
419 | * @note UV transformations are usually implemented in real-time apps by |
420 | * transforming texture coordinates at vertex shader stage with a 3x3 |
421 | * (homogenous) transformation matrix. |
422 | */ |
423 | aiProcess_TransformUVCoords = 0x80000, |
424 | |
425 | // ------------------------------------------------------------------------- |
426 | /** <hr>This step searches for duplicate meshes and replaces them |
427 | * with references to the first mesh. |
428 | * |
429 | * This step takes a while, so don't use it if speed is a concern. |
430 | * Its main purpose is to workaround the fact that many export |
431 | * file formats don't support instanced meshes, so exporters need to |
432 | * duplicate meshes. This step removes the duplicates again. Please |
433 | * note that Assimp does not currently support per-node material |
434 | * assignment to meshes, which means that identical meshes with |
435 | * different materials are currently *not* joined, although this is |
436 | * planned for future versions. |
437 | */ |
438 | aiProcess_FindInstances = 0x100000, |
439 | |
440 | // ------------------------------------------------------------------------- |
441 | /** <hr>A post-processing step to reduce the number of meshes. |
442 | * |
443 | * This will, in fact, reduce the number of draw calls. |
444 | * |
445 | * This is a very effective optimization and is recommended to be used |
446 | * together with #aiProcess_OptimizeGraph, if possible. The flag is fully |
447 | * compatible with both #aiProcess_SplitLargeMeshes and #aiProcess_SortByPType. |
448 | */ |
449 | aiProcess_OptimizeMeshes = 0x200000, |
450 | |
451 | |
452 | // ------------------------------------------------------------------------- |
453 | /** <hr>A post-processing step to optimize the scene hierarchy. |
454 | * |
455 | * Nodes without animations, bones, lights or cameras assigned are |
456 | * collapsed and joined. |
457 | * |
458 | * Node names can be lost during this step. If you use special 'tag nodes' |
459 | * to pass additional information through your content pipeline, use the |
460 | * <tt>#AI_CONFIG_PP_OG_EXCLUDE_LIST</tt> importer property to specify a |
461 | * list of node names you want to be kept. Nodes matching one of the names |
462 | * in this list won't be touched or modified. |
463 | * |
464 | * Use this flag with caution. Most simple files will be collapsed to a |
465 | * single node, so complex hierarchies are usually completely lost. This is not |
466 | * useful for editor environments, but probably a very effective |
467 | * optimization if you just want to get the model data, convert it to your |
468 | * own format, and render it as fast as possible. |
469 | * |
470 | * This flag is designed to be used with #aiProcess_OptimizeMeshes for best |
471 | * results. |
472 | * |
473 | * @note 'Crappy' scenes with thousands of extremely small meshes packed |
474 | * in deeply nested nodes exist for almost all file formats. |
475 | * #aiProcess_OptimizeMeshes in combination with #aiProcess_OptimizeGraph |
476 | * usually fixes them all and makes them renderable. |
477 | */ |
478 | aiProcess_OptimizeGraph = 0x400000, |
479 | |
480 | // ------------------------------------------------------------------------- |
481 | /** <hr>This step flips all UV coordinates along the y-axis and adjusts |
482 | * material settings and bitangents accordingly. |
483 | * |
484 | * <b>Output UV coordinate system:</b> |
485 | * @code |
486 | * 0y|0y ---------- 1x|0y |
487 | * | | |
488 | * | | |
489 | * | | |
490 | * 0x|1y ---------- 1x|1y |
491 | * @endcode |
492 | * |
493 | * You'll probably want to consider this flag if you use Direct3D for |
494 | * rendering. The #aiProcess_ConvertToLeftHanded flag supersedes this |
495 | * setting and bundles all conversions typically required for D3D-based |
496 | * applications. |
497 | */ |
498 | aiProcess_FlipUVs = 0x800000, |
499 | |
500 | // ------------------------------------------------------------------------- |
501 | /** <hr>This step adjusts the output face winding order to be CW. |
502 | * |
503 | * The default face winding order is counter clockwise (CCW). |
504 | * |
505 | * <b>Output face order:</b> |
506 | * @code |
507 | * x2 |
508 | * |
509 | * x0 |
510 | * x1 |
511 | * @endcode |
512 | */ |
513 | aiProcess_FlipWindingOrder = 0x1000000, |
514 | |
515 | // ------------------------------------------------------------------------- |
516 | /** <hr>This step splits meshes with many bones into sub-meshes so that each |
517 | * sub-mesh has fewer or as many bones as a given limit. |
518 | */ |
519 | aiProcess_SplitByBoneCount = 0x2000000, |
520 | |
521 | // ------------------------------------------------------------------------- |
522 | /** <hr>This step removes bones losslessly or according to some threshold. |
523 | * |
524 | * In some cases (i.e. formats that require it) exporters are forced to |
525 | * assign dummy bone weights to otherwise static meshes assigned to |
526 | * animated meshes. Full, weight-based skinning is expensive while |
527 | * animating nodes is extremely cheap, so this step is offered to clean up |
528 | * the data in that regard. |
529 | * |
530 | * Use <tt>#AI_CONFIG_PP_DB_THRESHOLD</tt> to control this. |
531 | * Use <tt>#AI_CONFIG_PP_DB_ALL_OR_NONE</tt> if you want bones removed if and |
532 | * only if all bones within the scene qualify for removal. |
533 | */ |
534 | aiProcess_Debone = 0x4000000, |
535 | |
536 | // ------------------------------------------------------------------------- |
537 | /** <hr>This step will perform a global scale of the model. |
538 | * |
539 | * Some importers are providing a mechanism to define a scaling unit for the |
540 | * model. This post processing step can be used to do so. You need to get the |
541 | * global scaling from your importer settings like in FBX. Use the flag |
542 | * AI_CONFIG_GLOBAL_SCALE_FACTOR_KEY from the global property table to configure this. |
543 | * |
544 | * Use <tt>#AI_CONFIG_GLOBAL_SCALE_FACTOR_KEY</tt> to setup the global scaling factor. |
545 | */ |
546 | aiProcess_GlobalScale = 0x8000000, |
547 | |
548 | // ------------------------------------------------------------------------- |
549 | /** <hr>A postprocessing step to embed of textures. |
550 | * |
551 | * This will remove external data dependencies for textures. |
552 | * If a texture's file does not exist at the specified path |
553 | * (due, for instance, to an absolute path generated on another system), |
554 | * it will check if a file with the same name exists at the root folder |
555 | * of the imported model. And if so, it uses that. |
556 | */ |
557 | aiProcess_EmbedTextures = 0x10000000, |
558 | |
559 | // aiProcess_GenEntityMeshes = 0x100000, |
560 | // aiProcess_OptimizeAnimations = 0x200000 |
561 | // aiProcess_FixTexturePaths = 0x200000 |
562 | |
563 | |
564 | aiProcess_ForceGenNormals = 0x20000000, |
565 | |
566 | // ------------------------------------------------------------------------- |
567 | /** <hr>Drops normals for all faces of all meshes. |
568 | * |
569 | * This is ignored if no normals are present. |
570 | * Face normals are shared between all points of a single face, |
571 | * so a single point can have multiple normals, which |
572 | * forces the library to duplicate vertices in some cases. |
573 | * #aiProcess_JoinIdenticalVertices is *senseless* then. |
574 | * This process gives sense back to aiProcess_JoinIdenticalVertices |
575 | */ |
576 | aiProcess_DropNormals = 0x40000000, |
577 | |
578 | // ------------------------------------------------------------------------- |
579 | /** |
580 | */ |
581 | aiProcess_GenBoundingBoxes = 0x80000000 |
582 | }; |
583 | |
584 | |
585 | // --------------------------------------------------------------------------------------- |
586 | /** @def aiProcess_ConvertToLeftHanded |
587 | * @brief Shortcut flag for Direct3D-based applications. |
588 | * |
589 | * Supersedes the #aiProcess_MakeLeftHanded and #aiProcess_FlipUVs and |
590 | * #aiProcess_FlipWindingOrder flags. |
591 | * The output data matches Direct3D's conventions: left-handed geometry, upper-left |
592 | * origin for UV coordinates and finally clockwise face order, suitable for CCW culling. |
593 | * |
594 | * @deprecated |
595 | */ |
596 | #define aiProcess_ConvertToLeftHanded ( \ |
597 | aiProcess_MakeLeftHanded | \ |
598 | aiProcess_FlipUVs | \ |
599 | aiProcess_FlipWindingOrder | \ |
600 | 0 ) |
601 | |
602 | |
603 | // --------------------------------------------------------------------------------------- |
604 | /** @def aiProcessPreset_TargetRealtime_Fast |
605 | * @brief Default postprocess configuration optimizing the data for real-time rendering. |
606 | * |
607 | * Applications would want to use this preset to load models on end-user PCs, |
608 | * maybe for direct use in game. |
609 | * |
610 | * If you're using DirectX, don't forget to combine this value with |
611 | * the #aiProcess_ConvertToLeftHanded step. If you don't support UV transformations |
612 | * in your application apply the #aiProcess_TransformUVCoords step, too. |
613 | * @note Please take the time to read the docs for the steps enabled by this preset. |
614 | * Some of them offer further configurable properties, while some of them might not be of |
615 | * use for you so it might be better to not specify them. |
616 | */ |
617 | #define aiProcessPreset_TargetRealtime_Fast ( \ |
618 | aiProcess_CalcTangentSpace | \ |
619 | aiProcess_GenNormals | \ |
620 | aiProcess_JoinIdenticalVertices | \ |
621 | aiProcess_Triangulate | \ |
622 | aiProcess_GenUVCoords | \ |
623 | aiProcess_SortByPType | \ |
624 | 0 ) |
625 | |
626 | // --------------------------------------------------------------------------------------- |
627 | /** @def aiProcessPreset_TargetRealtime_Quality |
628 | * @brief Default postprocess configuration optimizing the data for real-time rendering. |
629 | * |
630 | * Unlike #aiProcessPreset_TargetRealtime_Fast, this configuration |
631 | * performs some extra optimizations to improve rendering speed and |
632 | * to minimize memory usage. It could be a good choice for a level editor |
633 | * environment where import speed is not so important. |
634 | * |
635 | * If you're using DirectX, don't forget to combine this value with |
636 | * the #aiProcess_ConvertToLeftHanded step. If you don't support UV transformations |
637 | * in your application apply the #aiProcess_TransformUVCoords step, too. |
638 | * @note Please take the time to read the docs for the steps enabled by this preset. |
639 | * Some of them offer further configurable properties, while some of them might not be |
640 | * of use for you so it might be better to not specify them. |
641 | */ |
642 | #define aiProcessPreset_TargetRealtime_Quality ( \ |
643 | aiProcess_CalcTangentSpace | \ |
644 | aiProcess_GenSmoothNormals | \ |
645 | aiProcess_JoinIdenticalVertices | \ |
646 | aiProcess_ImproveCacheLocality | \ |
647 | aiProcess_LimitBoneWeights | \ |
648 | aiProcess_RemoveRedundantMaterials | \ |
649 | aiProcess_SplitLargeMeshes | \ |
650 | aiProcess_Triangulate | \ |
651 | aiProcess_GenUVCoords | \ |
652 | aiProcess_SortByPType | \ |
653 | aiProcess_FindDegenerates | \ |
654 | aiProcess_FindInvalidData | \ |
655 | 0 ) |
656 | |
657 | // --------------------------------------------------------------------------------------- |
658 | /** @def aiProcessPreset_TargetRealtime_MaxQuality |
659 | * @brief Default postprocess configuration optimizing the data for real-time rendering. |
660 | * |
661 | * This preset enables almost every optimization step to achieve perfectly |
662 | * optimized data. It's your choice for level editor environments where import speed |
663 | * is not important. |
664 | * |
665 | * If you're using DirectX, don't forget to combine this value with |
666 | * the #aiProcess_ConvertToLeftHanded step. If you don't support UV transformations |
667 | * in your application, apply the #aiProcess_TransformUVCoords step, too. |
668 | * @note Please take the time to read the docs for the steps enabled by this preset. |
669 | * Some of them offer further configurable properties, while some of them might not be |
670 | * of use for you so it might be better to not specify them. |
671 | */ |
672 | #define aiProcessPreset_TargetRealtime_MaxQuality ( \ |
673 | aiProcessPreset_TargetRealtime_Quality | \ |
674 | aiProcess_FindInstances | \ |
675 | aiProcess_ValidateDataStructure | \ |
676 | aiProcess_OptimizeMeshes | \ |
677 | 0 ) |
678 | |
679 | |
680 | #ifdef __cplusplus |
681 | } // end of extern "C" |
682 | #endif |
683 | |
684 | #endif // AI_POSTPROCESS_H_INC |
685 | |