miniassimp

annotate include/miniassimp/postprocess.h @ 0:879c81d94345

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