vrshoot

annotate libs/assimp/assimp/postprocess.h @ 0:b2f14e535253

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