miniassimp

diff 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
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/include/miniassimp/postprocess.h	Mon Jan 28 18:19:26 2019 +0200
     1.3 @@ -0,0 +1,679 @@
     1.4 +/*
     1.5 +Open Asset Import Library (assimp)
     1.6 +----------------------------------------------------------------------
     1.7 +
     1.8 +Copyright (c) 2006-2018, assimp team
     1.9 +
    1.10 +
    1.11 +All rights reserved.
    1.12 +
    1.13 +Redistribution and use of this software in source and binary forms,
    1.14 +with or without modification, are permitted provided that the
    1.15 +following conditions are met:
    1.16 +
    1.17 +* Redistributions of source code must retain the above
    1.18 +  copyright notice, this list of conditions and the
    1.19 +  following disclaimer.
    1.20 +
    1.21 +* Redistributions in binary form must reproduce the above
    1.22 +  copyright notice, this list of conditions and the
    1.23 +  following disclaimer in the documentation and/or other
    1.24 +  materials provided with the distribution.
    1.25 +
    1.26 +* Neither the name of the assimp team, nor the names of its
    1.27 +  contributors may be used to endorse or promote products
    1.28 +  derived from this software without specific prior
    1.29 +  written permission of the assimp team.
    1.30 +
    1.31 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    1.32 +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    1.33 +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    1.34 +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    1.35 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    1.36 +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    1.37 +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    1.38 +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    1.39 +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    1.40 +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    1.41 +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    1.42 +
    1.43 +----------------------------------------------------------------------
    1.44 +*/
    1.45 +
    1.46 +/** @file postprocess.h
    1.47 + *  @brief Definitions for import post processing steps
    1.48 + */
    1.49 +#pragma once
    1.50 +#ifndef AI_POSTPROCESS_H_INC
    1.51 +#define AI_POSTPROCESS_H_INC
    1.52 +
    1.53 +#include "types.h"
    1.54 +
    1.55 +#ifdef __cplusplus
    1.56 +extern "C" {
    1.57 +#endif
    1.58 +
    1.59 +// -----------------------------------------------------------------------------------
    1.60 +/** @enum  aiPostProcessSteps
    1.61 + *  @brief Defines the flags for all possible post processing steps.
    1.62 + *
    1.63 + *  @note Some steps are influenced by properties set on the Assimp::Importer itself
    1.64 + *
    1.65 + *  @see Assimp::Importer::ReadFile()
    1.66 + *  @see Assimp::Importer::SetPropertyInteger()
    1.67 + *  @see aiImportFile
    1.68 + *  @see aiImportFileEx
    1.69 + */
    1.70 +// -----------------------------------------------------------------------------------
    1.71 +enum aiPostProcessSteps
    1.72 +{
    1.73 +
    1.74 +    // -------------------------------------------------------------------------
    1.75 +    /** <hr>Calculates the tangents and bitangents for the imported meshes.
    1.76 +     *
    1.77 +     * Does nothing if a mesh does not have normals. You might want this post
    1.78 +     * processing step to be executed if you plan to use tangent space calculations
    1.79 +     * such as normal mapping  applied to the meshes. There's an importer property,
    1.80 +     * <tt>#AI_CONFIG_PP_CT_MAX_SMOOTHING_ANGLE</tt>, which allows you to specify
    1.81 +     * a maximum smoothing angle for the algorithm. However, usually you'll
    1.82 +     * want to leave it at the default value.
    1.83 +     */
    1.84 +    aiProcess_CalcTangentSpace = 0x1,
    1.85 +
    1.86 +    // -------------------------------------------------------------------------
    1.87 +    /** <hr>Identifies and joins identical vertex data sets within all
    1.88 +     *  imported meshes.
    1.89 +     *
    1.90 +     * After this step is run, each mesh contains unique vertices,
    1.91 +     * so a vertex may be used by multiple faces. You usually want
    1.92 +     * to use this post processing step. If your application deals with
    1.93 +     * indexed geometry, this step is compulsory or you'll just waste rendering
    1.94 +     * time. <b>If this flag is not specified</b>, no vertices are referenced by
    1.95 +     * more than one face and <b>no index buffer is required</b> for rendering.
    1.96 +     */
    1.97 +    aiProcess_JoinIdenticalVertices = 0x2,
    1.98 +
    1.99 +    // -------------------------------------------------------------------------
   1.100 +    /** <hr>Converts all the imported data to a left-handed coordinate space.
   1.101 +     *
   1.102 +     * By default the data is returned in a right-handed coordinate space (which
   1.103 +     * OpenGL prefers). In this space, +X points to the right,
   1.104 +     * +Z points towards the viewer, and +Y points upwards. In the DirectX
   1.105 +     * coordinate space +X points to the right, +Y points upwards, and +Z points
   1.106 +     * away from the viewer.
   1.107 +     *
   1.108 +     * You'll probably want to consider this flag if you use Direct3D for
   1.109 +     * rendering. The #aiProcess_ConvertToLeftHanded flag supersedes this
   1.110 +     * setting and bundles all conversions typically required for D3D-based
   1.111 +     * applications.
   1.112 +     */
   1.113 +    aiProcess_MakeLeftHanded = 0x4,
   1.114 +
   1.115 +    // -------------------------------------------------------------------------
   1.116 +    /** <hr>Triangulates all faces of all meshes.
   1.117 +     *
   1.118 +     * By default the imported mesh data might contain faces with more than 3
   1.119 +     * indices. For rendering you'll usually want all faces to be triangles.
   1.120 +     * This post processing step splits up faces with more than 3 indices into
   1.121 +     * triangles. Line and point primitives are *not* modified! If you want
   1.122 +     * 'triangles only' with no other kinds of primitives, try the following
   1.123 +     * solution:
   1.124 +     * <ul>
   1.125 +     * <li>Specify both #aiProcess_Triangulate and #aiProcess_SortByPType </li>
   1.126 +     * <li>Ignore all point and line meshes when you process assimp's output</li>
   1.127 +     * </ul>
   1.128 +     */
   1.129 +    aiProcess_Triangulate = 0x8,
   1.130 +
   1.131 +    // -------------------------------------------------------------------------
   1.132 +    /** <hr>Removes some parts of the data structure (animations, materials,
   1.133 +     *  light sources, cameras, textures, vertex components).
   1.134 +     *
   1.135 +     * The  components to be removed are specified in a separate
   1.136 +     * importer property, <tt>#AI_CONFIG_PP_RVC_FLAGS</tt>. This is quite useful
   1.137 +     * if you don't need all parts of the output structure. Vertex colors
   1.138 +     * are rarely used today for example... Calling this step to remove unneeded
   1.139 +     * data from the pipeline as early as possible results in increased
   1.140 +     * performance and a more optimized output data structure.
   1.141 +     * This step is also useful if you want to force Assimp to recompute
   1.142 +     * normals or tangents. The corresponding steps don't recompute them if
   1.143 +     * they're already there (loaded from the source asset). By using this
   1.144 +     * step you can make sure they are NOT there.
   1.145 +     *
   1.146 +     * This flag is a poor one, mainly because its purpose is usually
   1.147 +     * misunderstood. Consider the following case: a 3D model has been exported
   1.148 +     * from a CAD app, and it has per-face vertex colors. Vertex positions can't be
   1.149 +     * shared, thus the #aiProcess_JoinIdenticalVertices step fails to
   1.150 +     * optimize the data because of these nasty little vertex colors.
   1.151 +     * Most apps don't even process them, so it's all for nothing. By using
   1.152 +     * this step, unneeded components are excluded as early as possible
   1.153 +     * thus opening more room for internal optimizations.
   1.154 +     */
   1.155 +    aiProcess_RemoveComponent = 0x10,
   1.156 +
   1.157 +    // -------------------------------------------------------------------------
   1.158 +    /** <hr>Generates normals for all faces of all meshes.
   1.159 +     *
   1.160 +     * This is ignored if normals are already there at the time this flag
   1.161 +     * is evaluated. Model importers try to load them from the source file, so
   1.162 +     * they're usually already there. Face normals are shared between all points
   1.163 +     * of a single face, so a single point can have multiple normals, which
   1.164 +     * forces the library to duplicate vertices in some cases.
   1.165 +     * #aiProcess_JoinIdenticalVertices is *senseless* then.
   1.166 +     *
   1.167 +     * This flag may not be specified together with #aiProcess_GenSmoothNormals.
   1.168 +     */
   1.169 +    aiProcess_GenNormals = 0x20,
   1.170 +
   1.171 +    // -------------------------------------------------------------------------
   1.172 +    /** <hr>Generates smooth normals for all vertices in the mesh.
   1.173 +    *
   1.174 +    * This is ignored if normals are already there at the time this flag
   1.175 +    * is evaluated. Model importers try to load them from the source file, so
   1.176 +    * they're usually already there.
   1.177 +    *
   1.178 +    * This flag may not be specified together with
   1.179 +    * #aiProcess_GenNormals. There's a importer property,
   1.180 +    * <tt>#AI_CONFIG_PP_GSN_MAX_SMOOTHING_ANGLE</tt> which allows you to specify
   1.181 +    * an angle maximum for the normal smoothing algorithm. Normals exceeding
   1.182 +    * this limit are not smoothed, resulting in a 'hard' seam between two faces.
   1.183 +    * Using a decent angle here (e.g. 80 degrees) results in very good visual
   1.184 +    * appearance.
   1.185 +    */
   1.186 +    aiProcess_GenSmoothNormals = 0x40,
   1.187 +
   1.188 +    // -------------------------------------------------------------------------
   1.189 +    /** <hr>Splits large meshes into smaller sub-meshes.
   1.190 +    *
   1.191 +    * This is quite useful for real-time rendering, where the number of triangles
   1.192 +    * which can be maximally processed in a single draw-call is limited
   1.193 +    * by the video driver/hardware. The maximum vertex buffer is usually limited
   1.194 +    * too. Both requirements can be met with this step: you may specify both a
   1.195 +    * triangle and vertex limit for a single mesh.
   1.196 +    *
   1.197 +    * The split limits can (and should!) be set through the
   1.198 +    * <tt>#AI_CONFIG_PP_SLM_VERTEX_LIMIT</tt> and <tt>#AI_CONFIG_PP_SLM_TRIANGLE_LIMIT</tt>
   1.199 +    * importer properties. The default values are <tt>#AI_SLM_DEFAULT_MAX_VERTICES</tt> and
   1.200 +    * <tt>#AI_SLM_DEFAULT_MAX_TRIANGLES</tt>.
   1.201 +    *
   1.202 +    * Note that splitting is generally a time-consuming task, but only if there's
   1.203 +    * something to split. The use of this step is recommended for most users.
   1.204 +    */
   1.205 +    aiProcess_SplitLargeMeshes = 0x80,
   1.206 +
   1.207 +    // -------------------------------------------------------------------------
   1.208 +    /** <hr>Removes the node graph and pre-transforms all vertices with
   1.209 +    * the local transformation matrices of their nodes.
   1.210 +    *
   1.211 +    * The output scene still contains nodes, however there is only a
   1.212 +    * root node with children, each one referencing only one mesh,
   1.213 +    * and each mesh referencing one material. For rendering, you can
   1.214 +    * simply render all meshes in order - you don't need to pay
   1.215 +    * attention to local transformations and the node hierarchy.
   1.216 +    * Animations are removed during this step.
   1.217 +    * This step is intended for applications without a scenegraph.
   1.218 +    * The step CAN cause some problems: if e.g. a mesh of the asset
   1.219 +    * contains normals and another, using the same material index, does not,
   1.220 +    * they will be brought together, but the first meshes's part of
   1.221 +    * the normal list is zeroed. However, these artifacts are rare.
   1.222 +    * @note The <tt>#AI_CONFIG_PP_PTV_NORMALIZE</tt> configuration property
   1.223 +    * can be set to normalize the scene's spatial dimension to the -1...1
   1.224 +    * range.
   1.225 +    */
   1.226 +    aiProcess_PreTransformVertices = 0x100,
   1.227 +
   1.228 +    // -------------------------------------------------------------------------
   1.229 +    /** <hr>Limits the number of bones simultaneously affecting a single vertex
   1.230 +    *  to a maximum value.
   1.231 +    *
   1.232 +    * If any vertex is affected by more than the maximum number of bones, the least
   1.233 +    * important vertex weights are removed and the remaining vertex weights are
   1.234 +    * renormalized so that the weights still sum up to 1.
   1.235 +    * The default bone weight limit is 4 (defined as <tt>#AI_LMW_MAX_WEIGHTS</tt> in
   1.236 +    * config.h), but you can use the <tt>#AI_CONFIG_PP_LBW_MAX_WEIGHTS</tt> importer
   1.237 +    * property to supply your own limit to the post processing step.
   1.238 +    *
   1.239 +    * If you intend to perform the skinning in hardware, this post processing
   1.240 +    * step might be of interest to you.
   1.241 +    */
   1.242 +    aiProcess_LimitBoneWeights = 0x200,
   1.243 +
   1.244 +    // -------------------------------------------------------------------------
   1.245 +    /** <hr>Validates the imported scene data structure.
   1.246 +     * This makes sure that all indices are valid, all animations and
   1.247 +     * bones are linked correctly, all material references are correct .. etc.
   1.248 +     *
   1.249 +     * It is recommended that you capture Assimp's log output if you use this flag,
   1.250 +     * so you can easily find out what's wrong if a file fails the
   1.251 +     * validation. The validator is quite strict and will find *all*
   1.252 +     * inconsistencies in the data structure... It is recommended that plugin
   1.253 +     * developers use it to debug their loaders. There are two types of
   1.254 +     * validation failures:
   1.255 +     * <ul>
   1.256 +     * <li>Error: There's something wrong with the imported data. Further
   1.257 +     *   postprocessing is not possible and the data is not usable at all.
   1.258 +     *   The import fails. #Importer::GetErrorString() or #aiGetErrorString()
   1.259 +     *   carry the error message around.</li>
   1.260 +     * <li>Warning: There are some minor issues (e.g. 1000000 animation
   1.261 +     *   keyframes with the same time), but further postprocessing and use
   1.262 +     *   of the data structure is still safe. Warning details are written
   1.263 +     *   to the log file, <tt>#AI_SCENE_FLAGS_VALIDATION_WARNING</tt> is set
   1.264 +     *   in #aiScene::mFlags</li>
   1.265 +     * </ul>
   1.266 +     *
   1.267 +     * This post-processing step is not time-consuming. Its use is not
   1.268 +     * compulsory, but recommended.
   1.269 +    */
   1.270 +    aiProcess_ValidateDataStructure = 0x400,
   1.271 +
   1.272 +    // -------------------------------------------------------------------------
   1.273 +    /** <hr>Reorders triangles for better vertex cache locality.
   1.274 +     *
   1.275 +     * The step tries to improve the ACMR (average post-transform vertex cache
   1.276 +     * miss ratio) for all meshes. The implementation runs in O(n) and is
   1.277 +     * roughly based on the 'tipsify' algorithm (see <a href="
   1.278 +     * http://www.cs.princeton.edu/gfx/pubs/Sander_2007_%3ETR/tipsy.pdf">this
   1.279 +     * paper</a>).
   1.280 +     *
   1.281 +     * If you intend to render huge models in hardware, this step might
   1.282 +     * be of interest to you. The <tt>#AI_CONFIG_PP_ICL_PTCACHE_SIZE</tt>
   1.283 +     * importer property can be used to fine-tune the cache optimization.
   1.284 +     */
   1.285 +    aiProcess_ImproveCacheLocality = 0x800,
   1.286 +
   1.287 +    // -------------------------------------------------------------------------
   1.288 +    /** <hr>Searches for redundant/unreferenced materials and removes them.
   1.289 +     *
   1.290 +     * This is especially useful in combination with the
   1.291 +     * #aiProcess_PreTransformVertices and #aiProcess_OptimizeMeshes flags.
   1.292 +     * Both join small meshes with equal characteristics, but they can't do
   1.293 +     * their work if two meshes have different materials. Because several
   1.294 +     * material settings are lost during Assimp's import filters,
   1.295 +     * (and because many exporters don't check for redundant materials), huge
   1.296 +     * models often have materials which are are defined several times with
   1.297 +     * exactly the same settings.
   1.298 +     *
   1.299 +     * Several material settings not contributing to the final appearance of
   1.300 +     * a surface are ignored in all comparisons (e.g. the material name).
   1.301 +     * So, if you're passing additional information through the
   1.302 +     * content pipeline (probably using *magic* material names), don't
   1.303 +     * specify this flag. Alternatively take a look at the
   1.304 +     * <tt>#AI_CONFIG_PP_RRM_EXCLUDE_LIST</tt> importer property.
   1.305 +     */
   1.306 +    aiProcess_RemoveRedundantMaterials = 0x1000,
   1.307 +
   1.308 +    // -------------------------------------------------------------------------
   1.309 +    /** <hr>This step tries to determine which meshes have normal vectors
   1.310 +     * that are facing inwards and inverts them.
   1.311 +     *
   1.312 +     * The algorithm is simple but effective:
   1.313 +     * the bounding box of all vertices + their normals is compared against
   1.314 +     * the volume of the bounding box of all vertices without their normals.
   1.315 +     * This works well for most objects, problems might occur with planar
   1.316 +     * surfaces. However, the step tries to filter such cases.
   1.317 +     * The step inverts all in-facing normals. Generally it is recommended
   1.318 +     * to enable this step, although the result is not always correct.
   1.319 +    */
   1.320 +    aiProcess_FixInfacingNormals = 0x2000,
   1.321 +
   1.322 +    // -------------------------------------------------------------------------
   1.323 +    /** <hr>This step splits meshes with more than one primitive type in
   1.324 +     *  homogeneous sub-meshes.
   1.325 +     *
   1.326 +     *  The step is executed after the triangulation step. After the step
   1.327 +     *  returns, just one bit is set in aiMesh::mPrimitiveTypes. This is
   1.328 +     *  especially useful for real-time rendering where point and line
   1.329 +     *  primitives are often ignored or rendered separately.
   1.330 +     *  You can use the <tt>#AI_CONFIG_PP_SBP_REMOVE</tt> importer property to
   1.331 +     *  specify which primitive types you need. This can be used to easily
   1.332 +     *  exclude lines and points, which are rarely used, from the import.
   1.333 +    */
   1.334 +    aiProcess_SortByPType = 0x8000,
   1.335 +
   1.336 +    // -------------------------------------------------------------------------
   1.337 +    /** <hr>This step searches all meshes for degenerate primitives and
   1.338 +     *  converts them to proper lines or points.
   1.339 +     *
   1.340 +     * A face is 'degenerate' if one or more of its points are identical.
   1.341 +     * To have the degenerate stuff not only detected and collapsed but
   1.342 +     * removed, try one of the following procedures:
   1.343 +     * <br><b>1.</b> (if you support lines and points for rendering but don't
   1.344 +     *    want the degenerates)<br>
   1.345 +     * <ul>
   1.346 +     *   <li>Specify the #aiProcess_FindDegenerates flag.
   1.347 +     *   </li>
   1.348 +     *   <li>Set the <tt>#AI_CONFIG_PP_FD_REMOVE</tt> importer property to
   1.349 +     *       1. This will cause the step to remove degenerate triangles from the
   1.350 +     *       import as soon as they're detected. They won't pass any further
   1.351 +     *       pipeline steps.
   1.352 +     *   </li>
   1.353 +     * </ul>
   1.354 +     * <br><b>2.</b>(if you don't support lines and points at all)<br>
   1.355 +     * <ul>
   1.356 +     *   <li>Specify the #aiProcess_FindDegenerates flag.
   1.357 +     *   </li>
   1.358 +     *   <li>Specify the #aiProcess_SortByPType flag. This moves line and
   1.359 +     *     point primitives to separate meshes.
   1.360 +     *   </li>
   1.361 +     *   <li>Set the <tt>#AI_CONFIG_PP_SBP_REMOVE</tt> importer property to
   1.362 +     *       @code aiPrimitiveType_POINTS | aiPrimitiveType_LINES
   1.363 +     *       @endcode to cause SortByPType to reject point
   1.364 +     *       and line meshes from the scene.
   1.365 +     *   </li>
   1.366 +     * </ul>
   1.367 +     *
   1.368 +     * This step also removes very small triangles with a surface area smaller
   1.369 +     * than 10^-6. If you rely on having these small triangles, or notice holes
   1.370 +     * in your model, set the property <tt>#AI_CONFIG_PP_FD_CHECKAREA</tt> to
   1.371 +     * false.
   1.372 +     * @note Degenerate polygons are not necessarily evil and that's why
   1.373 +     * they're not removed by default. There are several file formats which
   1.374 +     * don't support lines or points, and some exporters bypass the
   1.375 +     * format specification and write them as degenerate triangles instead.
   1.376 +    */
   1.377 +    aiProcess_FindDegenerates = 0x10000,
   1.378 +
   1.379 +    // -------------------------------------------------------------------------
   1.380 +    /** <hr>This step searches all meshes for invalid data, such as zeroed
   1.381 +     *  normal vectors or invalid UV coords and removes/fixes them. This is
   1.382 +     *  intended to get rid of some common exporter errors.
   1.383 +     *
   1.384 +     * This is especially useful for normals. If they are invalid, and
   1.385 +     * the step recognizes this, they will be removed and can later
   1.386 +     * be recomputed, i.e. by the #aiProcess_GenSmoothNormals flag.<br>
   1.387 +     * The step will also remove meshes that are infinitely small and reduce
   1.388 +     * animation tracks consisting of hundreds if redundant keys to a single
   1.389 +     * key. The <tt>AI_CONFIG_PP_FID_ANIM_ACCURACY</tt> config property decides
   1.390 +     * the accuracy of the check for duplicate animation tracks.
   1.391 +    */
   1.392 +    aiProcess_FindInvalidData = 0x20000,
   1.393 +
   1.394 +    // -------------------------------------------------------------------------
   1.395 +    /** <hr>This step converts non-UV mappings (such as spherical or
   1.396 +     *  cylindrical mapping) to proper texture coordinate channels.
   1.397 +     *
   1.398 +     * Most applications will support UV mapping only, so you will
   1.399 +     * probably want to specify this step in every case. Note that Assimp is not
   1.400 +     * always able to match the original mapping implementation of the
   1.401 +     * 3D app which produced a model perfectly. It's always better to let the
   1.402 +     * modelling app compute the UV channels - 3ds max, Maya, Blender,
   1.403 +     * LightWave, and Modo do this for example.
   1.404 +     *
   1.405 +     * @note If this step is not requested, you'll need to process the
   1.406 +     * <tt>#AI_MATKEY_MAPPING</tt> material property in order to display all assets
   1.407 +     * properly.
   1.408 +     */
   1.409 +    aiProcess_GenUVCoords = 0x40000,
   1.410 +
   1.411 +    // -------------------------------------------------------------------------
   1.412 +    /** <hr>This step applies per-texture UV transformations and bakes
   1.413 +     *  them into stand-alone vtexture coordinate channels.
   1.414 +     *
   1.415 +     * UV transformations are specified per-texture - see the
   1.416 +     * <tt>#AI_MATKEY_UVTRANSFORM</tt> material key for more information.
   1.417 +     * This step processes all textures with
   1.418 +     * transformed input UV coordinates and generates a new (pre-transformed) UV channel
   1.419 +     * which replaces the old channel. Most applications won't support UV
   1.420 +     * transformations, so you will probably want to specify this step.
   1.421 +     *
   1.422 +     * @note UV transformations are usually implemented in real-time apps by
   1.423 +     * transforming texture coordinates at vertex shader stage with a 3x3
   1.424 +     * (homogenous) transformation matrix.
   1.425 +    */
   1.426 +    aiProcess_TransformUVCoords = 0x80000,
   1.427 +
   1.428 +    // -------------------------------------------------------------------------
   1.429 +    /** <hr>This step searches for duplicate meshes and replaces them
   1.430 +     *  with references to the first mesh.
   1.431 +     *
   1.432 +     *  This step takes a while, so don't use it if speed is a concern.
   1.433 +     *  Its main purpose is to workaround the fact that many export
   1.434 +     *  file formats don't support instanced meshes, so exporters need to
   1.435 +     *  duplicate meshes. This step removes the duplicates again. Please
   1.436 +     *  note that Assimp does not currently support per-node material
   1.437 +     *  assignment to meshes, which means that identical meshes with
   1.438 +     *  different materials are currently *not* joined, although this is
   1.439 +     *  planned for future versions.
   1.440 +     */
   1.441 +    aiProcess_FindInstances = 0x100000,
   1.442 +
   1.443 +    // -------------------------------------------------------------------------
   1.444 +    /** <hr>A postprocessing step to reduce the number of meshes.
   1.445 +     *
   1.446 +     *  This will, in fact, reduce the number of draw calls.
   1.447 +     *
   1.448 +     *  This is a very effective optimization and is recommended to be used
   1.449 +     *  together with #aiProcess_OptimizeGraph, if possible. The flag is fully
   1.450 +     *  compatible with both #aiProcess_SplitLargeMeshes and #aiProcess_SortByPType.
   1.451 +    */
   1.452 +    aiProcess_OptimizeMeshes  = 0x200000,
   1.453 +
   1.454 +
   1.455 +    // -------------------------------------------------------------------------
   1.456 +    /** <hr>A postprocessing step to optimize the scene hierarchy.
   1.457 +     *
   1.458 +     *  Nodes without animations, bones, lights or cameras assigned are
   1.459 +     *  collapsed and joined.
   1.460 +     *
   1.461 +     *  Node names can be lost during this step. If you use special 'tag nodes'
   1.462 +     *  to pass additional information through your content pipeline, use the
   1.463 +     *  <tt>#AI_CONFIG_PP_OG_EXCLUDE_LIST</tt> importer property to specify a
   1.464 +     *  list of node names you want to be kept. Nodes matching one of the names
   1.465 +     *  in this list won't be touched or modified.
   1.466 +     *
   1.467 +     *  Use this flag with caution. Most simple files will be collapsed to a
   1.468 +     *  single node, so complex hierarchies are usually completely lost. This is not
   1.469 +     *  useful for editor environments, but probably a very effective
   1.470 +     *  optimization if you just want to get the model data, convert it to your
   1.471 +     *  own format, and render it as fast as possible.
   1.472 +     *
   1.473 +     *  This flag is designed to be used with #aiProcess_OptimizeMeshes for best
   1.474 +     *  results.
   1.475 +     *
   1.476 +     *  @note 'Crappy' scenes with thousands of extremely small meshes packed
   1.477 +     *  in deeply nested nodes exist for almost all file formats.
   1.478 +     *  #aiProcess_OptimizeMeshes in combination with #aiProcess_OptimizeGraph
   1.479 +     *  usually fixes them all and makes them renderable.
   1.480 +    */
   1.481 +    aiProcess_OptimizeGraph  = 0x400000,
   1.482 +
   1.483 +    // -------------------------------------------------------------------------
   1.484 +    /** <hr>This step flips all UV coordinates along the y-axis and adjusts
   1.485 +     * material settings and bitangents accordingly.
   1.486 +     *
   1.487 +     * <b>Output UV coordinate system:</b>
   1.488 +     * @code
   1.489 +     * 0y|0y ---------- 1x|0y
   1.490 +     * |                 |
   1.491 +     * |                 |
   1.492 +     * |                 |
   1.493 +     * 0x|1y ---------- 1x|1y
   1.494 +     * @endcode
   1.495 +     *
   1.496 +     * You'll probably want to consider this flag if you use Direct3D for
   1.497 +     * rendering. The #aiProcess_ConvertToLeftHanded flag supersedes this
   1.498 +     * setting and bundles all conversions typically required for D3D-based
   1.499 +     * applications.
   1.500 +    */
   1.501 +    aiProcess_FlipUVs = 0x800000,
   1.502 +
   1.503 +    // -------------------------------------------------------------------------
   1.504 +    /** <hr>This step adjusts the output face winding order to be CW.
   1.505 +     *
   1.506 +     * The default face winding order is counter clockwise (CCW).
   1.507 +     *
   1.508 +     * <b>Output face order:</b>
   1.509 +     * @code
   1.510 +     *       x2
   1.511 +     *
   1.512 +     *                         x0
   1.513 +     *  x1
   1.514 +     * @endcode
   1.515 +    */
   1.516 +    aiProcess_FlipWindingOrder  = 0x1000000,
   1.517 +
   1.518 +    // -------------------------------------------------------------------------
   1.519 +    /** <hr>This step splits meshes with many bones into sub-meshes so that each
   1.520 +     * su-bmesh has fewer or as many bones as a given limit.
   1.521 +    */
   1.522 +    aiProcess_SplitByBoneCount  = 0x2000000,
   1.523 +
   1.524 +    // -------------------------------------------------------------------------
   1.525 +    /** <hr>This step removes bones losslessly or according to some threshold.
   1.526 +     *
   1.527 +     *  In some cases (i.e. formats that require it) exporters are forced to
   1.528 +     *  assign dummy bone weights to otherwise static meshes assigned to
   1.529 +     *  animated meshes. Full, weight-based skinning is expensive while
   1.530 +     *  animating nodes is extremely cheap, so this step is offered to clean up
   1.531 +     *  the data in that regard.
   1.532 +     *
   1.533 +     *  Use <tt>#AI_CONFIG_PP_DB_THRESHOLD</tt> to control this.
   1.534 +     *  Use <tt>#AI_CONFIG_PP_DB_ALL_OR_NONE</tt> if you want bones removed if and
   1.535 +     *  only if all bones within the scene qualify for removal.
   1.536 +    */
   1.537 +    aiProcess_Debone  = 0x4000000,
   1.538 +
   1.539 +    // -------------------------------------------------------------------------
   1.540 +    /** <hr>This step will perform a global scale of the model.
   1.541 +    *
   1.542 +    *  Some importers are providing a mechanism to define a scaling unit for the
   1.543 +    *  model. This post processing step can be used to do so. You need to get the
   1.544 +    *  global scaling from your importer settings like in FBX. Use the flag
   1.545 +    *  AI_CONFIG_GLOBAL_SCALE_FACTOR_KEY from the global property table to configure this.
   1.546 +    *
   1.547 +    *  Use <tt>#AI_CONFIG_GLOBAL_SCALE_FACTOR_KEY</tt> to setup the global scaing factor.
   1.548 +    */
   1.549 +    aiProcess_GlobalScale = 0x8000000,
   1.550 +
   1.551 +    // -------------------------------------------------------------------------
   1.552 +    /** <hr>A postprocessing step to embed of textures.
   1.553 +     *
   1.554 +     *  This will remove external data dependencies for textures.
   1.555 +     *  If a texture's file does not exist at the specified path
   1.556 +     *  (due, for instance, to an absolute path generated on another system),
   1.557 +     *  it will check if a file with the same name exists at the root folder
   1.558 +     *  of the imported model. And if so, it uses that.
   1.559 +     */
   1.560 +    aiProcess_EmbedTextures  = 0x10000000,
   1.561 +        
   1.562 +    // aiProcess_GenEntityMeshes = 0x100000,
   1.563 +    // aiProcess_OptimizeAnimations = 0x200000
   1.564 +    // aiProcess_FixTexturePaths = 0x200000
   1.565 +
   1.566 +
   1.567 +    aiProcess_ForceGenNormals = 0x20000000,
   1.568 +
   1.569 +    // -------------------------------------------------------------------------
   1.570 +    /** <hr>Drops normals for all faces of all meshes.
   1.571 +     *
   1.572 +     * This is ignored if no normals are present.
   1.573 +     * Face normals are shared between all points of a single face,
   1.574 +     * so a single point can have multiple normals, which
   1.575 +     * forces the library to duplicate vertices in some cases.
   1.576 +     * #aiProcess_JoinIdenticalVertices is *senseless* then.
   1.577 +     * This process gives sense back to aiProcess_JoinIdenticalVertices
   1.578 +     */
   1.579 +    aiProcess_DropNormals = 0x40000000,
   1.580 +};
   1.581 +
   1.582 +
   1.583 +// ---------------------------------------------------------------------------------------
   1.584 +/** @def aiProcess_ConvertToLeftHanded
   1.585 + *  @brief Shortcut flag for Direct3D-based applications.
   1.586 + *
   1.587 + *  Supersedes the #aiProcess_MakeLeftHanded and #aiProcess_FlipUVs and
   1.588 + *  #aiProcess_FlipWindingOrder flags.
   1.589 + *  The output data matches Direct3D's conventions: left-handed geometry, upper-left
   1.590 + *  origin for UV coordinates and finally clockwise face order, suitable for CCW culling.
   1.591 + *
   1.592 + *  @deprecated
   1.593 + */
   1.594 +#define aiProcess_ConvertToLeftHanded ( \
   1.595 +    aiProcess_MakeLeftHanded     | \
   1.596 +    aiProcess_FlipUVs            | \
   1.597 +    aiProcess_FlipWindingOrder   | \
   1.598 +    0 )
   1.599 +
   1.600 +
   1.601 +// ---------------------------------------------------------------------------------------
   1.602 +/** @def aiProcessPreset_TargetRealtime_Fast
   1.603 + *  @brief Default postprocess configuration optimizing the data for real-time rendering.
   1.604 + *
   1.605 + *  Applications would want to use this preset to load models on end-user PCs,
   1.606 + *  maybe for direct use in game.
   1.607 + *
   1.608 + * If you're using DirectX, don't forget to combine this value with
   1.609 + * the #aiProcess_ConvertToLeftHanded step. If you don't support UV transformations
   1.610 + * in your application apply the #aiProcess_TransformUVCoords step, too.
   1.611 + *  @note Please take the time to read the docs for the steps enabled by this preset.
   1.612 + *  Some of them offer further configurable properties, while some of them might not be of
   1.613 + *  use for you so it might be better to not specify them.
   1.614 + */
   1.615 +#define aiProcessPreset_TargetRealtime_Fast ( \
   1.616 +    aiProcess_CalcTangentSpace      |  \
   1.617 +    aiProcess_GenNormals            |  \
   1.618 +    aiProcess_JoinIdenticalVertices |  \
   1.619 +    aiProcess_Triangulate           |  \
   1.620 +    aiProcess_GenUVCoords           |  \
   1.621 +    aiProcess_SortByPType           |  \
   1.622 +    0 )
   1.623 +
   1.624 + // ---------------------------------------------------------------------------------------
   1.625 + /** @def aiProcessPreset_TargetRealtime_Quality
   1.626 +  *  @brief Default postprocess configuration optimizing the data for real-time rendering.
   1.627 +  *
   1.628 +  *  Unlike #aiProcessPreset_TargetRealtime_Fast, this configuration
   1.629 +  *  performs some extra optimizations to improve rendering speed and
   1.630 +  *  to minimize memory usage. It could be a good choice for a level editor
   1.631 +  *  environment where import speed is not so important.
   1.632 +  *
   1.633 +  *  If you're using DirectX, don't forget to combine this value with
   1.634 +  *  the #aiProcess_ConvertToLeftHanded step. If you don't support UV transformations
   1.635 +  *  in your application apply the #aiProcess_TransformUVCoords step, too.
   1.636 +  *  @note Please take the time to read the docs for the steps enabled by this preset.
   1.637 +  *  Some of them offer further configurable properties, while some of them might not be
   1.638 +  *  of use for you so it might be better to not specify them.
   1.639 +  */
   1.640 +#define aiProcessPreset_TargetRealtime_Quality ( \
   1.641 +    aiProcess_CalcTangentSpace              |  \
   1.642 +    aiProcess_GenSmoothNormals              |  \
   1.643 +    aiProcess_JoinIdenticalVertices         |  \
   1.644 +    aiProcess_ImproveCacheLocality          |  \
   1.645 +    aiProcess_LimitBoneWeights              |  \
   1.646 +    aiProcess_RemoveRedundantMaterials      |  \
   1.647 +    aiProcess_SplitLargeMeshes              |  \
   1.648 +    aiProcess_Triangulate                   |  \
   1.649 +    aiProcess_GenUVCoords                   |  \
   1.650 +    aiProcess_SortByPType                   |  \
   1.651 +    aiProcess_FindDegenerates               |  \
   1.652 +    aiProcess_FindInvalidData               |  \
   1.653 +    0 )
   1.654 +
   1.655 + // ---------------------------------------------------------------------------------------
   1.656 + /** @def aiProcessPreset_TargetRealtime_MaxQuality
   1.657 +  *  @brief Default postprocess configuration optimizing the data for real-time rendering.
   1.658 +  *
   1.659 +  *  This preset enables almost every optimization step to achieve perfectly
   1.660 +  *  optimized data. It's your choice for level editor environments where import speed
   1.661 +  *  is not important.
   1.662 +  *
   1.663 +  *  If you're using DirectX, don't forget to combine this value with
   1.664 +  *  the #aiProcess_ConvertToLeftHanded step. If you don't support UV transformations
   1.665 +  *  in your application, apply the #aiProcess_TransformUVCoords step, too.
   1.666 +  *  @note Please take the time to read the docs for the steps enabled by this preset.
   1.667 +  *  Some of them offer further configurable properties, while some of them might not be
   1.668 +  *  of use for you so it might be better to not specify them.
   1.669 +  */
   1.670 +#define aiProcessPreset_TargetRealtime_MaxQuality ( \
   1.671 +    aiProcessPreset_TargetRealtime_Quality   |  \
   1.672 +    aiProcess_FindInstances                  |  \
   1.673 +    aiProcess_ValidateDataStructure          |  \
   1.674 +    aiProcess_OptimizeMeshes                 |  \
   1.675 +    0 )
   1.676 +
   1.677 +
   1.678 +#ifdef __cplusplus
   1.679 +} // end of extern "C"
   1.680 +#endif
   1.681 +
   1.682 +#endif // AI_POSTPROCESS_H_INC