aiPostProcess.h 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625
  1. /*
  2. Open Asset Import Library (ASSIMP)
  3. ----------------------------------------------------------------------
  4. Copyright (c) 2006-2010, ASSIMP Development Team
  5. All rights reserved.
  6. Redistribution and use of this software in source and binary forms,
  7. with or without modification, are permitted provided that the
  8. following conditions are met:
  9. * Redistributions of source code must retain the above
  10. copyright notice, this list of conditions and the
  11. following disclaimer.
  12. * Redistributions in binary form must reproduce the above
  13. copyright notice, this list of conditions and the
  14. following disclaimer in the documentation and/or other
  15. materials provided with the distribution.
  16. * Neither the name of the ASSIMP team, nor the names of its
  17. contributors may be used to endorse or promote products
  18. derived from this software without specific prior
  19. written permission of the ASSIMP Development Team.
  20. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  21. "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  22. LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  23. A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  24. OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  25. SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  26. LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  27. DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  28. THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  29. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  30. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  31. ----------------------------------------------------------------------
  32. */
  33. /** @file aiPostProcess.h
  34. * @brief Definitions for import post processing steps
  35. */
  36. #ifndef AI_POSTPROCESS_H_INC
  37. #define AI_POSTPROCESS_H_INC
  38. #include "aiTypes.h"
  39. #ifdef __cplusplus
  40. extern "C" {
  41. #endif
  42. // -----------------------------------------------------------------------------------
  43. /** @enum aiPostProcessSteps
  44. * @brief Defines the flags for all possible post processing steps.
  45. *
  46. * @see Importer::ReadFile
  47. * @see aiImportFile
  48. * @see aiImportFileEx
  49. */
  50. // -----------------------------------------------------------------------------------
  51. enum aiPostProcessSteps
  52. {
  53. // -------------------------------------------------------------------------
  54. /** <hr>Calculates the tangents and bitangents for the imported meshes.
  55. *
  56. * Does nothing if a mesh does not have normals. You might want this post
  57. * processing step to be executed if you plan to use tangent space calculations
  58. * such as normal mapping applied to the meshes. There's a config setting,
  59. * <tt>#AI_CONFIG_PP_CT_MAX_SMOOTHING_ANGLE</tt>, which allows you to specify
  60. * a maximum smoothing angle for the algorithm. However, usually you'll
  61. * want to leave it at the default value. Thanks.
  62. */
  63. aiProcess_CalcTangentSpace = 0x1,
  64. // -------------------------------------------------------------------------
  65. /** <hr>Identifies and joins identical vertex data sets within all
  66. * imported meshes.
  67. *
  68. * After this step is run each mesh does contain only unique vertices anymore,
  69. * so a vertex is possibly used by multiple faces. You usually want
  70. * to use this post processing step. If your application deals with
  71. * indexed geometry, this step is compulsory or you'll just waste rendering
  72. * time. <b>If this flag is not specified</b>, no vertices are referenced by
  73. * more than one face and <b>no index buffer is required</b> for rendering.
  74. */
  75. aiProcess_JoinIdenticalVertices = 0x2,
  76. // -------------------------------------------------------------------------
  77. /** <hr>Converts all the imported data to a left-handed coordinate space.
  78. *
  79. * By default the data is returned in a right-handed coordinate space which
  80. * for example OpenGL prefers. In this space, +X points to the right,
  81. * +Z points towards the viewer and and +Y points upwards. In the DirectX
  82. * coordinate space +X points to the right, +Y points upwards and +Z points
  83. * away from the viewer.
  84. *
  85. * You'll probably want to consider this flag if you use Direct3D for
  86. * rendering. The #aiProcess_ConvertToLeftHanded flag supersedes this
  87. * setting and bundles all conversions typically required for D3D-based
  88. * applications.
  89. */
  90. aiProcess_MakeLeftHanded = 0x4,
  91. // -------------------------------------------------------------------------
  92. /** <hr>Triangulates all faces of all meshes.
  93. *
  94. * By default the imported mesh data might contain faces with more than 3
  95. * indices. For rendering you'll usually want all faces to be triangles.
  96. * This post processing step splits up all higher faces to triangles.
  97. * Line and point primitives are *not* modified!. If you want
  98. * 'triangles only' with no other kinds of primitives, try the following
  99. * solution:
  100. * <ul>
  101. * <li>Specify both #aiProcess_Triangulate and #aiProcess_SortByPType </li>
  102. * </li>Ignore all point and line meshes when you process assimp's output</li>
  103. * </ul>
  104. */
  105. aiProcess_Triangulate = 0x8,
  106. // -------------------------------------------------------------------------
  107. /** <hr>Removes some parts of the data structure (animations, materials,
  108. * light sources, cameras, textures, vertex components).
  109. *
  110. * The components to be removed are specified in a separate
  111. * configuration option, <tt>#AI_CONFIG_PP_RVC_FLAGS</tt>. This is quite useful
  112. * if you don't need all parts of the output structure. Especially vertex
  113. * colors are rarely used today ... . Calling this step to remove unrequired
  114. * stuff from the pipeline as early as possible results in an increased
  115. * performance and a better optimized output data structure.
  116. * This step is also useful if you want to force Assimp to recompute
  117. * normals or tangents. The corresponding steps don't recompute them if
  118. * they're already there (loaded from the source asset). By using this
  119. * step you can make sure they are NOT there.
  120. *
  121. * This flag is a poor one, mainly because its purpose is usually
  122. * misunderstood. Consider the following case: a 3d model has been exported
  123. * from a CAD app, it has per-face vertex colors. Vertex positions can't be
  124. * shared, thus the #aiProcess_JoinIdenticalVertices step fails to
  125. * optimize the data. Just because these nasty, little vertex colors.
  126. * Most apps don't even process them, so it's all for nothing. By using
  127. * this step, unneeded components are excluded as early as possible
  128. * thus opening more room for internal optimzations.
  129. */
  130. aiProcess_RemoveComponent = 0x10,
  131. // -------------------------------------------------------------------------
  132. /** <hr>Generates normals for all faces of all meshes.
  133. *
  134. * This is ignored if normals are already there at the time where this flag
  135. * is evaluated. Model importers try to load them from the source file, so
  136. * they're usually already there. Face normals are shared between all points
  137. * of a single face, so a single point can have multiple normals, which in
  138. * other words, enforces the library to duplicate vertices in some cases.
  139. * #aiProcess_JoinIdenticalVertices is *senseless* then.
  140. *
  141. * This flag may not be specified together with #aiProcess_GenSmoothNormals.
  142. */
  143. aiProcess_GenNormals = 0x20,
  144. // -------------------------------------------------------------------------
  145. /** <hr>Generates smooth normals for all vertices in the mesh.
  146. *
  147. * This is ignored if normals are already there at the time where this flag
  148. * is evaluated. Model importers try to load them from the source file, so
  149. * they're usually already there.
  150. *
  151. * This flag may (of course) not be specified together with
  152. * #aiProcess_GenNormals. There's a configuration option,
  153. * <tt>#AI_CONFIG_PP_GSN_MAX_SMOOTHING_ANGLE</tt> which allows you to specify
  154. * an angle maximum for the normal smoothing algorithm. Normals exceeding
  155. * this limit are not smoothed, resulting in a a 'hard' seam between two faces.
  156. * Using a decent angle here (e.g. 80°) results in very good visual
  157. * appearance.
  158. */
  159. aiProcess_GenSmoothNormals = 0x40,
  160. // -------------------------------------------------------------------------
  161. /** <hr>Splits large meshes into smaller submeshes
  162. *
  163. * This is quite useful for realtime rendering where the number of triangles
  164. * which can be maximally processed in a single draw-call is usually limited
  165. * by the video driver/hardware. The maximum vertex buffer is usually limited,
  166. * too. Both requirements can be met with this step: you may specify both a
  167. * triangle and vertex limit for a single mesh.
  168. *
  169. * The split limits can (and should!) be set through the
  170. * <tt>#AI_CONFIG_PP_SLM_VERTEX_LIMIT</tt> and <tt>#AI_CONFIG_PP_SLM_TRIANGLE_LIMIT</tt>
  171. * settings. The default values are <tt>#AI_SLM_DEFAULT_MAX_VERTICES</tt> and
  172. * <tt>#AI_SLM_DEFAULT_MAX_TRIANGLES</tt>.
  173. *
  174. * Note that splitting is generally a time-consuming task, but not if there's
  175. * nothing to split. The use of this step is recommended for most users.
  176. */
  177. aiProcess_SplitLargeMeshes = 0x80,
  178. // -------------------------------------------------------------------------
  179. /** <hr>Removes the node graph and pre-transforms all vertices with
  180. * the local transformation matrices of their nodes. The output
  181. * scene does still contain nodes, however, there is only a
  182. * root node with children, each one referencing only one mesh,
  183. * each mesh referencing one material. For rendering, you can
  184. * simply render all meshes in order, you don't need to pay
  185. * attention to local transformations and the node hierarchy.
  186. * Animations are removed during this step.
  187. * This step is intended for applications without a scenegraph.
  188. * The step CAN cause some problems: if e.g. a mesh of the asset
  189. * contains normals and another, using the same material index, does not,
  190. * they will be brought together, but the first meshes's part of
  191. * the normal list is zeroed. However, these artifacts are rare.
  192. * @note The <tt>#AI_CONFIG_PP_PTV_NORMALIZE</tt> configuration property
  193. * can be set to normalize the scene's spatial dimension to the -1...1
  194. * range.
  195. */
  196. aiProcess_PreTransformVertices = 0x100,
  197. // -------------------------------------------------------------------------
  198. /** <hr>Limits the number of bones simultaneously affecting a single vertex
  199. * to a maximum value.
  200. *
  201. * If any vertex is affected by more than that number of bones, the least
  202. * important vertex weights are removed and the remaining vertex weights are
  203. * renormalized so that the weights still sum up to 1.
  204. * The default bone weight limit is 4 (defined as <tt>#AI_LMW_MAX_WEIGHTS</tt> in
  205. * aiConfig.h), but you can use the <tt>#AI_CONFIG_PP_LBW_MAX_WEIGHTS</tt> setting to
  206. * supply your own limit to the post processing step.
  207. *
  208. * If you intend to perform the skinning in hardware, this post processing
  209. * step might be of interest for you.
  210. */
  211. aiProcess_LimitBoneWeights = 0x200,
  212. // -------------------------------------------------------------------------
  213. /** <hr>Validates the imported scene data structure
  214. * This makes sure that all indices are valid, all animations and
  215. * bones are linked correctly, all material references are correct .. etc.
  216. *
  217. * It is recommended to capture Assimp's log output if you use this flag,
  218. * so you can easily find ot what's actually wrong if a file fails the
  219. * validation. The validator is quite rude and will find *all*
  220. * inconsistencies in the data structure ... plugin developers are
  221. * recommended to use it to debug their loaders. There are two types of
  222. * validation failures:
  223. * <ul>
  224. * <li>Error: There's something wrong with the imported data. Further
  225. * postprocessing is not possible and the data is not usable at all.
  226. * The import fails. #Importer::GetErrorString() or #aiGetErrorString()
  227. * carry the error message around.</li>
  228. * <li>Warning: There are some minor issues (e.g. 1000000 animation
  229. * keyframes with the same time), but further postprocessing and use
  230. * of the data structure is still safe. Warning details are written
  231. * to the log file, <tt>#AI_SCENE_FLAGS_VALIDATION_WARNING</tt> is set
  232. * in #aiScene::mFlags</li>
  233. * </ul>
  234. *
  235. * This post-processing step is not time-consuming. It's use is not
  236. * compulsory, but recommended.
  237. */
  238. aiProcess_ValidateDataStructure = 0x400,
  239. // -------------------------------------------------------------------------
  240. /** <hr>Reorders triangles for better vertex cache locality.
  241. *
  242. * The step tries to improve the ACMR (average post-transform vertex cache
  243. * miss ratio) for all meshes. The implementation runs in O(n) and is
  244. * roughly based on the 'tipsify' algorithm (see <a href="
  245. * http://www.cs.princeton.edu/gfx/pubs/Sander_2007_%3ETR/tipsy.pdf">this
  246. * paper</a>).
  247. *
  248. * If you intend to render huge models in hardware, this step might
  249. * be of interest for you. The <tt>#AI_CONFIG_PP_ICL_PTCACHE_SIZE</tt>config
  250. * setting can be used to fine-tune the cache optimization.
  251. */
  252. aiProcess_ImproveCacheLocality = 0x800,
  253. // -------------------------------------------------------------------------
  254. /** <hr>Searches for redundant/unreferenced materials and removes them.
  255. *
  256. * This is especially useful in combination with the
  257. * #aiProcess_PretransformVertices and #aiProcess_OptimizeMeshes flags.
  258. * Both join small meshes with equal characteristics, but they can't do
  259. * their work if two meshes have different materials. Because several
  260. * material settings are always lost during Assimp's import filters,
  261. * (and because many exporters don't check for redundant materials), huge
  262. * models often have materials which are are defined several times with
  263. * exactly the same settings ..
  264. *
  265. * Several material settings not contributing to the final appearance of
  266. * a surface are ignored in all comparisons ... the material name is
  267. * one of them. So, if you're passing additional information through the
  268. * content pipeline (probably using *magic* material names), don't
  269. * specify this flag. Alternatively take a look at the
  270. * <tt>#AI_CONFIG_PP_RRM_EXCLUDE_LIST</tt> setting.
  271. */
  272. aiProcess_RemoveRedundantMaterials = 0x1000,
  273. // -------------------------------------------------------------------------
  274. /** <hr>This step tries to determine which meshes have normal vectors
  275. * that are facing inwards. The algorithm is simple but effective:
  276. * the bounding box of all vertices + their normals is compared against
  277. * the volume of the bounding box of all vertices without their normals.
  278. * This works well for most objects, problems might occur with planar
  279. * surfaces. However, the step tries to filter such cases.
  280. * The step inverts all in-facing normals. Generally it is recommended
  281. * to enable this step, although the result is not always correct.
  282. */
  283. aiProcess_FixInfacingNormals = 0x2000,
  284. // -------------------------------------------------------------------------
  285. /** <hr>This step splits meshes with more than one primitive type in
  286. * homogeneous submeshes.
  287. *
  288. * The step is executed after the triangulation step. After the step
  289. * returns, just one bit is set in aiMesh::mPrimitiveTypes. This is
  290. * especially useful for real-time rendering where point and line
  291. * primitives are often ignored or rendered separately.
  292. * You can use the <tt>#AI_CONFIG_PP_SBP_REMOVE</tt> option to specify which
  293. * primitive types you need. This can be used to easily exclude
  294. * lines and points, which are rarely used, from the import.
  295. */
  296. aiProcess_SortByPType = 0x8000,
  297. // -------------------------------------------------------------------------
  298. /** <hr>This step searches all meshes for degenerated primitives and
  299. * converts them to proper lines or points.
  300. *
  301. * A face is 'degenerated' if one or more of its points are identical.
  302. * To have the degenerated stuff not only detected and collapsed but
  303. * also removed, try one of the following procedures:
  304. * <br><b>1.</b> (if you support lines&points for rendering but don't
  305. * want the degenerates)</br>
  306. * <ul>
  307. * <li>Specify the #aiProcess_FindDegenerates flag.
  308. * </li>
  309. * <li>Set the <tt>AI_CONFIG_PP_FD_REMOVE</tt> option to 1. This will
  310. * cause the step to remove degenerated triangles from the import
  311. * as soon as they're detected. They won't pass any further
  312. * pipeline steps.
  313. * </li>
  314. * </ul>
  315. * <br><b>2.</b>(if you don't support lines&points at all ...)</br>
  316. * <ul>
  317. * <li>Specify the #aiProcess_FindDegenerates flag.
  318. * </li>
  319. * <li>Specify the #aiProcess_SortByPType flag. This moves line and
  320. * point primitives to separate meshes.
  321. * </li>
  322. * <li>Set the <tt>AI_CONFIG_PP_SBP_REMOVE</tt> option to
  323. * @code aiPrimitiveType_POINTS | aiPrimitiveType_LINES
  324. * @endcode to cause SortByPType to reject point
  325. * and line meshes from the scene.
  326. * </li>
  327. * </ul>
  328. * @note Degenerated polygons are not necessarily evil and that's why
  329. * they're not removed by default. There are several file formats which
  330. * don't support lines or points ... some exporters bypass the
  331. * format specification and write them as degenerated triangle instead.
  332. */
  333. aiProcess_FindDegenerates = 0x10000,
  334. // -------------------------------------------------------------------------
  335. /** <hr>This step searches all meshes for invalid data, such as zeroed
  336. * normal vectors or invalid UV coords and removes/fixes them. This is
  337. * intended to get rid of some common exporter errors.
  338. *
  339. * This is especially useful for normals. If they are invalid, and
  340. * the step recognizes this, they will be removed and can later
  341. * be recomputed, i.e. by the #aiProcess_GenSmoothNormals flag.<br>
  342. * The step will also remove meshes that are infinitely small and reduce
  343. * animation tracks consisting of hundreds if redundant keys to a single
  344. * key. The <tt>AI_CONFIG_PP_FID_ANIM_ACCURACY</tt> config property decides
  345. * the accuracy of the check for duplicate animation tracks.
  346. */
  347. aiProcess_FindInvalidData = 0x20000,
  348. // -------------------------------------------------------------------------
  349. /** <hr>This step converts non-UV mappings (such as spherical or
  350. * cylindrical mapping) to proper texture coordinate channels.
  351. *
  352. * Most applications will support UV mapping only, so you will
  353. * probably want to specify this step in every case. Note tha Assimp is not
  354. * always able to match the original mapping implementation of the
  355. * 3d app which produced a model perfectly. It's always better to let the
  356. * father app compute the UV channels, at least 3ds max, maja, blender,
  357. * lightwave, modo, ... are able to achieve this.
  358. *
  359. * @note If this step is not requested, you'll need to process the
  360. * <tt>#AI_MATKEY_MAPPING</tt> material property in order to display all assets
  361. * properly.
  362. */
  363. aiProcess_GenUVCoords = 0x40000,
  364. // -------------------------------------------------------------------------
  365. /** <hr>This step applies per-texture UV transformations and bakes
  366. * them to stand-alone vtexture coordinate channelss.
  367. *
  368. * UV transformations are specified per-texture - see the
  369. * <tt>#AI_MATKEY_UVTRANSFORM</tt> material key for more information.
  370. * This step processes all textures with
  371. * transformed input UV coordinates and generates new (pretransformed) UV channel
  372. * which replace the old channel. Most applications won't support UV
  373. * transformations, so you will probably want to specify this step.
  374. *
  375. * @note UV transformations are usually implemented in realtime apps by
  376. * transforming texture coordinates at vertex shader stage with a 3x3
  377. * (homogenous) transformation matrix.
  378. */
  379. aiProcess_TransformUVCoords = 0x80000,
  380. // -------------------------------------------------------------------------
  381. /** <hr>This step searches for duplicate meshes and replaces duplicates
  382. * with references to the first mesh.
  383. *
  384. * This step takes a while, don't use it if you have no time.
  385. * Its main purpose is to workaround the limitation that many export
  386. * file formats don't support instanced meshes, so exporters need to
  387. * duplicate meshes. This step removes the duplicates again. Please
  388. * note that Assimp does currently not support per-node material
  389. * assignment to meshes, which means that identical meshes with
  390. * differnent materials are currently *not* joined, although this is
  391. * planned for future versions.
  392. */
  393. aiProcess_FindInstances = 0x100000,
  394. // -------------------------------------------------------------------------
  395. /** <hr>A postprocessing step to reduce the number of meshes.
  396. *
  397. * In fact, it will reduce the number of drawcalls.
  398. *
  399. * This is a very effective optimization and is recommended to be used
  400. * together with #aiProcess_OptimizeGraph, if possible. The flag is fully
  401. * compatible with both #aiProcess_SplitLargeMeshes and #aiProcess_SortByPType.
  402. */
  403. aiProcess_OptimizeMeshes = 0x200000,
  404. // -------------------------------------------------------------------------
  405. /** <hr>A postprocessing step to optimize the scene hierarchy.
  406. *
  407. * Nodes with no animations, bones, lights or cameras assigned are
  408. * collapsed and joined.
  409. *
  410. * Node names can be lost during this step. If you use special 'tag nodes'
  411. * to pass additional information through your content pipeline, use the
  412. * <tt>#AI_CONFIG_PP_OG_EXCLUDE_LIST</tt> setting to specify a list of node
  413. * names you want to be kept. Nodes matching one of the names in this list won't
  414. * be touched or modified.
  415. *
  416. * Use this flag with caution. Most simple files will be collapsed to a
  417. * single node, complex hierarchies are usually completely lost. That's not
  418. * the right choice for editor environments, but probably a very effective
  419. * optimization if you just want to get the model data, convert it to your
  420. * own format and render it as fast as possible.
  421. *
  422. * This flag is designed to be used with #aiProcess_OptimizeMeshes for best
  423. * results.
  424. *
  425. * @note 'crappy' scenes with thousands of extremely small meshes packed
  426. * in deeply nested nodes exist for almost all file formats.
  427. * #aiProcess_OptimizeMeshes in combination with #aiProcess_OptimizeGraph
  428. * usually fixes them all and makes them renderable.
  429. */
  430. aiProcess_OptimizeGraph = 0x400000,
  431. // -------------------------------------------------------------------------
  432. /** <hr>This step flips all UV coordinates along the y-axis and adjusts
  433. * material settings and bitangents accordingly.
  434. * <br><b>Output UV coordinate system:</b>
  435. * @code
  436. * 0y|0y ---------- 1x|0y
  437. * | |
  438. * | |
  439. * | |
  440. * 0x|1y ---------- 1x|1y
  441. * @endcode
  442. *
  443. * You'll probably want to consider this flag if you use Direct3D for
  444. * rendering. The #aiProcess_ConvertToLeftHanded flag supersedes this
  445. * setting and bundles all conversions typically required for D3D-based
  446. * applications.
  447. */
  448. aiProcess_FlipUVs = 0x800000,
  449. // -------------------------------------------------------------------------
  450. /** <hr>This step adjusts the output face winding order to be cw.
  451. *
  452. * The default face winding order is counter clockwise.
  453. * <br><b>Output face order:</b>
  454. * @code
  455. * x2
  456. *
  457. * x0
  458. * x1
  459. * @endcode
  460. */
  461. aiProcess_FlipWindingOrder = 0x1000000,
  462. // -------------------------------------------------------------------------
  463. /** <hr>This step splits meshes with many bones into submeshes so that each
  464. * submesh has fewer or as many bones as a given limit.
  465. */
  466. aiProcess_SplitByBoneCount = 0x2000000,
  467. // -------------------------------------------------------------------------
  468. /** <hr>This step removes bones losslessly or according to some threshold.
  469. * In some cases (i.e. format that require it) exporters are forced to
  470. * assign dummy bone weights to otherwise static meshes assigned to
  471. * animated meshes. Since full, weight-based skinning is expensive but
  472. * animating nodes is extremely cheap, this step is offered to cleanup
  473. * the data in that regard.
  474. *
  475. * Use <tt>#AI_CONFIG_PP_DB_THRESHOLD</tt> to control this.
  476. * Use <tt>#AI_CONFIG_PP_DB_ALL_OR_NONE</tt> if you want bones removed if and
  477. * only if all bones within the scene qualify for removal.
  478. */
  479. aiProcess_Debone = 0x4000000
  480. // aiProcess_GenEntityMeshes = 0x100000,
  481. // aiProcess_OptimizeAnimations = 0x200000
  482. // aiProcess_FixTexturePaths = 0x200000
  483. };
  484. // ---------------------------------------------------------------------------------------
  485. /** @def aiProcess_ConvertToLeftHanded
  486. * @brief Shortcut flag for Direct3D-based applications.
  487. *
  488. * Supersedes the #aiProcess_MakeLeftHanded and #aiProcess_FlipUVs and
  489. * #aiProcess_FlipWindingOrder flags.
  490. * The output data matches Direct3D's conventions: left-handed geometry, upper-left
  491. * origin for UV coordinates and finally clockwise face order, suitable for CCW culling.
  492. *
  493. * @deprecated
  494. */
  495. #define aiProcess_ConvertToLeftHanded ( \
  496. aiProcess_MakeLeftHanded | \
  497. aiProcess_FlipUVs | \
  498. aiProcess_FlipWindingOrder | \
  499. 0 )
  500. // ---------------------------------------------------------------------------------------
  501. /** @def aiProcessPreset_TargetRealtimeUse_Fast
  502. * @brief Default postprocess configuration optimizing the data for real-time rendering.
  503. *
  504. * Applications would want to use this preset to load models on end-user PCs,
  505. * maybe for direct use in game.
  506. *
  507. * If you're using DirectX, don't forget to combine this value with
  508. * the #aiProcess_ConvertToLeftHanded step. If you don't support UV transformations
  509. * in your application apply the #aiProcess_TransformUVCoords step, too.
  510. * @note Please take the time to read the doc to the steps enabled by this preset.
  511. * Some of them offer further configurable properties, some of them might not be of
  512. * use for you so it might be better to not specify them.
  513. */
  514. #define aiProcessPreset_TargetRealtime_Fast ( \
  515. aiProcess_CalcTangentSpace | \
  516. aiProcess_GenNormals | \
  517. aiProcess_JoinIdenticalVertices | \
  518. aiProcess_Triangulate | \
  519. aiProcess_GenUVCoords | \
  520. aiProcess_SortByPType | \
  521. 0 )
  522. // ---------------------------------------------------------------------------------------
  523. /** @def aiProcessPreset_TargetRealtime_Quality
  524. * @brief Default postprocess configuration optimizing the data for real-time rendering.
  525. *
  526. * Unlike #aiProcessPreset_TargetRealtime_Fast, this configuration
  527. * performs some extra optimizations to improve rendering speed and
  528. * to minimize memory usage. It could be a good choice for a level editor
  529. * environment where import speed is not so important.
  530. *
  531. * If you're using DirectX, don't forget to combine this value with
  532. * the #aiProcess_ConvertToLeftHanded step. If you don't support UV transformations
  533. * in your application apply the #aiProcess_TransformUVCoords step, too.
  534. * @note Please take the time to read the doc for the steps enabled by this preset.
  535. * Some of them offer further configurable properties, some of them might not be of
  536. * use for you so it might be better to not specify them.
  537. */
  538. #define aiProcessPreset_TargetRealtime_Quality ( \
  539. aiProcess_CalcTangentSpace | \
  540. aiProcess_GenSmoothNormals | \
  541. aiProcess_JoinIdenticalVertices | \
  542. aiProcess_ImproveCacheLocality | \
  543. aiProcess_LimitBoneWeights | \
  544. aiProcess_RemoveRedundantMaterials | \
  545. aiProcess_SplitLargeMeshes | \
  546. aiProcess_Triangulate | \
  547. aiProcess_GenUVCoords | \
  548. aiProcess_SortByPType | \
  549. aiProcess_FindDegenerates | \
  550. aiProcess_FindInvalidData | \
  551. 0 )
  552. // ---------------------------------------------------------------------------------------
  553. /** @def aiProcessPreset_TargetRealtime_MaxQuality
  554. * @brief Default postprocess configuration optimizing the data for real-time rendering.
  555. *
  556. * This preset enables almost every optimization step to achieve perfectly
  557. * optimized data. It's your choice for level editor environments where import speed
  558. * is not important.
  559. *
  560. * If you're using DirectX, don't forget to combine this value with
  561. * the #aiProcess_ConvertToLeftHanded step. If you don't support UV transformations
  562. * in your application, apply the #aiProcess_TransformUVCoords step, too.
  563. * @note Please take the time to read the doc for the steps enabled by this preset.
  564. * Some of them offer further configurable properties, some of them might not be of
  565. * use for you so it might be better to not specify them.
  566. */
  567. #define aiProcessPreset_TargetRealtime_MaxQuality ( \
  568. aiProcessPreset_TargetRealtime_Quality | \
  569. aiProcess_FindInstances | \
  570. aiProcess_ValidateDataStructure | \
  571. aiProcess_OptimizeMeshes | \
  572. aiProcess_Debone | \
  573. 0 )
  574. #ifdef __cplusplus
  575. } // end of extern "C"
  576. #endif
  577. #endif // AI_POSTPROCESS_H_INC