2008-05-09 17:24:28 +00:00
|
|
|
/*
|
|
|
|
---------------------------------------------------------------------------
|
2008-05-22 10:20:31 +00:00
|
|
|
Open Asset Import Library (ASSIMP)
|
2008-05-09 17:24:28 +00:00
|
|
|
---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
Copyright (c) 2006-2008, ASSIMP Development Team
|
|
|
|
|
|
|
|
All rights reserved.
|
|
|
|
|
|
|
|
Redistribution and use of this software in source and binary forms,
|
|
|
|
with or without modification, are permitted provided that the following
|
|
|
|
conditions are met:
|
|
|
|
|
|
|
|
* Redistributions of source code must retain the above
|
|
|
|
copyright notice, this list of conditions and the
|
|
|
|
following disclaimer.
|
|
|
|
|
|
|
|
* Redistributions in binary form must reproduce the above
|
|
|
|
copyright notice, this list of conditions and the
|
|
|
|
following disclaimer in the documentation and/or other
|
|
|
|
materials provided with the distribution.
|
|
|
|
|
|
|
|
* Neither the name of the ASSIMP team, nor the names of its
|
|
|
|
contributors may be used to endorse or promote products
|
|
|
|
derived from this software without specific prior
|
|
|
|
written permission of the ASSIMP Development Team.
|
|
|
|
|
|
|
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
|
|
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
|
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
|
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
---------------------------------------------------------------------------
|
|
|
|
*/
|
2008-05-05 12:36:31 +00:00
|
|
|
|
2009-01-13 18:58:07 +00:00
|
|
|
/** @file aiMaterial.h
|
|
|
|
* @brief Defines the material system of the library
|
2008-05-05 12:36:31 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef AI_MATERIAL_H_INC
|
|
|
|
#define AI_MATERIAL_H_INC
|
|
|
|
|
|
|
|
#include "aiTypes.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
// Name for default materials (2nd is used if meshes have UV coords)
|
|
|
|
#define AI_DEFAULT_MATERIAL_NAME "DefaultMaterial"
|
|
|
|
#define AI_DEFAULT_TEXTURED_MATERIAL_NAME "TexturedDefaultMaterial"
|
2008-06-22 10:09:26 +00:00
|
|
|
|
2008-05-05 12:36:31 +00:00
|
|
|
// ---------------------------------------------------------------------------
|
2009-01-12 22:06:54 +00:00
|
|
|
/** @brief A very primitive RTTI system to store the data type of a
|
|
|
|
* material property.
|
|
|
|
*/
|
2008-05-05 12:36:31 +00:00
|
|
|
enum aiPropertyTypeInfo
|
|
|
|
{
|
2009-01-12 22:06:54 +00:00
|
|
|
/** Array of single-precision (32 Bit) floats
|
|
|
|
*
|
2009-01-13 18:58:07 +00:00
|
|
|
* It is possible to use aiGetMaterialInteger[Array]() (or the C++-API
|
2009-01-12 22:06:54 +00:00
|
|
|
* aiMaterial::Get()) to query properties stored in floating-point format.
|
|
|
|
* The material system performs the type conversion automatically.
|
2008-06-03 21:50:53 +00:00
|
|
|
*/
|
2009-01-12 22:06:54 +00:00
|
|
|
aiPTI_Float = 0x1,
|
2008-05-05 12:36:31 +00:00
|
|
|
|
2009-01-12 22:06:54 +00:00
|
|
|
/** The material property is an aiString.
|
|
|
|
*
|
|
|
|
* Arrays of strings aren't possible, aiGetMaterialString() (or the
|
|
|
|
* C++-API aiMaterial::Get()) *must* be used to query a string property.
|
2008-06-03 21:50:53 +00:00
|
|
|
*/
|
2009-01-12 22:06:54 +00:00
|
|
|
aiPTI_String = 0x3,
|
2008-05-05 12:36:31 +00:00
|
|
|
|
2009-01-12 22:06:54 +00:00
|
|
|
/** Array of (32 Bit) integers
|
|
|
|
*
|
2009-01-13 18:58:07 +00:00
|
|
|
* It is possible to use aiGetMaterialFloat[Array]() (or the C++-API
|
2009-01-12 22:06:54 +00:00
|
|
|
* aiMaterial::Get()) to query properties stored in integer format.
|
|
|
|
* The material system performs the type conversion automatically.
|
2008-06-03 21:50:53 +00:00
|
|
|
*/
|
|
|
|
aiPTI_Integer = 0x4,
|
2008-05-05 12:36:31 +00:00
|
|
|
|
2009-01-12 22:06:54 +00:00
|
|
|
|
|
|
|
/** Simple binary buffer, content undefined. Not convertible to anything.
|
2009-01-15 17:15:05 +00:00
|
|
|
*/
|
2009-01-12 22:06:54 +00:00
|
|
|
aiPTI_Buffer = 0x5,
|
ASE: Added WIP support for *SMOOTHSKINMESH elements in ASE/ASC files. Fixes in the ASE loader. Fixed animation parsing. Temporary implementation of target lights and cameras, including animations.
3DS: Fixed transformation problems (Pivot points), added WIP animation support. No target animation yet (cameras, spot lights). Not yet fully tested, but static models that worked before should still work now, except all look correct now :-) (some problems with very large models remaining)
Further work on the IRR and IRRMESH loaders. IRR still WIP, IRRMESH more stable now.
Work on the LWo loader. Added support for the "one-layer-only" mode. Hierarchy bug still unfixed, UV coords bug still unfixed.
Further work on the FindInvalidDataprocess. Improved validation for normals, no false positives anymore.
Further work on the MDR loader, still WIP.
Moved DeterminePType-Step to ScenePreprocessor.
aiAnimation::mDuration is optional now, ScenePreprocessor computes it automatically if set to -1.
Fixes in the SMD loader. Still crashes on some files.
Updated animation documentation.
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@236 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2008-11-09 23:17:19 +00:00
|
|
|
|
|
|
|
|
2009-01-15 17:15:05 +00:00
|
|
|
/** This value is not used. It is just there to force the
|
ASE: Added WIP support for *SMOOTHSKINMESH elements in ASE/ASC files. Fixes in the ASE loader. Fixed animation parsing. Temporary implementation of target lights and cameras, including animations.
3DS: Fixed transformation problems (Pivot points), added WIP animation support. No target animation yet (cameras, spot lights). Not yet fully tested, but static models that worked before should still work now, except all look correct now :-) (some problems with very large models remaining)
Further work on the IRR and IRRMESH loaders. IRR still WIP, IRRMESH more stable now.
Work on the LWo loader. Added support for the "one-layer-only" mode. Hierarchy bug still unfixed, UV coords bug still unfixed.
Further work on the FindInvalidDataprocess. Improved validation for normals, no false positives anymore.
Further work on the MDR loader, still WIP.
Moved DeterminePType-Step to ScenePreprocessor.
aiAnimation::mDuration is optional now, ScenePreprocessor computes it automatically if set to -1.
Fixes in the SMD loader. Still crashes on some files.
Updated animation documentation.
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@236 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2008-11-09 23:17:19 +00:00
|
|
|
* compiler to map this enum to a 32 Bit integer.
|
|
|
|
*/
|
|
|
|
_aiPTI_Force32Bit = 0x9fffffff
|
2009-01-15 17:15:05 +00:00
|
|
|
};
|
2008-05-05 12:36:31 +00:00
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
2009-02-15 20:29:07 +00:00
|
|
|
/** @brief Defines how the Nth texture of a specific type is combined with
|
|
|
|
* the result of all previous layers.
|
2009-01-12 22:06:54 +00:00
|
|
|
*
|
|
|
|
* Example (left: key, right: value): <br>
|
|
|
|
* @code
|
|
|
|
* DiffColor0 - gray
|
|
|
|
* DiffTextureOp0 - aiTextureOpMultiply
|
|
|
|
* DiffTexture0 - tex1.png
|
|
|
|
* DiffTextureOp0 - aiTextureOpAdd
|
|
|
|
* DiffTexture1 - tex2.png
|
|
|
|
* @endcode
|
|
|
|
* Written as equation, the final diffuse term for a specific pixel would be:
|
|
|
|
* @code
|
|
|
|
* diffFinal = DiffColor0 * sampleTex(DiffTexture0,UV0) +
|
|
|
|
* sampleTex(DiffTexture1,UV0) * diffContrib;
|
|
|
|
* @endcode
|
|
|
|
* where 'diffContrib' is the intensity of the incoming light for that pixel.
|
|
|
|
*/
|
2008-05-09 17:24:28 +00:00
|
|
|
enum aiTextureOp
|
2008-05-05 12:36:31 +00:00
|
|
|
{
|
2009-02-11 20:56:05 +00:00
|
|
|
/** T = T1 * T2 */
|
|
|
|
aiTextureOp_Multiply = 0x0,
|
2008-05-05 12:36:31 +00:00
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
/** T = T1 + T2 */
|
|
|
|
aiTextureOp_Add = 0x1,
|
2008-05-05 12:36:31 +00:00
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
/** T = T1 - T2 */
|
|
|
|
aiTextureOp_Subtract = 0x2,
|
2008-05-05 12:36:31 +00:00
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
/** T = T1 / T2 */
|
|
|
|
aiTextureOp_Divide = 0x3,
|
2008-05-05 12:36:31 +00:00
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
/** T = (T1 + T2) - (T1 * T2) */
|
|
|
|
aiTextureOp_SmoothAdd = 0x4,
|
2008-05-05 12:36:31 +00:00
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
/** T = T1 + (T2-0.5) */
|
|
|
|
aiTextureOp_SignedAdd = 0x5,
|
ASE: Added WIP support for *SMOOTHSKINMESH elements in ASE/ASC files. Fixes in the ASE loader. Fixed animation parsing. Temporary implementation of target lights and cameras, including animations.
3DS: Fixed transformation problems (Pivot points), added WIP animation support. No target animation yet (cameras, spot lights). Not yet fully tested, but static models that worked before should still work now, except all look correct now :-) (some problems with very large models remaining)
Further work on the IRR and IRRMESH loaders. IRR still WIP, IRRMESH more stable now.
Work on the LWo loader. Added support for the "one-layer-only" mode. Hierarchy bug still unfixed, UV coords bug still unfixed.
Further work on the FindInvalidDataprocess. Improved validation for normals, no false positives anymore.
Further work on the MDR loader, still WIP.
Moved DeterminePType-Step to ScenePreprocessor.
aiAnimation::mDuration is optional now, ScenePreprocessor computes it automatically if set to -1.
Fixes in the SMD loader. Still crashes on some files.
Updated animation documentation.
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@236 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2008-11-09 23:17:19 +00:00
|
|
|
|
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
/** @cond never
|
|
|
|
* This value is not used. It forces the compiler to use at least
|
|
|
|
* 32 Bit integers to represent this enum.
|
ASE: Added WIP support for *SMOOTHSKINMESH elements in ASE/ASC files. Fixes in the ASE loader. Fixed animation parsing. Temporary implementation of target lights and cameras, including animations.
3DS: Fixed transformation problems (Pivot points), added WIP animation support. No target animation yet (cameras, spot lights). Not yet fully tested, but static models that worked before should still work now, except all look correct now :-) (some problems with very large models remaining)
Further work on the IRR and IRRMESH loaders. IRR still WIP, IRRMESH more stable now.
Work on the LWo loader. Added support for the "one-layer-only" mode. Hierarchy bug still unfixed, UV coords bug still unfixed.
Further work on the FindInvalidDataprocess. Improved validation for normals, no false positives anymore.
Further work on the MDR loader, still WIP.
Moved DeterminePType-Step to ScenePreprocessor.
aiAnimation::mDuration is optional now, ScenePreprocessor computes it automatically if set to -1.
Fixes in the SMD loader. Still crashes on some files.
Updated animation documentation.
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@236 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2008-11-09 23:17:19 +00:00
|
|
|
*/
|
|
|
|
_aiTextureOp_Force32Bit = 0x9fffffff
|
2009-02-11 20:56:05 +00:00
|
|
|
//! @endcond
|
2009-01-15 17:15:05 +00:00
|
|
|
};
|
2008-06-03 21:50:53 +00:00
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
2009-01-12 22:06:54 +00:00
|
|
|
/** @brief Defines how UV coordinates outside the [0...1] range are handled.
|
|
|
|
*
|
2009-02-11 20:56:05 +00:00
|
|
|
* Commonly refered to as 'wrapping mode'.
|
2009-01-12 22:06:54 +00:00
|
|
|
*/
|
2008-06-03 21:50:53 +00:00
|
|
|
enum aiTextureMapMode
|
|
|
|
{
|
|
|
|
/** A texture coordinate u|v is translated to u%1|v%1
|
2009-02-11 20:56:05 +00:00
|
|
|
*/
|
2008-06-03 21:50:53 +00:00
|
|
|
aiTextureMapMode_Wrap = 0x0,
|
|
|
|
|
2008-11-16 21:56:45 +00:00
|
|
|
/** Texture coordinates outside [0...1]
|
2009-02-11 20:56:05 +00:00
|
|
|
* are clamped to the nearest valid value.
|
|
|
|
*/
|
2008-06-03 21:50:53 +00:00
|
|
|
aiTextureMapMode_Clamp = 0x1,
|
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
/** If the texture coordinates for a pixel are outside [0...1]
|
2009-01-15 17:15:05 +00:00
|
|
|
* the texture is not applied to that pixel
|
2009-02-11 20:56:05 +00:00
|
|
|
*/
|
2008-11-16 21:56:45 +00:00
|
|
|
aiTextureMapMode_Decal = 0x3,
|
|
|
|
|
2008-06-03 21:50:53 +00:00
|
|
|
/** A texture coordinate u|v becomes u%1|v%1 if (u-(u%1))%2 is zero and
|
2009-02-11 20:56:05 +00:00
|
|
|
* 1-(u%1)|1-(v%1) otherwise
|
|
|
|
*/
|
ASE: Added WIP support for *SMOOTHSKINMESH elements in ASE/ASC files. Fixes in the ASE loader. Fixed animation parsing. Temporary implementation of target lights and cameras, including animations.
3DS: Fixed transformation problems (Pivot points), added WIP animation support. No target animation yet (cameras, spot lights). Not yet fully tested, but static models that worked before should still work now, except all look correct now :-) (some problems with very large models remaining)
Further work on the IRR and IRRMESH loaders. IRR still WIP, IRRMESH more stable now.
Work on the LWo loader. Added support for the "one-layer-only" mode. Hierarchy bug still unfixed, UV coords bug still unfixed.
Further work on the FindInvalidDataprocess. Improved validation for normals, no false positives anymore.
Further work on the MDR loader, still WIP.
Moved DeterminePType-Step to ScenePreprocessor.
aiAnimation::mDuration is optional now, ScenePreprocessor computes it automatically if set to -1.
Fixes in the SMD loader. Still crashes on some files.
Updated animation documentation.
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@236 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2008-11-09 23:17:19 +00:00
|
|
|
aiTextureMapMode_Mirror = 0x2,
|
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
/** @cond never
|
|
|
|
* This value is not used. It forces the compiler to use at least
|
|
|
|
* 32 Bit integers to represent this enum.
|
|
|
|
*/
|
ASE: Added WIP support for *SMOOTHSKINMESH elements in ASE/ASC files. Fixes in the ASE loader. Fixed animation parsing. Temporary implementation of target lights and cameras, including animations.
3DS: Fixed transformation problems (Pivot points), added WIP animation support. No target animation yet (cameras, spot lights). Not yet fully tested, but static models that worked before should still work now, except all look correct now :-) (some problems with very large models remaining)
Further work on the IRR and IRRMESH loaders. IRR still WIP, IRRMESH more stable now.
Work on the LWo loader. Added support for the "one-layer-only" mode. Hierarchy bug still unfixed, UV coords bug still unfixed.
Further work on the FindInvalidDataprocess. Improved validation for normals, no false positives anymore.
Further work on the MDR loader, still WIP.
Moved DeterminePType-Step to ScenePreprocessor.
aiAnimation::mDuration is optional now, ScenePreprocessor computes it automatically if set to -1.
Fixes in the SMD loader. Still crashes on some files.
Updated animation documentation.
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@236 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2008-11-09 23:17:19 +00:00
|
|
|
_aiTextureMapMode_Force32Bit = 0x9fffffff
|
2009-02-11 20:56:05 +00:00
|
|
|
//! @endcond
|
2009-01-15 17:15:05 +00:00
|
|
|
};
|
2008-05-05 12:36:31 +00:00
|
|
|
|
2008-11-16 21:56:45 +00:00
|
|
|
// ---------------------------------------------------------------------------
|
2009-01-12 22:06:54 +00:00
|
|
|
/** @brief Defines how the mapping coords for a texture are generated.
|
|
|
|
*
|
2009-01-15 17:15:05 +00:00
|
|
|
* Real-time applications typically require full UV coordinates, so the use of
|
2009-01-12 22:06:54 +00:00
|
|
|
* the aiProcess_GenUVCoords step is highly recommended. It generates proper
|
|
|
|
* UV channels for non-UV mapped objects, as long as an accurate description
|
|
|
|
* how the mapping should look like (e.g spherical) is given.
|
2009-01-15 17:15:05 +00:00
|
|
|
* See the #AI_MATKEY_MAPPING property for more details.
|
2009-01-12 22:06:54 +00:00
|
|
|
*/
|
2008-11-16 21:56:45 +00:00
|
|
|
enum aiTextureMapping
|
|
|
|
{
|
|
|
|
/** The mapping coordinates are taken from an UV channel.
|
|
|
|
*
|
2009-02-11 20:56:05 +00:00
|
|
|
* The #AI_MATKEY_UVWSRC key specifies from which UV channel
|
|
|
|
* the texture coordinates are to be taken from (remember,
|
2008-11-16 21:56:45 +00:00
|
|
|
* meshes can have more than one UV channel).
|
2009-01-15 17:15:05 +00:00
|
|
|
*/
|
2009-02-11 20:56:05 +00:00
|
|
|
aiTextureMapping_UV = 0x0,
|
2008-11-16 21:56:45 +00:00
|
|
|
|
2009-01-15 17:15:05 +00:00
|
|
|
/** Spherical mapping */
|
2008-11-16 21:56:45 +00:00
|
|
|
aiTextureMapping_SPHERE = 0x1,
|
|
|
|
|
2009-01-15 17:15:05 +00:00
|
|
|
/** Cylindrical mapping */
|
2008-11-16 21:56:45 +00:00
|
|
|
aiTextureMapping_CYLINDER = 0x2,
|
|
|
|
|
2009-01-15 17:15:05 +00:00
|
|
|
/** Cubic mapping */
|
2008-11-16 21:56:45 +00:00
|
|
|
aiTextureMapping_BOX = 0x3,
|
|
|
|
|
2009-01-15 17:15:05 +00:00
|
|
|
/** Planar mapping */
|
2008-11-16 21:56:45 +00:00
|
|
|
aiTextureMapping_PLANE = 0x4,
|
|
|
|
|
2009-01-15 17:15:05 +00:00
|
|
|
/** Undefined mapping. Have fun. */
|
2008-11-16 21:56:45 +00:00
|
|
|
aiTextureMapping_OTHER = 0x5,
|
|
|
|
|
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
/** @cond never
|
|
|
|
* This value is not used. It forces the compiler to use at least
|
|
|
|
* 32 Bit integers to represent this enum.
|
|
|
|
*/
|
2008-11-16 21:56:45 +00:00
|
|
|
_aiTextureMapping_Force32Bit = 0x9fffffff
|
2009-02-11 20:56:05 +00:00
|
|
|
//! @endcond
|
2009-01-15 17:15:05 +00:00
|
|
|
};
|
2008-11-16 21:56:45 +00:00
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
2009-02-11 20:56:05 +00:00
|
|
|
/** @brief Defines the purpose of a texture
|
2008-11-16 21:56:45 +00:00
|
|
|
*
|
2009-02-11 20:56:05 +00:00
|
|
|
* This is a very difficult topic. Different 3D packages support different
|
|
|
|
* kinds of textures. For very common texture types, such as bumpmaps, the
|
|
|
|
* rendering results depend on implementation details in the rendering
|
|
|
|
* pipelines of these applications. Assimp loads all texture references from
|
|
|
|
* the model file and tries to determine which of the predefined texture
|
|
|
|
* types below is the best choice to match the original use of the texture
|
|
|
|
* as closely as possible.<br>
|
|
|
|
*
|
|
|
|
* In content pipelines you'll usually define how textures have to be handled,
|
|
|
|
* and the artists working on models have to conform to this specification,
|
|
|
|
* regardless which 3D tool they're using.
|
|
|
|
*/
|
2008-11-16 21:56:45 +00:00
|
|
|
enum aiTextureType
|
|
|
|
{
|
2009-02-11 20:56:05 +00:00
|
|
|
/** Dummy value.
|
|
|
|
*
|
|
|
|
* No texture, but the value to be used as 'texture semantic'
|
|
|
|
* (#aiMaterialProperty::mSemantic) for all material properties
|
|
|
|
* *not* related to textures.
|
|
|
|
*/
|
2009-02-08 22:55:51 +00:00
|
|
|
aiTextureType_NONE = 0x0,
|
|
|
|
|
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
|
2008-11-16 21:56:45 +00:00
|
|
|
/** The texture is combined with the result of the diffuse
|
|
|
|
* lighting equation.
|
2009-02-11 20:56:05 +00:00
|
|
|
*/
|
2009-02-08 22:55:51 +00:00
|
|
|
aiTextureType_DIFFUSE = 0x1,
|
2008-11-16 21:56:45 +00:00
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
/** The texture is combined with the result of the specular
|
2008-11-16 21:56:45 +00:00
|
|
|
* lighting equation.
|
2009-02-11 20:56:05 +00:00
|
|
|
*/
|
2009-02-08 22:55:51 +00:00
|
|
|
aiTextureType_SPECULAR = 0x2,
|
2008-11-16 21:56:45 +00:00
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
/** The texture is combined with the result of the ambient
|
2008-11-16 21:56:45 +00:00
|
|
|
* lighting equation.
|
2009-02-11 20:56:05 +00:00
|
|
|
*/
|
2009-02-08 22:55:51 +00:00
|
|
|
aiTextureType_AMBIENT = 0x3,
|
2008-11-16 21:56:45 +00:00
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
/** The texture is added to the result of the lighting
|
|
|
|
* calculation. It isn't influenced by incoming light.
|
|
|
|
*/
|
2009-02-08 22:55:51 +00:00
|
|
|
aiTextureType_EMISSIVE = 0x4,
|
2008-11-16 21:56:45 +00:00
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
/** The texture is a height map.
|
|
|
|
*
|
|
|
|
* By convention, higher grey-scale values stand for
|
|
|
|
* higher elevations from the base height.
|
|
|
|
*/
|
2009-02-08 22:55:51 +00:00
|
|
|
aiTextureType_HEIGHT = 0x5,
|
2008-11-16 21:56:45 +00:00
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
/** The texture is a (tangent space) normal-map.
|
2008-11-16 21:56:45 +00:00
|
|
|
*
|
2009-02-11 20:56:05 +00:00
|
|
|
* Again, there are several conventions for tangent-space
|
|
|
|
* normal maps. Assimp does (intentionally) not
|
|
|
|
* differenciate here.
|
|
|
|
*/
|
2009-02-08 22:55:51 +00:00
|
|
|
aiTextureType_NORMALS = 0x6,
|
2008-11-16 21:56:45 +00:00
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
/** The texture defines the glossiness of the material.
|
2008-11-16 21:56:45 +00:00
|
|
|
*
|
|
|
|
* The glossiness is in fact the exponent of the specular
|
2009-02-11 20:56:05 +00:00
|
|
|
* (phong) lighting equation. Usually there is a conversion
|
|
|
|
* function defined to map the linear color values in the
|
2008-11-16 21:56:45 +00:00
|
|
|
* texture to a suitable exponent. Have fun.
|
2009-01-15 17:15:05 +00:00
|
|
|
*/
|
2009-02-08 22:55:51 +00:00
|
|
|
aiTextureType_SHININESS = 0x7,
|
2008-11-16 21:56:45 +00:00
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
/** The texture defines per-pixel opacity.
|
2008-11-16 21:56:45 +00:00
|
|
|
*
|
2009-02-11 20:56:05 +00:00
|
|
|
* Usually 'white' means opaque and 'black' means
|
2008-11-16 21:56:45 +00:00
|
|
|
* 'transparency'. Or quite the opposite. Have fun.
|
2009-01-15 17:15:05 +00:00
|
|
|
*/
|
2009-02-08 22:55:51 +00:00
|
|
|
aiTextureType_OPACITY = 0x8,
|
2008-11-16 21:56:45 +00:00
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
/** Displacement texture
|
|
|
|
*
|
|
|
|
* The exact purpose and format is application-dependent.
|
|
|
|
* Higher color values stand for higher vertex displacements.
|
|
|
|
*/
|
|
|
|
aiTextureType_DISPLACEMENT = 0x9,
|
|
|
|
|
|
|
|
/** Lightmap texture (aka Ambient Occlusion)
|
|
|
|
*
|
|
|
|
* Both 'Lightmaps' and dedicated 'ambient occlusion maps' are
|
|
|
|
* covered by this material property. The texture contains a
|
|
|
|
* scaling value for the final color value of a pixel. It's
|
|
|
|
* intensity is not affected by incoming light.
|
|
|
|
*/
|
|
|
|
aiTextureType_LIGHTMAP = 0xA,
|
|
|
|
|
|
|
|
/** Reflection texture
|
|
|
|
*
|
|
|
|
* Contains the color of a perfect mirror reflection.
|
|
|
|
* Rarely used, almost nevery for real-time applications.
|
|
|
|
*/
|
|
|
|
aiTextureType_REFLECTION = 0xB,
|
2008-11-16 21:56:45 +00:00
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
/** Unknown texture
|
|
|
|
*
|
|
|
|
* A texture reference that does not match any of the definitions
|
|
|
|
* above is considered to be 'unknown'. It is still imported,
|
|
|
|
* but is excluded from any further postprocessing.
|
|
|
|
*/
|
|
|
|
aiTextureType_UNKNOWN = 0xC,
|
|
|
|
|
|
|
|
|
|
|
|
/** @cond never
|
|
|
|
* This value is not used. It forces the compiler to use at least
|
|
|
|
* 32 Bit integers to represent this enum.
|
2009-02-08 22:55:51 +00:00
|
|
|
*/
|
2008-11-16 21:56:45 +00:00
|
|
|
_aiTextureType_Force32Bit = 0x9fffffff
|
2009-02-11 20:56:05 +00:00
|
|
|
//! @endcond
|
2009-01-15 17:15:05 +00:00
|
|
|
};
|
2008-11-16 21:56:45 +00:00
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
#define AI_TEXTURE_TYPE_MAX aiTextureType_UNKNOWN
|
|
|
|
|
2008-05-05 12:36:31 +00:00
|
|
|
// ---------------------------------------------------------------------------
|
2009-01-12 22:06:54 +00:00
|
|
|
/** @brief Defines all shading models supported by the library
|
|
|
|
*
|
2009-02-11 20:56:05 +00:00
|
|
|
* The list of shading modes has been taken from Blender.
|
|
|
|
* See Blender documentation for more information. The API does
|
2009-01-12 22:06:54 +00:00
|
|
|
* not distinguish between "specular" and "diffuse" shaders (thus the
|
|
|
|
* specular term for diffuse shading models like Oren-Nayar remains
|
2009-02-11 20:56:05 +00:00
|
|
|
* undefined). <br>
|
|
|
|
* Again, this value is just a hint. Assimp tries to select the shader whose
|
|
|
|
* most common implementation matches the original rendering results of the
|
|
|
|
* 3D modeller which wrote a particular model as closely as possible.
|
2009-01-12 22:06:54 +00:00
|
|
|
*/
|
2008-05-05 12:36:31 +00:00
|
|
|
enum aiShadingMode
|
|
|
|
{
|
2008-06-03 21:50:53 +00:00
|
|
|
/** Flat shading. Shading is done on per-face base,
|
2009-02-11 20:56:05 +00:00
|
|
|
* diffuse only. Also known as 'faceted shading'.
|
|
|
|
*/
|
2008-06-03 21:50:53 +00:00
|
|
|
aiShadingMode_Flat = 0x1,
|
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
/** Simple Gouraud shading.
|
|
|
|
*/
|
2008-06-03 21:50:53 +00:00
|
|
|
aiShadingMode_Gouraud = 0x2,
|
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
/** Phong-Shading -
|
|
|
|
*/
|
2008-06-03 21:50:53 +00:00
|
|
|
aiShadingMode_Phong = 0x3,
|
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
/** Phong-Blinn-Shading
|
|
|
|
*/
|
2008-06-03 21:50:53 +00:00
|
|
|
aiShadingMode_Blinn = 0x4,
|
|
|
|
|
|
|
|
/** Toon-Shading per pixel
|
2009-02-11 20:56:05 +00:00
|
|
|
*
|
|
|
|
* Also known as 'comic' shader.
|
|
|
|
*/
|
2008-06-03 21:50:53 +00:00
|
|
|
aiShadingMode_Toon = 0x5,
|
|
|
|
|
|
|
|
/** OrenNayar-Shading per pixel
|
2009-02-11 20:56:05 +00:00
|
|
|
*
|
|
|
|
* Extension to standard Lambertian shading, taking the
|
|
|
|
* roughness of the material into account
|
|
|
|
*/
|
2008-06-03 21:50:53 +00:00
|
|
|
aiShadingMode_OrenNayar = 0x6,
|
|
|
|
|
|
|
|
/** Minnaert-Shading per pixel
|
2009-02-11 20:56:05 +00:00
|
|
|
*
|
|
|
|
* Extension to standard Lambertian shading, taking the
|
|
|
|
* "darkness" of the material into account
|
|
|
|
*/
|
2008-06-03 21:50:53 +00:00
|
|
|
aiShadingMode_Minnaert = 0x7,
|
|
|
|
|
|
|
|
/** CookTorrance-Shading per pixel
|
2009-02-11 20:56:05 +00:00
|
|
|
*
|
|
|
|
* Special shader for metallic surfaces.
|
|
|
|
*/
|
2008-06-03 21:50:53 +00:00
|
|
|
aiShadingMode_CookTorrance = 0x8,
|
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
/** No shading at all. Constant light influence of 1.0.
|
2008-06-03 21:50:53 +00:00
|
|
|
*/
|
2008-09-20 15:55:51 +00:00
|
|
|
aiShadingMode_NoShading = 0x9,
|
|
|
|
|
2009-01-15 17:15:05 +00:00
|
|
|
/** Fresnel shading
|
2009-02-11 20:56:05 +00:00
|
|
|
*/
|
ASE: Added WIP support for *SMOOTHSKINMESH elements in ASE/ASC files. Fixes in the ASE loader. Fixed animation parsing. Temporary implementation of target lights and cameras, including animations.
3DS: Fixed transformation problems (Pivot points), added WIP animation support. No target animation yet (cameras, spot lights). Not yet fully tested, but static models that worked before should still work now, except all look correct now :-) (some problems with very large models remaining)
Further work on the IRR and IRRMESH loaders. IRR still WIP, IRRMESH more stable now.
Work on the LWo loader. Added support for the "one-layer-only" mode. Hierarchy bug still unfixed, UV coords bug still unfixed.
Further work on the FindInvalidDataprocess. Improved validation for normals, no false positives anymore.
Further work on the MDR loader, still WIP.
Moved DeterminePType-Step to ScenePreprocessor.
aiAnimation::mDuration is optional now, ScenePreprocessor computes it automatically if set to -1.
Fixes in the SMD loader. Still crashes on some files.
Updated animation documentation.
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@236 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2008-11-09 23:17:19 +00:00
|
|
|
aiShadingMode_Fresnel = 0xa,
|
|
|
|
|
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
/** @cond never
|
|
|
|
* This value is not used. It forces the compiler to use at least
|
|
|
|
* 32 Bit integers to represent this enum.
|
|
|
|
*/
|
ASE: Added WIP support for *SMOOTHSKINMESH elements in ASE/ASC files. Fixes in the ASE loader. Fixed animation parsing. Temporary implementation of target lights and cameras, including animations.
3DS: Fixed transformation problems (Pivot points), added WIP animation support. No target animation yet (cameras, spot lights). Not yet fully tested, but static models that worked before should still work now, except all look correct now :-) (some problems with very large models remaining)
Further work on the IRR and IRRMESH loaders. IRR still WIP, IRRMESH more stable now.
Work on the LWo loader. Added support for the "one-layer-only" mode. Hierarchy bug still unfixed, UV coords bug still unfixed.
Further work on the FindInvalidDataprocess. Improved validation for normals, no false positives anymore.
Further work on the MDR loader, still WIP.
Moved DeterminePType-Step to ScenePreprocessor.
aiAnimation::mDuration is optional now, ScenePreprocessor computes it automatically if set to -1.
Fixes in the SMD loader. Still crashes on some files.
Updated animation documentation.
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@236 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2008-11-09 23:17:19 +00:00
|
|
|
_aiShadingMode_Force32Bit = 0x9fffffff
|
2009-02-11 20:56:05 +00:00
|
|
|
//! @endcond
|
2009-01-15 17:15:05 +00:00
|
|
|
};
|
2008-05-05 12:36:31 +00:00
|
|
|
|
2009-02-08 22:55:51 +00:00
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
2009-02-11 20:56:05 +00:00
|
|
|
/** @brief Defines some mixed flags for a particular texture.
|
2009-02-08 22:55:51 +00:00
|
|
|
*
|
2009-02-15 20:29:07 +00:00
|
|
|
* Usually you'll tell your cg artists how textures have to look like ...
|
|
|
|
* and hopefully the follow these rules. If they don't, restrict access
|
|
|
|
* to the coffee machine for them. That should help.
|
|
|
|
* However, if you use Assimp for completely generic loading purposes you
|
2009-02-11 20:56:05 +00:00
|
|
|
* might also need to process these flags in order to display as many
|
|
|
|
* 'unknown' 3D models as possible correctly.
|
|
|
|
*
|
|
|
|
* This corresponds to the #AI_MATKEY_TEXFLAGS property.
|
2009-02-08 22:55:51 +00:00
|
|
|
*/
|
|
|
|
enum aiTextureFlags
|
|
|
|
{
|
|
|
|
/** The texture's color values have to be inverted (componentwise 1-n)
|
|
|
|
*/
|
|
|
|
aiTextureFlags_Invert = 0x1,
|
|
|
|
|
|
|
|
|
2009-02-15 20:29:07 +00:00
|
|
|
/** Explicit request to the application to process the alpha channel
|
|
|
|
* of the texture.
|
|
|
|
*
|
|
|
|
* Mutually exclusive with #aiTextureFlags_IgnoreAlpha. These
|
|
|
|
* flags are set if the library can say for sure that the alpha
|
|
|
|
* channel is used/is not used. If the model format does not
|
|
|
|
* define this, it is left to the application to decide whether
|
|
|
|
* the texture alpha channel - if any - is evaluated or not.
|
|
|
|
*/
|
|
|
|
aiTextureFlags_UseAlpha = 0x2,
|
|
|
|
|
|
|
|
/** Explicit request to the application to ignore the alpha channel
|
|
|
|
* of the texture.
|
|
|
|
*
|
|
|
|
* Mutually exclusive with #aiTextureFlags_IgnoreAlpha.
|
|
|
|
*/
|
|
|
|
aiTextureFlags_IgnoreAlpha = 0x4,
|
|
|
|
|
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
|
|
|
|
/** @cond never
|
|
|
|
* This value is not used. It forces the compiler to use at least
|
|
|
|
* 32 Bit integers to represent this enum.
|
|
|
|
*/
|
2009-02-08 22:55:51 +00:00
|
|
|
_aiTextureFlags_Force32Bit = 0x9fffffff
|
2009-02-11 20:56:05 +00:00
|
|
|
//! @endcond
|
2009-02-08 22:55:51 +00:00
|
|
|
};
|
|
|
|
|
2009-02-13 22:03:57 +00:00
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
/** @brief Defines alpha-blend flags.
|
|
|
|
*
|
|
|
|
* If you're familiar with OpenGL or D3D, these flags aren't new to you.
|
|
|
|
* The define *how* the final color value of a pixel is computed, basing
|
|
|
|
* on the previous color at that pixel and the new color value from the
|
|
|
|
* material.
|
|
|
|
* The blend formula is:
|
|
|
|
* @code
|
|
|
|
* SourceColor * SourceBlend + DestColor * DestBlend
|
|
|
|
* @endcode
|
|
|
|
* where <DestColor> is the previous color in the framebuffer at this
|
|
|
|
* position and <SourceColor> is the material colro before the transparency
|
|
|
|
* calculation.<br>
|
|
|
|
* This corresponds to the #AI_MATKEY_BLEND_FUNC property.
|
|
|
|
*/
|
|
|
|
enum aiBlendMode
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Formula:
|
|
|
|
* @code
|
|
|
|
* SourceColor*SourceAlpha + DestColor*(1-SourceAlpha)
|
|
|
|
* @endcode
|
|
|
|
*/
|
|
|
|
aiBlendMode_Default = 0x0,
|
|
|
|
|
|
|
|
/** Additive blending
|
|
|
|
*
|
|
|
|
* Formula:
|
|
|
|
* @code
|
|
|
|
* SourceColor*1 + DestColor*1
|
|
|
|
* @endcode
|
|
|
|
*/
|
|
|
|
aiBlendMode_Additive = 0x1,
|
|
|
|
|
|
|
|
// we don't need more for the moment, but we might need them
|
|
|
|
// in future versions ...
|
|
|
|
|
|
|
|
/** @cond never
|
|
|
|
* This value is not used. It forces the compiler to use at least
|
|
|
|
* 32 Bit integers to represent this enum.
|
|
|
|
*/
|
|
|
|
_aiBlendMode_Force32Bit = 0x9fffffff
|
|
|
|
//! @endcond
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-11-16 21:56:45 +00:00
|
|
|
#include "./Compiler/pushpack1.h"
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
2009-01-12 22:06:54 +00:00
|
|
|
/** @brief Defines how an UV channel is transformed.
|
|
|
|
*
|
2009-01-15 17:15:05 +00:00
|
|
|
* This is just a helper structure for the #AI_MATKEY_UVTRANSFORM key.
|
2009-01-12 22:06:54 +00:00
|
|
|
* See its documentation for more details.
|
|
|
|
*
|
|
|
|
* Typically you'll want to build a matrix of this information. However,
|
|
|
|
* we keep separate scaling/translation/rotation values to make it
|
|
|
|
* easier to process and optimize UV transformations internally.
|
|
|
|
*/
|
2008-11-16 21:56:45 +00:00
|
|
|
struct aiUVTransform
|
|
|
|
{
|
2009-02-11 20:56:05 +00:00
|
|
|
/** Translation on the u and v axes.
|
|
|
|
*
|
|
|
|
* The default value is (0|0).
|
|
|
|
*/
|
2009-01-12 22:06:54 +00:00
|
|
|
C_STRUCT aiVector2D mTranslation;
|
2008-11-16 21:56:45 +00:00
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
/** Scaling on the u and v axes.
|
|
|
|
*
|
|
|
|
* The default value is (1|1).
|
|
|
|
*/
|
2009-01-12 22:06:54 +00:00
|
|
|
C_STRUCT aiVector2D mScaling;
|
2008-11-16 21:56:45 +00:00
|
|
|
|
|
|
|
/** Rotation - in counter-clockwise direction.
|
2009-02-11 20:56:05 +00:00
|
|
|
*
|
|
|
|
* The rotation angle is specified in radians. The
|
|
|
|
* rotation center is 0.5f|0.5f. The default value
|
|
|
|
* 0.f.
|
|
|
|
*/
|
2008-11-16 21:56:45 +00:00
|
|
|
float mRotation;
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
aiUVTransform()
|
|
|
|
: mScaling (1.f,1.f)
|
|
|
|
, mRotation (0.f)
|
|
|
|
{
|
|
|
|
// nothing to be done here ...
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2009-01-15 17:15:05 +00:00
|
|
|
} PACK_STRUCT;
|
2008-11-16 21:56:45 +00:00
|
|
|
|
|
|
|
#include "./Compiler/poppack1.h"
|
2008-05-05 12:36:31 +00:00
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
2009-01-12 22:06:54 +00:00
|
|
|
/** @brief Data structure for a single material property
|
2009-02-15 20:29:07 +00:00
|
|
|
*
|
|
|
|
* As an user, you'll probably never need to deal with this data structure.
|
|
|
|
* Just use the provided aiGetMaterialXXX() or aiMaterial::Get() family
|
|
|
|
* of functions to query material properties easily. Processing them
|
|
|
|
* manually is faster, but it is not the recommended way. It isn't worth
|
|
|
|
* the effort. <br>
|
|
|
|
* Material property names follow a simple scheme:
|
|
|
|
* @code
|
|
|
|
* $<name>
|
|
|
|
* ?<name>
|
|
|
|
* A public property, there must be corresponding AI_MATKEY_XXX define
|
|
|
|
* 2nd: Public, but ignored by the #aiProcess_RemoveRedundantMaterials
|
|
|
|
* post-processing step.
|
|
|
|
* ~<name>
|
|
|
|
* A temporary property for internal use. If someone forgets to
|
|
|
|
* cleanup, some of these might still be contained in the output.
|
General
- Added format auto-detection to most loaders
- Simplified BaseImporter::CanRead() with some utility methods
- improved fast_atof -> no overruns anymore. Fuck you, irrlicht.
- added assimp_cmd tool to allow command line model processing. Mainly adebugging tool for internal purposes, but others might find it useful, too.
- vc8/vc9: revision number is now written to DLL version header
- mkutil: some batch scripts to simplify tagging & building of release versions
- some API cleanup
- fixing some doxygen markup (+now explicit use of @file <filename>)
- Icon for assimp_view and assimp_cmd
3DS
- Normal vectors are not anymore inverted in some cases
- Improved pivot handling
- Improved handling of x-flipped meshes
Collada
- fixed a minor bug (visual_scene element)
LWS
- WIP implementation. No animations yet, some bugs and crashes.
- Animation system remains disabled, WIP code
- many test files for LWS, but most of them test the anim support, which is, read above, currently disabled.
STL
- fixing a log warning which appears for every model
- added binary&ascii test spider, exported from truespace
MD3
- Cleaning up output tags for automatically joined player models.
IRR
- Fixing coordinate system issues.
- Instance handling improved.
- Some of the reported crashes not yet fixed.
PretransformVertices
- Numerous performance improvements.
- Added config option to preserve the hierarchy during the step.
RemoveRedundantMaterials
- Added config option to specify a list of materials which are kept in every case.
UNREAL
- Added support for the old unreal data format (*.a,*.d,*.uc)
- tested only with exports from Milkshape
- more Unreal stuff to come soon
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@356 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2009-03-05 22:32:13 +00:00
|
|
|
* Don't complain! If you understood what the first paragraph tried
|
2009-02-15 20:29:07 +00:00
|
|
|
* to tell you, you wouldn't even know.
|
|
|
|
* @endcode
|
2009-01-12 22:06:54 +00:00
|
|
|
* @see aiMaterial
|
|
|
|
*/
|
2008-05-05 12:36:31 +00:00
|
|
|
struct aiMaterialProperty
|
|
|
|
{
|
2008-06-03 21:50:53 +00:00
|
|
|
/** Specifies the name of the property (key)
|
2009-02-11 20:56:05 +00:00
|
|
|
*
|
|
|
|
* Keys are case insensitive.
|
|
|
|
*/
|
2008-08-06 23:01:38 +00:00
|
|
|
C_STRUCT aiString mKey;
|
2008-06-03 21:50:53 +00:00
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
/** Textures: Specifies the exact usage semantic.
|
|
|
|
*
|
|
|
|
* For non-texture properties, this member is always 0
|
|
|
|
* or #aiTextureType_NONE.
|
|
|
|
*/
|
2008-11-16 21:56:45 +00:00
|
|
|
unsigned int mSemantic;
|
|
|
|
|
|
|
|
/** Textures: Specifies the index of the texture
|
2009-02-11 20:56:05 +00:00
|
|
|
*
|
|
|
|
* For non-texture properties, this member is always 0.
|
|
|
|
*/
|
2008-11-16 21:56:45 +00:00
|
|
|
unsigned int mIndex;
|
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
/** Size of the buffer mData is pointing to, in bytes.
|
|
|
|
*
|
2009-01-13 18:58:07 +00:00
|
|
|
* This value may not be 0.
|
2009-02-11 20:56:05 +00:00
|
|
|
*/
|
2008-06-03 21:50:53 +00:00
|
|
|
unsigned int mDataLength;
|
|
|
|
|
|
|
|
/** Type information for the property.
|
2009-02-11 20:56:05 +00:00
|
|
|
*
|
|
|
|
* Defines the data layout inside the data buffer. This is used
|
|
|
|
* by the library internally to perform debug checks and to
|
|
|
|
* utilize proper type conversions.
|
|
|
|
* (It's probably a hacky solution, but it works.)
|
|
|
|
*/
|
2009-01-12 22:06:54 +00:00
|
|
|
C_ENUM aiPropertyTypeInfo mType;
|
2008-06-03 21:50:53 +00:00
|
|
|
|
|
|
|
/** Binary buffer to hold the property's value
|
2009-02-11 20:56:05 +00:00
|
|
|
*
|
|
|
|
* The size of the buffer is always mDataLength.
|
|
|
|
*/
|
2008-06-03 21:50:53 +00:00
|
|
|
char* mData;
|
2008-10-19 11:32:33 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
aiMaterialProperty() {
|
2008-10-19 11:32:33 +00:00
|
|
|
mData = NULL;
|
2008-11-16 21:56:45 +00:00
|
|
|
mIndex = mSemantic = 0;
|
2008-10-19 11:32:33 +00:00
|
|
|
}
|
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
~aiMaterialProperty() {
|
2008-10-19 11:32:33 +00:00
|
|
|
delete[] mData;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
2009-01-15 17:15:05 +00:00
|
|
|
};
|
2008-05-05 12:36:31 +00:00
|
|
|
|
2008-06-22 10:09:26 +00:00
|
|
|
#ifdef __cplusplus
|
2009-01-12 22:06:54 +00:00
|
|
|
} // We need to leave the "C" block here to allow template member functions
|
2008-06-22 10:09:26 +00:00
|
|
|
#endif
|
|
|
|
|
2008-05-05 12:36:31 +00:00
|
|
|
// ---------------------------------------------------------------------------
|
2009-01-12 22:06:54 +00:00
|
|
|
/** @brief Data structure for a material
|
2008-05-05 12:36:31 +00:00
|
|
|
*
|
2009-01-12 22:06:54 +00:00
|
|
|
* Material data is stored using a key-value structure. A single key-value
|
|
|
|
* pair is called a 'material property'. C++ users should use the provided
|
|
|
|
* member functions of aiMaterial to process material properties, C users
|
|
|
|
* have to stick with the aiMaterialGetXXX family of unbound functions.
|
|
|
|
* The library defines a set of standard keys (AI_MATKEY_XXX).
|
2008-05-05 12:36:31 +00:00
|
|
|
*/
|
2008-06-22 10:09:26 +00:00
|
|
|
struct ASSIMP_API aiMaterial
|
2008-05-05 12:36:31 +00:00
|
|
|
{
|
2008-11-16 21:56:45 +00:00
|
|
|
|
2008-05-09 17:24:28 +00:00
|
|
|
#ifdef __cplusplus
|
2008-11-16 21:56:45 +00:00
|
|
|
|
2009-01-15 17:15:05 +00:00
|
|
|
/// NOTE: no initialization, instance Assimp::MaterialHelper instead
|
2009-01-12 22:06:54 +00:00
|
|
|
aiMaterial() {}
|
|
|
|
|
2008-05-05 12:36:31 +00:00
|
|
|
public:
|
2008-06-22 10:09:26 +00:00
|
|
|
|
2009-01-12 22:06:54 +00:00
|
|
|
~aiMaterial();
|
|
|
|
|
2008-06-22 10:09:26 +00:00
|
|
|
// -------------------------------------------------------------------
|
2009-01-12 22:06:54 +00:00
|
|
|
/** @brief Retrieve an array of Type values with a specific key
|
2008-06-22 10:09:26 +00:00
|
|
|
* from the material
|
|
|
|
*
|
|
|
|
* @param pKey Key to search for. One of the AI_MATKEY_XXX constants.
|
2009-01-15 17:15:05 +00:00
|
|
|
* @param type Specifies the type of the texture to be retrieved (
|
|
|
|
* e.g. diffuse, specular, height map ...)
|
|
|
|
* @param idx Index of the texture to be retrieved.
|
2008-06-22 10:09:26 +00:00
|
|
|
* @param pOut Pointer to a buffer to receive the result.
|
|
|
|
* @param pMax Specifies the size of the given buffer, in Type's.
|
|
|
|
* Receives the number of values (not bytes!) read.
|
|
|
|
* NULL is a valid value for this parameter.
|
|
|
|
*/
|
|
|
|
template <typename Type>
|
2009-01-12 22:06:54 +00:00
|
|
|
aiReturn Get(const char* pKey,unsigned int type,
|
|
|
|
unsigned int idx, Type* pOut, unsigned int* pMax) const;
|
2008-06-22 10:09:26 +00:00
|
|
|
|
|
|
|
// -------------------------------------------------------------------
|
2009-01-12 22:06:54 +00:00
|
|
|
/** @brief Retrieve a Type value with a specific key
|
2008-06-22 10:09:26 +00:00
|
|
|
* from the material
|
|
|
|
*
|
|
|
|
* @param pKey Key to search for. One of the AI_MATKEY_XXX constants.
|
2009-01-15 17:15:05 +00:00
|
|
|
* @param type Specifies the type of the texture to be retrieved (
|
|
|
|
* e.g. diffuse, specular, height map ...)
|
|
|
|
* @param idx Index of the texture to be retrieved.
|
2008-06-22 10:09:26 +00:00
|
|
|
* @param pOut Reference to receive the output value
|
|
|
|
*/
|
|
|
|
template <typename Type>
|
2009-01-12 22:06:54 +00:00
|
|
|
aiReturn Get(const char* pKey,unsigned int type,
|
|
|
|
unsigned int idx,Type& pOut) const;
|
2008-06-22 10:09:26 +00:00
|
|
|
|
|
|
|
// -------------------------------------------------------------------
|
2009-01-12 22:06:54 +00:00
|
|
|
/** @brief Helper function to get a texture from a material.
|
2008-06-22 10:09:26 +00:00
|
|
|
*
|
2009-01-13 18:58:07 +00:00
|
|
|
* This function is provided just for convenience, you could also
|
2009-01-12 22:06:54 +00:00
|
|
|
* read the single material properties manually.
|
|
|
|
* @param type Specifies the type of the texture to be retrieved (
|
|
|
|
* e.g. diffuse, specular, height map ...)
|
|
|
|
* @param index Index of the texture to be retrieved. The function fails
|
|
|
|
* if there is no texture of that type with this index.
|
|
|
|
* @param path Receives the path to the texture.
|
|
|
|
* NULL is a valid value.
|
2009-01-15 17:15:05 +00:00
|
|
|
* @param mapping The texture mapping.
|
|
|
|
* NULL is allowed as value.
|
2008-11-16 21:56:45 +00:00
|
|
|
* @param uvindex Receives the UV index of the texture.
|
2009-01-12 22:06:54 +00:00
|
|
|
* NULL is a valid value.
|
2008-11-16 21:56:45 +00:00
|
|
|
* @param blend Receives the blend factor for the texture
|
2009-01-12 22:06:54 +00:00
|
|
|
* NULL is a valid value.
|
|
|
|
* @param op Receives the texture operation to be performed between
|
|
|
|
* this texture and the previous texture. NULL is allowed as value.
|
2008-11-16 21:56:45 +00:00
|
|
|
* @param mapmode Receives the mapping modes to be used for the texture.
|
2009-01-12 22:06:54 +00:00
|
|
|
* The parameter may be NULL but if it is a valid pointer it MUST
|
|
|
|
* point to an array of 3 aiTextureMapMode's (one for each
|
|
|
|
* axis: UVW order (=XYZ)).
|
2008-06-22 10:09:26 +00:00
|
|
|
*/
|
|
|
|
// -------------------------------------------------------------------
|
2009-01-12 22:06:54 +00:00
|
|
|
aiReturn GetTexture(aiTextureType type,
|
2008-11-16 21:56:45 +00:00
|
|
|
unsigned int index,
|
|
|
|
C_STRUCT aiString* path,
|
|
|
|
aiTextureMapping* mapping = NULL,
|
|
|
|
unsigned int* uvindex = NULL,
|
2009-01-15 17:15:05 +00:00
|
|
|
float* blend = NULL,
|
2008-11-16 21:56:45 +00:00
|
|
|
aiTextureOp* op = NULL,
|
2009-01-12 22:06:54 +00:00
|
|
|
aiTextureMapMode* mapmode = NULL) const;
|
|
|
|
|
2008-06-22 10:09:26 +00:00
|
|
|
#endif
|
2008-05-09 17:24:28 +00:00
|
|
|
|
2009-01-12 22:06:54 +00:00
|
|
|
/** List of all material properties loaded. */
|
2008-06-03 21:50:53 +00:00
|
|
|
C_STRUCT aiMaterialProperty** mProperties;
|
2008-05-05 12:36:31 +00:00
|
|
|
|
2009-01-12 22:06:54 +00:00
|
|
|
/** Number of properties in the data base */
|
2008-06-03 21:50:53 +00:00
|
|
|
unsigned int mNumProperties;
|
2009-01-12 22:06:54 +00:00
|
|
|
|
2009-01-15 17:15:05 +00:00
|
|
|
/** Storage allocated */
|
2008-06-03 21:50:53 +00:00
|
|
|
unsigned int mNumAllocated;
|
2009-01-15 17:15:05 +00:00
|
|
|
};
|
2008-05-05 12:36:31 +00:00
|
|
|
|
2009-01-12 22:06:54 +00:00
|
|
|
// Go back to extern "C" again
|
2008-06-22 10:09:26 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2008-05-05 12:36:31 +00:00
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
/** @def AI_MATKEY_NAME
|
2009-02-11 20:56:05 +00:00
|
|
|
* Defines the name of the material. <br>
|
2008-06-03 21:50:53 +00:00
|
|
|
* <b>Type:</b> string (aiString)<br>
|
2009-02-11 20:56:05 +00:00
|
|
|
* <b>Default value:</b> <tt>none</tt> <br>
|
2008-05-05 12:36:31 +00:00
|
|
|
*/
|
2009-02-15 20:29:07 +00:00
|
|
|
#define AI_MATKEY_NAME "?mat.name",0,0
|
2008-11-16 21:56:45 +00:00
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
// ---------------------------------------------------------------------------
|
2008-06-03 21:50:53 +00:00
|
|
|
/** @def AI_MATKEY_TWOSIDED
|
2009-02-11 20:56:05 +00:00
|
|
|
* Indicates that the material must be rendered two-sided (means: no
|
|
|
|
* backface culling). <br>
|
2008-06-03 21:50:53 +00:00
|
|
|
* <b>Type:</b> int <br>
|
2009-02-11 20:56:05 +00:00
|
|
|
* <b>Default value:</b> <tt>0</tt> <br>
|
2008-06-03 21:50:53 +00:00
|
|
|
*/
|
2008-11-16 21:56:45 +00:00
|
|
|
#define AI_MATKEY_TWOSIDED "$mat.twosided",0,0
|
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
// ---------------------------------------------------------------------------
|
2009-01-15 17:15:05 +00:00
|
|
|
/** @def AI_MATKEY_SHADING_MODEL
|
2009-02-11 20:56:05 +00:00
|
|
|
* Defines the shading model to be used for this material. See the doc for
|
|
|
|
* #aiShadingMode for a complete list of all predefined values.
|
2008-06-03 21:50:53 +00:00
|
|
|
* <br>
|
|
|
|
* <b>Type:</b> int (aiShadingMode)<br>
|
2009-02-11 20:56:05 +00:00
|
|
|
* <b>Default value:</b> <tt>aiShadingMode_Gouraud</tt>
|
2008-05-05 12:36:31 +00:00
|
|
|
*/
|
2008-11-16 21:56:45 +00:00
|
|
|
#define AI_MATKEY_SHADING_MODEL "$mat.shadingm",0,0
|
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
// ---------------------------------------------------------------------------
|
2009-01-15 17:15:05 +00:00
|
|
|
/** @def AI_MATKEY_ENABLE_WIREFRAME
|
2009-02-11 20:56:05 +00:00
|
|
|
* Integer property. 1 to enable wireframe mode for rendering.
|
|
|
|
* A material with this property set to 1 should appear as wireframe, even
|
|
|
|
* if the scene is rendered solid.
|
2009-02-13 22:03:57 +00:00
|
|
|
* <br>
|
|
|
|
* <b>Type:</b> int <br>
|
|
|
|
* <b>Default value:</b> <tt>0</tt>
|
2008-05-09 17:24:28 +00:00
|
|
|
*/
|
2008-11-16 21:56:45 +00:00
|
|
|
#define AI_MATKEY_ENABLE_WIREFRAME "$mat.wireframe",0,0
|
|
|
|
|
2009-02-13 22:03:57 +00:00
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
/** @def AI_MATKEY_BLEND_FUNC
|
|
|
|
* Integer property (one of the #aiBlendMode enumerated values). Defines
|
|
|
|
* the blend function to be used to combine the material color for a specific
|
|
|
|
* pixel with the previous framebuffer color at this position. This
|
|
|
|
* corresponds to the #AI_MATKEY_OPACITY and #AI_MATKEY_COLOR_TRANSPARENT
|
|
|
|
* property. No alpha-blending needs to be turned on if the opacity for all
|
|
|
|
* color channels is 1.0 and the blend mode is set to #aiBlendMode_Default.
|
|
|
|
* <br>
|
|
|
|
* <b>Type:</b> int (#aiBlendMode)<br>
|
|
|
|
* <b>Default value:</b> <tt>#aiBlendMode_Default</tt>
|
|
|
|
*/
|
|
|
|
#define AI_MATKEY_BLEND_FUNC "$mat.blend",0,0
|
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
// ---------------------------------------------------------------------------
|
2008-05-05 12:36:31 +00:00
|
|
|
/** @def AI_MATKEY_OPACITY
|
2009-02-13 22:03:57 +00:00
|
|
|
* Defines the base opacity of the material. To get the opacity value for
|
|
|
|
* a particular channel, this value is multiplied with the corresponding
|
|
|
|
* channel of the #AI_MATKEY_COLOR_TRANSPARENT property. The final value
|
|
|
|
* is fed in the blend function defined by the #AI_MATKEY_BLEND_FUNC
|
|
|
|
* property.
|
2008-06-03 21:50:53 +00:00
|
|
|
* <br>
|
|
|
|
* <b>Type:</b> float<br>
|
2009-02-11 20:56:05 +00:00
|
|
|
* <b>Default value:</b> <tt>1.0f</tt><br>
|
|
|
|
*/
|
2008-11-16 21:56:45 +00:00
|
|
|
#define AI_MATKEY_OPACITY "$mat.opacity",0,0
|
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
// ---------------------------------------------------------------------------
|
2008-05-05 12:36:31 +00:00
|
|
|
/** @def AI_MATKEY_BUMPSCALING
|
2008-06-03 21:50:53 +00:00
|
|
|
* Defines the height scaling of a bump map (for stuff like Parallax
|
2009-02-11 20:56:05 +00:00
|
|
|
* Occlusion Mapping). The actual interpretation/range depends on the
|
|
|
|
* 3D applications which wrote a particular model. <br>
|
|
|
|
*
|
2008-06-03 21:50:53 +00:00
|
|
|
* <b>Type:</b> float<br>
|
2009-02-11 20:56:05 +00:00
|
|
|
* <b>Default value:</b> <tt>1.0f</tt>
|
|
|
|
*/
|
2008-11-16 21:56:45 +00:00
|
|
|
#define AI_MATKEY_BUMPSCALING "$mat.bumpscaling",0,0
|
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
// ---------------------------------------------------------------------------
|
2008-05-05 12:36:31 +00:00
|
|
|
/** @def AI_MATKEY_SHININESS
|
2008-06-03 21:50:53 +00:00
|
|
|
* Defines the base shininess of the material
|
2009-02-11 20:56:05 +00:00
|
|
|
* This is the exponent of the Phong and Phong-Blinn shading equations.
|
|
|
|
* The range is undefined and depends on the shader being used. The
|
|
|
|
* value will not be negative, though. <br>
|
|
|
|
*
|
2008-06-03 21:50:53 +00:00
|
|
|
* <b>Type:</b> float<br>
|
2009-02-11 20:56:05 +00:00
|
|
|
* <b>Default value:</b> <tt>0.0f</tt>
|
|
|
|
*/
|
2008-11-16 21:56:45 +00:00
|
|
|
#define AI_MATKEY_SHININESS "$mat.shininess",0,0
|
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
// ---------------------------------------------------------------------------
|
2008-05-25 22:29:05 +00:00
|
|
|
/** @def AI_MATKEY_SHININESS_STRENGTH
|
2008-06-03 21:50:53 +00:00
|
|
|
* Defines the strength of the specular highlight.
|
2009-02-11 20:56:05 +00:00
|
|
|
* This simply scales the specular lighting coefficient. <br>
|
|
|
|
*
|
|
|
|
* <b>Type:</b> float <br>
|
|
|
|
* <b>Default value:</b> <tt>1.0f</tt>
|
|
|
|
* @note The same effect could be achieved by scaling the specular material
|
|
|
|
* color. However, most 3D modelers keep this property separate and so
|
|
|
|
* do we. OK!?
|
|
|
|
*/
|
2008-11-16 21:56:45 +00:00
|
|
|
#define AI_MATKEY_SHININESS_STRENGTH "$mat.shinpercent",0,0
|
2008-05-25 22:29:05 +00:00
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
// ---------------------------------------------------------------------------
|
2008-09-20 15:55:51 +00:00
|
|
|
/** @def AI_MATKEY_REFRACTI
|
|
|
|
* Index of refraction of the material. This is used by some shading models,
|
2009-02-11 20:56:05 +00:00
|
|
|
* e.g. Cook-Torrance. The value is the ratio of the speed of light in a
|
|
|
|
* vacuum to the speed of light in the material. <br>
|
|
|
|
*
|
|
|
|
* <b>Type:</b> float <br>
|
|
|
|
* <b>Default value:</b> <tt>1.0f </tt>
|
|
|
|
*/
|
2008-11-16 21:56:45 +00:00
|
|
|
#define AI_MATKEY_REFRACTI "$mat.refracti",0,0
|
2008-09-20 15:55:51 +00:00
|
|
|
|
2008-06-03 21:50:53 +00:00
|
|
|
// ---------------------------------------------------------------------------
|
2008-05-05 12:36:31 +00:00
|
|
|
/** @def AI_MATKEY_COLOR_DIFFUSE
|
2009-02-13 22:03:57 +00:00
|
|
|
* Defines the diffuse base color of the material.
|
|
|
|
* If stored as 4-component color, the alpha channel is ignored.<br>
|
2009-02-11 20:56:05 +00:00
|
|
|
* <b>Type:</b> color (#aiColor4D or #aiColor3D) <br>
|
|
|
|
* <b>Default value:</b> <tt>0.0f|0.0f|0.0f|1.0f </tt>
|
2008-05-05 12:36:31 +00:00
|
|
|
*/
|
2008-11-16 21:56:45 +00:00
|
|
|
#define AI_MATKEY_COLOR_DIFFUSE "$clr.diffuse",0,0
|
2008-05-05 12:36:31 +00:00
|
|
|
|
|
|
|
/** @def AI_MATKEY_COLOR_AMBIENT
|
2009-02-11 20:56:05 +00:00
|
|
|
* Declares the amount of ambient light emitted from
|
2009-02-13 22:03:57 +00:00
|
|
|
* the surface of this object. If stored as 4-component color,
|
|
|
|
* the alpha channel is ignored.<br><br>
|
|
|
|
* <b>Type:</b> color (#aiColor4D or #aiColor3D) <br>
|
|
|
|
* <b>Default value:</b> <tt>0.0f|0.0f|0.0f|1.0f </tt>
|
2008-05-05 12:36:31 +00:00
|
|
|
*/
|
2008-11-16 21:56:45 +00:00
|
|
|
#define AI_MATKEY_COLOR_AMBIENT "$clr.ambient",0,0
|
2008-05-05 12:36:31 +00:00
|
|
|
|
|
|
|
/** @def AI_MATKEY_COLOR_SPECULAR
|
2009-02-11 20:56:05 +00:00
|
|
|
* Declares the color of light specularly reflected from
|
2009-02-13 22:03:57 +00:00
|
|
|
* the surface of this object. If stored as 4-component color, the
|
|
|
|
* alpha channel is ignored.<br><br>
|
|
|
|
* <b>Type:</b> color (#aiColor4D or #aiColor3D) <br>
|
|
|
|
* <b>Default value:</b> <tt>0.0f|0.0f|0.0f|1.0f </tt>
|
2008-05-05 12:36:31 +00:00
|
|
|
*/
|
2008-11-16 21:56:45 +00:00
|
|
|
#define AI_MATKEY_COLOR_SPECULAR "$clr.specular",0,0
|
2008-05-05 12:36:31 +00:00
|
|
|
|
|
|
|
/** @def AI_MATKEY_COLOR_EMISSIVE
|
2009-02-11 20:56:05 +00:00
|
|
|
* Declares the amount of light emitted from the
|
2009-02-13 22:03:57 +00:00
|
|
|
* surface of this object. If stored as 4-component color, the alpha
|
|
|
|
* channel is ignored.<br><br>
|
|
|
|
* <b>Type:</b> color (#aiColor4D or #aiColor3D) <br>
|
|
|
|
* <b>Default value:</b> <tt>0.0f|0.0f|0.0f|1.0f </tt>
|
2008-05-05 12:36:31 +00:00
|
|
|
*/
|
2008-11-16 21:56:45 +00:00
|
|
|
#define AI_MATKEY_COLOR_EMISSIVE "$clr.emissive",0,0
|
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
/** @def AI_MATKEY_COLOR_TRANSPARENT
|
2009-02-13 22:03:57 +00:00
|
|
|
* Defines the transparent base color of the material. If stored as
|
|
|
|
* 4-component color, the alpha channel is ignored. This
|
|
|
|
* corresponds to the #AI_MATKEY_OPACITY and #AI_MATKEY_BLEND_FUNC
|
|
|
|
* material properties.<br> <br>
|
|
|
|
* <b>Type:</b> color (#aiColor4D or #aiColor3D) <br>
|
|
|
|
* <b>Default value:</b> <tt>0.0f|0.0f|0.0f|1.0f </tt>
|
2009-02-11 20:56:05 +00:00
|
|
|
*/
|
|
|
|
#define AI_MATKEY_COLOR_TRANSPARENT "$clr.transparent",0,0
|
|
|
|
|
|
|
|
/** @def AI_MATKEY_COLOR_REFLECTIVE
|
2009-02-13 22:03:57 +00:00
|
|
|
* Declares the color of a perfect mirror reflection. If stored as
|
|
|
|
* 4-component color, the alpha channel is ignored.<br> <br>
|
|
|
|
* <b>Type:</b> color (#aiColor4D or #aiColor3D) <br>
|
|
|
|
* <b>Default value:</b> <tt>0.0f|0.0f|0.0f|1.0f </tt>
|
2009-02-11 20:56:05 +00:00
|
|
|
*/
|
|
|
|
#define AI_MATKEY_COLOR_REFLECTIVE "$clr.reflective",0,0
|
|
|
|
|
|
|
|
|
2008-11-16 21:56:45 +00:00
|
|
|
// ---------------------------------------------------------------------------
|
2009-02-11 20:56:05 +00:00
|
|
|
// Pure key names for all texture-related properties
|
|
|
|
//! @cond MATS_DOC_FULL
|
|
|
|
#define _AI_MATKEY_TEXTURE_BASE "$tex.file"
|
|
|
|
#define _AI_MATKEY_UVWSRC_BASE "$tex.uvwsrc"
|
|
|
|
#define _AI_MATKEY_TEXOP_BASE "$tex.op"
|
|
|
|
#define _AI_MATKEY_MAPPING_BASE "$tex.mapping"
|
|
|
|
#define _AI_MATKEY_TEXBLEND_BASE "$tex.blend"
|
|
|
|
#define _AI_MATKEY_MAPPINGMODE_U_BASE "$tex.mapmodeu"
|
|
|
|
#define _AI_MATKEY_MAPPINGMODE_V_BASE "$tex.mapmodev"
|
|
|
|
#define _AI_MATKEY_TEXMAP_AXIS_BASE "$tex.mapaxis"
|
|
|
|
#define _AI_MATKEY_UVTRANSFORM_BASE "$tex.uvtrafo"
|
|
|
|
#define _AI_MATKEY_TEXFLAGS_BASE "$tex.flags"
|
|
|
|
//! @endcond
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
/**
|
|
|
|
* @def AI_MATKEY_TEXTURE
|
2009-01-15 17:15:05 +00:00
|
|
|
* Specifies the path to the Nth texture of type "type".
|
2009-02-11 20:56:05 +00:00
|
|
|
* This can either be a path to the texture or a string of the form '*i'
|
2008-11-16 21:56:45 +00:00
|
|
|
* where i is an index into the array of embedded textures that has been
|
2009-02-11 20:56:05 +00:00
|
|
|
* imported along with the scene. See #aiTexture for more details.
|
2009-01-15 17:15:05 +00:00
|
|
|
* <br>
|
2009-02-11 20:56:05 +00:00
|
|
|
* <b>Type:</b> #aiString<br>
|
|
|
|
* <b>Default value if key is not defined:</b> <tt>n/a</tt><br>
|
2008-11-16 21:56:45 +00:00
|
|
|
*/
|
|
|
|
// ---------------------------------------------------------------------------
|
2009-02-08 22:55:51 +00:00
|
|
|
#define AI_MATKEY_TEXTURE(type, N) _AI_MATKEY_TEXTURE_BASE,type,N
|
2008-11-16 21:56:45 +00:00
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
// For backward compatibility and simplicity
|
|
|
|
//! @cond MATS_DOC_FULL
|
2008-11-16 21:56:45 +00:00
|
|
|
#define AI_MATKEY_TEXTURE_DIFFUSE(N) \
|
|
|
|
AI_MATKEY_TEXTURE(aiTextureType_DIFFUSE,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXTURE_SPECULAR(N) \
|
|
|
|
AI_MATKEY_TEXTURE(aiTextureType_SPECULAR,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXTURE_AMBIENT(N) \
|
|
|
|
AI_MATKEY_TEXTURE(aiTextureType_AMBIENT,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXTURE_EMISSIVE(N) \
|
|
|
|
AI_MATKEY_TEXTURE(aiTextureType_EMISSIVE,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXTURE_NORMALS(N) \
|
|
|
|
AI_MATKEY_TEXTURE(aiTextureType_NORMALS,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXTURE_HEIGHT(N) \
|
|
|
|
AI_MATKEY_TEXTURE(aiTextureType_HEIGHT,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXTURE_SHININESS(N) \
|
|
|
|
AI_MATKEY_TEXTURE(aiTextureType_SHININESS,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXTURE_OPACITY(N) \
|
|
|
|
AI_MATKEY_TEXTURE(aiTextureType_OPACITY,N)
|
2008-05-05 12:36:31 +00:00
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
#define AI_MATKEY_TEXTURE_DISPLACEMENT(N) \
|
|
|
|
AI_MATKEY_TEXTURE(aiTextureType_DISPLACEMENT,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXTURE_LIGHTMAP(N) \
|
|
|
|
AI_MATKEY_TEXTURE(aiTextureType_LIGHTMAP,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXTURE_REFLECTION(N) \
|
|
|
|
AI_MATKEY_TEXTURE(aiTextureType_REFLECTION,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXTURE_UNKNOWN(N) \
|
|
|
|
AI_MATKEY_TEXTURE(aiTextureType_UNKNOWN,N)
|
|
|
|
|
|
|
|
//! @endcond
|
2008-11-05 12:26:11 +00:00
|
|
|
|
2008-06-03 21:50:53 +00:00
|
|
|
// ---------------------------------------------------------------------------
|
2009-02-11 20:56:05 +00:00
|
|
|
/**
|
|
|
|
* @def AI_MATKEY_UVWSRC
|
2008-11-16 21:56:45 +00:00
|
|
|
* Specifies which UV channel is used as source for the mapping coordinates
|
2009-02-11 20:56:05 +00:00
|
|
|
* of the Nth texture of type "type". If the requested mapping channel does
|
|
|
|
* not exist in a mesh associated with the material, decrement the index by
|
|
|
|
* one until you find a working UV channel. Please note that this property
|
|
|
|
* is mutually exlusive with AI_MATKEY_MAPPING(type,N) set to 'UV'.
|
2009-01-15 17:15:05 +00:00
|
|
|
* <br>
|
2008-11-16 21:56:45 +00:00
|
|
|
* <b>Type:</b> int<br>
|
2009-02-11 20:56:05 +00:00
|
|
|
* <b>Default value if key is not defined:</b><tt>0</tt><br>
|
2009-01-15 17:15:05 +00:00
|
|
|
* <b>Requires:</b> AI_MATKEY_TEXTURE(type,N)
|
|
|
|
* and AI_MATKEY_MAPPING(type,N) == UV<br>
|
2008-11-16 21:56:45 +00:00
|
|
|
*/
|
|
|
|
// ---------------------------------------------------------------------------
|
2009-02-08 22:55:51 +00:00
|
|
|
#define AI_MATKEY_UVWSRC(type, N) _AI_MATKEY_UVWSRC_BASE,type,N
|
2008-05-05 12:36:31 +00:00
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
// For backward compatibility and simplicity
|
|
|
|
//! @cond MATS_DOC_FULL
|
2008-11-16 21:56:45 +00:00
|
|
|
#define AI_MATKEY_UVWSRC_DIFFUSE(N) \
|
|
|
|
AI_MATKEY_UVWSRC(aiTextureType_DIFFUSE,N)
|
2008-05-05 12:36:31 +00:00
|
|
|
|
2008-11-16 21:56:45 +00:00
|
|
|
#define AI_MATKEY_UVWSRC_SPECULAR(N) \
|
|
|
|
AI_MATKEY_UVWSRC(aiTextureType_SPECULAR,N)
|
2008-05-05 12:36:31 +00:00
|
|
|
|
2008-11-16 21:56:45 +00:00
|
|
|
#define AI_MATKEY_UVWSRC_AMBIENT(N) \
|
|
|
|
AI_MATKEY_UVWSRC(aiTextureType_AMBIENT,N)
|
2008-05-05 12:36:31 +00:00
|
|
|
|
2008-11-16 21:56:45 +00:00
|
|
|
#define AI_MATKEY_UVWSRC_EMISSIVE(N) \
|
|
|
|
AI_MATKEY_UVWSRC(aiTextureType_EMISSIVE,N)
|
2008-05-05 12:36:31 +00:00
|
|
|
|
2008-11-16 21:56:45 +00:00
|
|
|
#define AI_MATKEY_UVWSRC_NORMALS(N) \
|
|
|
|
AI_MATKEY_UVWSRC(aiTextureType_NORMALS,N)
|
2008-09-20 15:55:51 +00:00
|
|
|
|
2008-11-16 21:56:45 +00:00
|
|
|
#define AI_MATKEY_UVWSRC_HEIGHT(N) \
|
|
|
|
AI_MATKEY_UVWSRC(aiTextureType_HEIGHT,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_UVWSRC_SHININESS(N) \
|
|
|
|
AI_MATKEY_UVWSRC(aiTextureType_SHININESS,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_UVWSRC_OPACITY(N) \
|
|
|
|
AI_MATKEY_UVWSRC(aiTextureType_OPACITY,N)
|
2008-05-05 12:36:31 +00:00
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
#define AI_MATKEY_UVWSRC_DISPLACEMENT(N) \
|
|
|
|
AI_MATKEY_UVWSRC(aiTextureType_DISPLACEMENT,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_UVWSRC_LIGHTMAP(N) \
|
|
|
|
AI_MATKEY_UVWSRC(aiTextureType_LIGHTMAP,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_UVWSRC_REFLECTION(N) \
|
|
|
|
AI_MATKEY_UVWSRC(aiTextureType_REFLECTION,N)
|
2008-06-15 10:27:08 +00:00
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
#define AI_MATKEY_UVWSRC_UNKNOWN(N) \
|
|
|
|
AI_MATKEY_UVWSRC(aiTextureType_UNKNOWN,N)
|
|
|
|
|
|
|
|
//! @endcond
|
2008-06-03 21:50:53 +00:00
|
|
|
// ---------------------------------------------------------------------------
|
2009-02-11 20:56:05 +00:00
|
|
|
/**
|
|
|
|
* @def AI_MATKEY_TEXOP
|
2009-01-15 17:15:05 +00:00
|
|
|
* Specifies how the Nth texture of type "type" is combined with
|
2009-02-11 20:56:05 +00:00
|
|
|
* the result of all color values from all previous texture layers combined.
|
2009-01-15 17:15:05 +00:00
|
|
|
* <br>
|
2009-02-11 20:56:05 +00:00
|
|
|
* <b>Type:</b> int (#aiTextureOp)<br>
|
|
|
|
* <b>Default value if key is not defined:</b> <tt>#aiTextureOp_Multiply</tt><br>
|
2008-11-16 21:56:45 +00:00
|
|
|
* <b>Requires:</b> AI_MATKEY_TEXTURE(type,N)<br>
|
2008-06-03 21:50:53 +00:00
|
|
|
*/
|
2008-09-20 15:55:51 +00:00
|
|
|
// ---------------------------------------------------------------------------
|
2009-02-08 22:55:51 +00:00
|
|
|
#define AI_MATKEY_TEXOP(type, N) _AI_MATKEY_TEXOP_BASE,type,N
|
2008-11-16 21:56:45 +00:00
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
// For backward compatibility and simplicity
|
|
|
|
//! @cond MATS_DOC_FULL
|
2008-11-16 21:56:45 +00:00
|
|
|
#define AI_MATKEY_TEXOP_DIFFUSE(N) \
|
|
|
|
AI_MATKEY_TEXOP(aiTextureType_DIFFUSE,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXOP_SPECULAR(N) \
|
|
|
|
AI_MATKEY_TEXOP(aiTextureType_SPECULAR,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXOP_AMBIENT(N) \
|
|
|
|
AI_MATKEY_TEXOP(aiTextureType_AMBIENT,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXOP_EMISSIVE(N) \
|
|
|
|
AI_MATKEY_TEXOP(aiTextureType_EMISSIVE,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXOP_NORMALS(N) \
|
|
|
|
AI_MATKEY_TEXOP(aiTextureType_NORMALS,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXOP_HEIGHT(N) \
|
|
|
|
AI_MATKEY_TEXOP(aiTextureType_HEIGHT,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXOP_SHININESS(N) \
|
|
|
|
AI_MATKEY_TEXOP(aiTextureType_SHININESS,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXOP_OPACITY(N) \
|
|
|
|
AI_MATKEY_TEXOP(aiTextureType_OPACITY,N)
|
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
#define AI_MATKEY_TEXOP_DISPLACEMENT(N) \
|
|
|
|
AI_MATKEY_TEXOP(aiTextureType_DISPLACEMENT,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXOP_LIGHTMAP(N) \
|
|
|
|
AI_MATKEY_TEXOP(aiTextureType_LIGHTMAP,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXOP_REFLECTION(N) \
|
|
|
|
AI_MATKEY_TEXOP(aiTextureType_REFLECTION,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXOP_UNKNOWN(N) \
|
|
|
|
AI_MATKEY_TEXOP(aiTextureType_UNKNOWN,N)
|
2008-05-05 12:36:31 +00:00
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
//! @endcond
|
2008-06-03 21:50:53 +00:00
|
|
|
// ---------------------------------------------------------------------------
|
2009-02-11 20:56:05 +00:00
|
|
|
/**
|
|
|
|
* @def AI_MATKEY_MAPPING
|
2009-01-15 17:15:05 +00:00
|
|
|
* Specifies how the Nth texture of type "type" is mapped.
|
2008-06-03 21:50:53 +00:00
|
|
|
* <br>
|
2009-02-11 20:56:05 +00:00
|
|
|
* <b>Type:</b> int (#aiTextureMapping)<br>
|
|
|
|
* <b>Default value if key is not defined:</b> <tt>#aiTextureMapping_UV</tt><br>
|
|
|
|
* <b>Requires:</b>#AI_MATKEY_TEXTURE(type,N)<br>
|
2008-06-03 21:50:53 +00:00
|
|
|
*/
|
2008-09-20 15:55:51 +00:00
|
|
|
// ---------------------------------------------------------------------------
|
2009-02-08 22:55:51 +00:00
|
|
|
#define AI_MATKEY_MAPPING(type, N) _AI_MATKEY_MAPPING_BASE,type,N
|
2008-11-16 21:56:45 +00:00
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
// For backward compatibility and simplicity
|
|
|
|
//! @cond MATS_DOC_FULL
|
2008-11-16 21:56:45 +00:00
|
|
|
#define AI_MATKEY_MAPPING_DIFFUSE(N) \
|
|
|
|
AI_MATKEY_MAPPING(aiTextureType_DIFFUSE,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_MAPPING_SPECULAR(N) \
|
|
|
|
AI_MATKEY_MAPPING(aiTextureType_SPECULAR,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_MAPPING_AMBIENT(N) \
|
|
|
|
AI_MATKEY_MAPPING(aiTextureType_AMBIENT,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_MAPPING_EMISSIVE(N) \
|
|
|
|
AI_MATKEY_MAPPING(aiTextureType_EMISSIVE,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_MAPPING_NORMALS(N) \
|
|
|
|
AI_MATKEY_MAPPING(aiTextureType_NORMALS,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_MAPPING_HEIGHT(N) \
|
|
|
|
AI_MATKEY_MAPPING(aiTextureType_HEIGHT,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_MAPPING_SHININESS(N) \
|
|
|
|
AI_MATKEY_MAPPING(aiTextureType_SHININESS,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_MAPPING_OPACITY(N) \
|
|
|
|
AI_MATKEY_MAPPING(aiTextureType_OPACITY,N)
|
2008-05-05 12:36:31 +00:00
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
#define AI_MATKEY_MAPPING_DISPLACEMENT(N) \
|
|
|
|
AI_MATKEY_MAPPING(aiTextureType_DISPLACEMENT,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_MAPPING_LIGHTMAP(N) \
|
|
|
|
AI_MATKEY_MAPPING(aiTextureType_LIGHTMAP,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_MAPPING_REFLECTION(N) \
|
|
|
|
AI_MATKEY_MAPPING(aiTextureType_REFLECTION,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_MAPPING_UNKNOWN(N) \
|
|
|
|
AI_MATKEY_MAPPING(aiTextureType_UNKNOWN,N)
|
|
|
|
|
|
|
|
//! @endcond
|
2008-06-03 21:50:53 +00:00
|
|
|
// ---------------------------------------------------------------------------
|
2009-02-11 20:56:05 +00:00
|
|
|
/**
|
|
|
|
* @def AI_MATKEY_TEXBLEND
|
2008-11-16 21:56:45 +00:00
|
|
|
* Specifies the strength of the <N>th texture of type <type>. This is just
|
2009-02-08 22:55:51 +00:00
|
|
|
* a multiplier for the texture's color values. It may have any value, even
|
2009-02-11 20:56:05 +00:00
|
|
|
* outside [0..1].
|
2008-06-03 21:50:53 +00:00
|
|
|
* <br>
|
|
|
|
* <b>Type:</b> float<br>
|
2009-02-11 20:56:05 +00:00
|
|
|
* <b>Default value if this key is not defined:</b><tt>1.f</tt><br>
|
|
|
|
* <b>Requires:</b> #AI_MATKEY_TEXTURE(type,N)<br>
|
2008-06-03 21:50:53 +00:00
|
|
|
*/
|
2008-09-20 15:55:51 +00:00
|
|
|
// ---------------------------------------------------------------------------
|
2009-02-08 22:55:51 +00:00
|
|
|
#define AI_MATKEY_TEXBLEND(type, N) _AI_MATKEY_TEXBLEND_BASE,type,N
|
2008-11-16 21:56:45 +00:00
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
// For backward compatibility and simplicity
|
|
|
|
//! @cond MATS_DOC_FULL
|
2008-11-16 21:56:45 +00:00
|
|
|
#define AI_MATKEY_TEXBLEND_DIFFUSE(N) \
|
|
|
|
AI_MATKEY_TEXBLEND(aiTextureType_DIFFUSE,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXBLEND_SPECULAR(N) \
|
|
|
|
AI_MATKEY_TEXBLEND(aiTextureType_SPECULAR,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXBLEND_AMBIENT(N) \
|
|
|
|
AI_MATKEY_TEXBLEND(aiTextureType_AMBIENT,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXBLEND_EMISSIVE(N) \
|
|
|
|
AI_MATKEY_TEXBLEND(aiTextureType_EMISSIVE,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXBLEND_NORMALS(N) \
|
|
|
|
AI_MATKEY_TEXBLEND(aiTextureType_NORMALS,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXBLEND_HEIGHT(N) \
|
|
|
|
AI_MATKEY_TEXBLEND(aiTextureType_HEIGHT,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXBLEND_SHININESS(N) \
|
|
|
|
AI_MATKEY_TEXBLEND(aiTextureType_SHININESS,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXBLEND_OPACITY(N) \
|
|
|
|
AI_MATKEY_TEXBLEND(aiTextureType_OPACITY,N)
|
2008-05-09 17:24:28 +00:00
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
#define AI_MATKEY_TEXBLEND_DISPLACEMENT(N) \
|
|
|
|
AI_MATKEY_TEXBLEND(aiTextureType_DISPLACEMENT,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXBLEND_LIGHTMAP(N) \
|
|
|
|
AI_MATKEY_TEXBLEND(aiTextureType_LIGHTMAP,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXBLEND_REFLECTION(N) \
|
|
|
|
AI_MATKEY_TEXBLEND(aiTextureType_REFLECTION,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXBLEND_UNKNOWN(N) \
|
|
|
|
AI_MATKEY_TEXBLEND(aiTextureType_UNKNOWN,N)
|
|
|
|
|
|
|
|
//! @endcond
|
2008-06-03 21:50:53 +00:00
|
|
|
// ---------------------------------------------------------------------------
|
2009-02-11 20:56:05 +00:00
|
|
|
/**
|
|
|
|
* @def AI_MATKEY_MAPPINGMODE_U
|
2008-11-16 21:56:45 +00:00
|
|
|
* Specifies the texture mapping mode for the <N>th texture of type <type> in
|
2009-02-11 20:56:05 +00:00
|
|
|
* the u (x) direction.
|
2008-06-03 21:50:53 +00:00
|
|
|
* <br>
|
2009-02-11 20:56:05 +00:00
|
|
|
* <b>Type:</b> int (#aiTextureMapMode)<br>
|
|
|
|
* <b>Default value if key is not defined:</b><tt>#aiTextureMapMode_Wrap</tt><br>
|
2008-11-16 21:56:45 +00:00
|
|
|
* <b>Requires:</b> AI_MATKEY_TEXTURE(type,N)<br>
|
2009-02-11 20:56:05 +00:00
|
|
|
* @note There's no equivalent property for the 'w' axis of volume textures,
|
|
|
|
* just because no formats exports this information.
|
2008-06-03 21:50:53 +00:00
|
|
|
*/
|
2008-09-20 15:55:51 +00:00
|
|
|
// ---------------------------------------------------------------------------
|
2009-02-08 22:55:51 +00:00
|
|
|
#define AI_MATKEY_MAPPINGMODE_U(type, N) _AI_MATKEY_MAPPINGMODE_U_BASE,type,N
|
2008-11-16 21:56:45 +00:00
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
// For backward compatibility and simplicity
|
|
|
|
//! @cond MATS_DOC_FULL
|
2008-11-16 21:56:45 +00:00
|
|
|
#define AI_MATKEY_MAPPINGMODE_U_DIFFUSE(N) \
|
|
|
|
AI_MATKEY_MAPPINGMODE_U(aiTextureType_DIFFUSE,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_MAPPINGMODE_U_SPECULAR(N) \
|
|
|
|
AI_MATKEY_MAPPINGMODE_U(aiTextureType_SPECULAR,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_MAPPINGMODE_U_AMBIENT(N) \
|
|
|
|
AI_MATKEY_MAPPINGMODE_U(aiTextureType_AMBIENT,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_MAPPINGMODE_U_EMISSIVE(N) \
|
|
|
|
AI_MATKEY_MAPPINGMODE_U(aiTextureType_EMISSIVE,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_MAPPINGMODE_U_NORMALS(N) \
|
|
|
|
AI_MATKEY_MAPPINGMODE_U(aiTextureType_NORMALS,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_MAPPINGMODE_U_HEIGHT(N) \
|
|
|
|
AI_MATKEY_MAPPINGMODE_U(aiTextureType_HEIGHT,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_MAPPINGMODE_U_SHININESS(N) \
|
|
|
|
AI_MATKEY_MAPPINGMODE_U(aiTextureType_SHININESS,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_MAPPINGMODE_U_OPACITY(N) \
|
|
|
|
AI_MATKEY_MAPPINGMODE_U(aiTextureType_OPACITY,N)
|
2008-06-03 21:50:53 +00:00
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
#define AI_MATKEY_MAPPINGMODE_U_DISPLACEMENT(N) \
|
|
|
|
AI_MATKEY_MAPPINGMODE_U(aiTextureType_DISPLACEMENT,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_MAPPINGMODE_U_LIGHTMAP(N) \
|
|
|
|
AI_MATKEY_MAPPINGMODE_U(aiTextureType_LIGHTMAP,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_MAPPINGMODE_U_REFLECTION(N) \
|
|
|
|
AI_MATKEY_MAPPINGMODE_U(aiTextureType_REFLECTION,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_MAPPINGMODE_U_UNKNOWN(N) \
|
|
|
|
AI_MATKEY_MAPPINGMODE_U(aiTextureType_UNKNOWN,N)
|
|
|
|
|
|
|
|
//! @endcond
|
2008-06-03 21:50:53 +00:00
|
|
|
// ---------------------------------------------------------------------------
|
2009-02-11 20:56:05 +00:00
|
|
|
/**
|
|
|
|
* @def AI_MATKEY_MAPPINGMODE_V
|
2008-11-16 21:56:45 +00:00
|
|
|
* Specifies the texture mapping mode for the <N>th texture of type <type> in
|
2009-02-11 20:56:05 +00:00
|
|
|
* the w (z) direction.
|
2008-06-03 21:50:53 +00:00
|
|
|
* <br>
|
2009-02-11 20:56:05 +00:00
|
|
|
* <b>Type:</b> int (#aiTextureMapMode)<br>
|
|
|
|
* <b>Default value if key is not defined:</b><tt>#aiTextureMapMode_Wrap</tt><br>
|
2008-11-16 21:56:45 +00:00
|
|
|
* <b>Requires:</b> AI_MATKEY_TEXTURE(type,N)<br>
|
2009-02-11 20:56:05 +00:00
|
|
|
* @note There's no equivalent property for the 'w' axis of volume textures,
|
|
|
|
* just because no formats exports this information.
|
2008-06-03 21:50:53 +00:00
|
|
|
*/
|
2008-09-20 15:55:51 +00:00
|
|
|
// ---------------------------------------------------------------------------
|
2009-02-08 22:55:51 +00:00
|
|
|
#define AI_MATKEY_MAPPINGMODE_V(type, N) _AI_MATKEY_MAPPINGMODE_V_BASE,type,N
|
2008-11-16 21:56:45 +00:00
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
// For backward compatibility and simplicity
|
|
|
|
//! @cond MATS_DOC_FULL
|
2008-11-16 21:56:45 +00:00
|
|
|
#define AI_MATKEY_MAPPINGMODE_V_DIFFUSE(N) \
|
|
|
|
AI_MATKEY_MAPPINGMODE_V(aiTextureType_DIFFUSE,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_MAPPINGMODE_V_SPECULAR(N) \
|
|
|
|
AI_MATKEY_MAPPINGMODE_V(aiTextureType_SPECULAR,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_MAPPINGMODE_V_AMBIENT(N) \
|
|
|
|
AI_MATKEY_MAPPINGMODE_V(aiTextureType_AMBIENT,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_MAPPINGMODE_V_EMISSIVE(N) \
|
|
|
|
AI_MATKEY_MAPPINGMODE_V(aiTextureType_EMISSIVE,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_MAPPINGMODE_V_NORMALS(N) \
|
|
|
|
AI_MATKEY_MAPPINGMODE_V(aiTextureType_NORMALS,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_MAPPINGMODE_V_HEIGHT(N) \
|
|
|
|
AI_MATKEY_MAPPINGMODE_V(aiTextureType_HEIGHT,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_MAPPINGMODE_V_SHININESS(N) \
|
|
|
|
AI_MATKEY_MAPPINGMODE_V(aiTextureType_SHININESS,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_MAPPINGMODE_V_OPACITY(N) \
|
|
|
|
AI_MATKEY_MAPPINGMODE_V(aiTextureType_OPACITY,N)
|
2008-06-03 21:50:53 +00:00
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
#define AI_MATKEY_MAPPINGMODE_V_DISPLACEMENT(N) \
|
|
|
|
AI_MATKEY_MAPPINGMODE_V(aiTextureType_DISPLACEMENT,N)
|
2008-11-16 21:56:45 +00:00
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
#define AI_MATKEY_MAPPINGMODE_V_LIGHTMAP(N) \
|
|
|
|
AI_MATKEY_MAPPINGMODE_V(aiTextureType_LIGHTMAP,N)
|
2008-11-16 21:56:45 +00:00
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
#define AI_MATKEY_MAPPINGMODE_V_REFLECTION(N) \
|
|
|
|
AI_MATKEY_MAPPINGMODE_V(aiTextureType_REFLECTION,N)
|
2008-11-16 21:56:45 +00:00
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
#define AI_MATKEY_MAPPINGMODE_V_UNKNOWN(N) \
|
|
|
|
AI_MATKEY_MAPPINGMODE_V(aiTextureType_UNKNOWN,N)
|
2008-11-16 21:56:45 +00:00
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
//! @endcond
|
2008-11-16 21:56:45 +00:00
|
|
|
// ---------------------------------------------------------------------------
|
2009-02-11 20:56:05 +00:00
|
|
|
/**
|
|
|
|
* @def AI_MATKEY_TEXMAP_AXIS
|
2009-01-15 17:15:05 +00:00
|
|
|
* Specifies the main mapping axis of the Nth texture of type "type".
|
2008-11-16 21:56:45 +00:00
|
|
|
* This applies to non-UV mapped textures. For spherical, cylindrical and
|
|
|
|
* planar this is the main axis of the corresponding geometric shape.
|
|
|
|
* <br>
|
2009-02-11 20:56:05 +00:00
|
|
|
* <b>Type:</b> float[3] (#aiVector3D)<br>
|
|
|
|
* <b>Default value if key is not defined:</b> <tt>aiVector3D(0.f,1.f,0.f)</tt> <br>
|
2008-11-16 21:56:45 +00:00
|
|
|
* <b>Requires:</b> AI_MATKEY_TEXTURE(type,N) and
|
2009-01-15 17:15:05 +00:00
|
|
|
* AI_MATKEY_MAPPING(type,N) != UV<br>
|
2008-11-16 21:56:45 +00:00
|
|
|
*/
|
|
|
|
// ---------------------------------------------------------------------------
|
2009-02-08 22:55:51 +00:00
|
|
|
#define AI_MATKEY_TEXMAP_AXIS(type, N) _AI_MATKEY_TEXMAP_AXIS_BASE,type,N
|
2008-11-16 21:56:45 +00:00
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
// For backward compatibility and simplicity
|
|
|
|
//! @cond MATS_DOC_FULL
|
|
|
|
#define AI_MATKEY_TEXMAP_AXIS_DIFFUSE(N) \
|
|
|
|
AI_MATKEY_TEXMAP_AXIS(aiTextureType_DIFFUSE,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXMAP_AXIS_SPECULAR(N) \
|
|
|
|
AI_MATKEY_TEXMAP_AXIS(aiTextureType_SPECULAR,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXMAP_AXIS_AMBIENT(N) \
|
|
|
|
AI_MATKEY_TEXMAP_AXIS(aiTextureType_AMBIENT,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXMAP_AXIS_EMISSIVE(N) \
|
|
|
|
AI_MATKEY_TEXMAP_AXIS(aiTextureType_EMISSIVE,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXMAP_AXIS_NORMALS(N) \
|
|
|
|
AI_MATKEY_TEXMAP_AXIS(aiTextureType_NORMALS,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXMAP_AXIS_HEIGHT(N) \
|
|
|
|
AI_MATKEY_TEXMAP_AXIS(aiTextureType_HEIGHT,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXMAP_AXIS_SHININESS(N) \
|
|
|
|
AI_MATKEY_TEXMAP_AXIS(aiTextureType_SHININESS,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXMAP_AXIS_OPACITY(N) \
|
|
|
|
AI_MATKEY_TEXMAP_AXIS(aiTextureType_OPACITY,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXMAP_AXIS_DISPLACEMENT(N) \
|
|
|
|
AI_MATKEY_TEXMAP_AXIS(aiTextureType_DISPLACEMENT,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXMAP_AXIS_LIGHTMAP(N) \
|
|
|
|
AI_MATKEY_TEXMAP_AXIS(aiTextureType_LIGHTMAP,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXMAP_AXIS_REFLECTION(N) \
|
|
|
|
AI_MATKEY_TEXMAP_AXIS(aiTextureType_REFLECTION,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXMAP_AXIS_UNKNOWN(N) \
|
|
|
|
AI_MATKEY_TEXMAP_AXIS(aiTextureType_UNKNOWN,N)
|
|
|
|
|
|
|
|
//! @endcond
|
2008-11-16 21:56:45 +00:00
|
|
|
// ---------------------------------------------------------------------------
|
2009-02-11 20:56:05 +00:00
|
|
|
/**
|
|
|
|
* @def AI_MATKEY_UVTRANSFORM
|
2009-01-15 17:15:05 +00:00
|
|
|
* Specifies how the UV mapping coordinates for the Nth texture of type
|
|
|
|
* "type" are transformed before they're used for mapping. This is an array
|
2008-11-16 21:56:45 +00:00
|
|
|
* of five floats - use the aiUVTransform structure for simplicity.
|
|
|
|
* <br>
|
|
|
|
* <b>Type:</b> Array of 5 floats<br>
|
2009-02-11 20:56:05 +00:00
|
|
|
* <b>Default value if key is not defined:</b><tt>0.f,0.f,1.f,1.f,0.f</tt><br>
|
2008-11-16 21:56:45 +00:00
|
|
|
* <b>Requires:</b> AI_MATKEY_TEXTURE(type,N) and
|
2009-01-15 17:15:05 +00:00
|
|
|
* AI_MATKEY_MAPPING(type,N) == UV<br>
|
2009-02-11 20:56:05 +00:00
|
|
|
* <b>Note:</b>Transformed 3D texture coordinates are not *yet* supported.
|
|
|
|
* And they'll probably never be, no format exports such rubbish.
|
2008-11-16 21:56:45 +00:00
|
|
|
*/
|
|
|
|
// ---------------------------------------------------------------------------
|
2009-02-08 22:55:51 +00:00
|
|
|
#define AI_MATKEY_UVTRANSFORM(type, N) _AI_MATKEY_UVTRANSFORM_BASE,type,N
|
2008-11-16 21:56:45 +00:00
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
// For backward compatibility and simplicity
|
|
|
|
//! @cond MATS_DOC_FULL
|
2008-11-16 21:56:45 +00:00
|
|
|
#define AI_MATKEY_UVTRANSFORM_DIFFUSE(N) \
|
|
|
|
AI_MATKEY_UVTRANSFORM(aiTextureType_DIFFUSE,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_UVTRANSFORM_SPECULAR(N) \
|
|
|
|
AI_MATKEY_UVTRANSFORM(aiTextureType_SPECULAR,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_UVTRANSFORM_AMBIENT(N) \
|
|
|
|
AI_MATKEY_UVTRANSFORM(aiTextureType_AMBIENT,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_UVTRANSFORM_EMISSIVE(N) \
|
|
|
|
AI_MATKEY_UVTRANSFORM(aiTextureType_EMISSIVE,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_UVTRANSFORM_NORMALS(N) \
|
|
|
|
AI_MATKEY_UVTRANSFORM(aiTextureType_NORMALS,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_UVTRANSFORM_HEIGHT(N) \
|
|
|
|
AI_MATKEY_UVTRANSFORM(aiTextureType_HEIGHT,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_UVTRANSFORM_SHININESS(N) \
|
|
|
|
AI_MATKEY_UVTRANSFORM(aiTextureType_SHININESS,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_UVTRANSFORM_OPACITY(N) \
|
|
|
|
AI_MATKEY_UVTRANSFORM(aiTextureType_OPACITY,N)
|
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
#define AI_MATKEY_UVTRANSFORM_DISPLACEMENT(N) \
|
|
|
|
AI_MATKEY_UVTRANSFORM(aiTextureType_DISPLACEMENT,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_UVTRANSFORM_LIGHTMAP(N) \
|
|
|
|
AI_MATKEY_UVTRANSFORM(aiTextureType_LIGHTMAP,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_UVTRANSFORM_REFLECTION(N) \
|
|
|
|
AI_MATKEY_UVTRANSFORM(aiTextureType_REFLECTION,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_UVTRANSFORM_UNKNOWN(N) \
|
|
|
|
AI_MATKEY_UVTRANSFORM(aiTextureType_UNKNOWN,N)
|
|
|
|
|
|
|
|
//! @endcond
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
/**
|
|
|
|
* @def AI_MATKEY_TEXFLAGS
|
|
|
|
* Specifies flags for the Nth texture of type 'type'. The key is a bitwise
|
|
|
|
* combination of the #aiTextureFlags enumerated values.
|
|
|
|
* <br>
|
|
|
|
* <b>Type:</b> int (#aiTextureFlags)<br>
|
|
|
|
* <b>Default value if key is not defined:</b> <tt>0</tt><br>
|
|
|
|
* <b>Requires:</b>#AI_MATKEY_TEXTURE(type,N)<br>
|
|
|
|
*/
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
#define AI_MATKEY_TEXFLAGS(type, N) _AI_MATKEY_TEXFLAGS_BASE,type,N
|
|
|
|
|
|
|
|
// For backward compatibility and simplicity
|
|
|
|
//! @cond MATS_DOC_FULL
|
|
|
|
#define AI_MATKEY_TEXFLAGS_DIFFUSE(N) \
|
|
|
|
AI_MATKEY_TEXFLAGS(aiTextureType_DIFFUSE,N)
|
2008-11-16 21:56:45 +00:00
|
|
|
|
2009-02-11 20:56:05 +00:00
|
|
|
#define AI_MATKEY_TEXFLAGS_SPECULAR(N) \
|
|
|
|
AI_MATKEY_TEXFLAGS(aiTextureType_SPECULAR,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXFLAGS_AMBIENT(N) \
|
|
|
|
AI_MATKEY_TEXFLAGS(aiTextureType_AMBIENT,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXFLAGS_EMISSIVE(N) \
|
|
|
|
AI_MATKEY_TEXFLAGS(aiTextureType_EMISSIVE,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXFLAGS_NORMALS(N) \
|
|
|
|
AI_MATKEY_TEXFLAGS(aiTextureType_NORMALS,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXFLAGS_HEIGHT(N) \
|
|
|
|
AI_MATKEY_TEXFLAGS(aiTextureType_HEIGHT,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXFLAGS_SHININESS(N) \
|
|
|
|
AI_MATKEY_TEXFLAGS(aiTextureType_SHININESS,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXFLAGS_OPACITY(N) \
|
|
|
|
AI_MATKEY_TEXFLAGS(aiTextureType_OPACITY,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXFLAGS_DISPLACEMENT(N) \
|
|
|
|
AI_MATKEY_TEXFLAGS(aiTextureType_DISPLACEMENT,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXFLAGS_LIGHTMAP(N) \
|
|
|
|
AI_MATKEY_TEXFLAGS(aiTextureType_LIGHTMAP,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXFLAGS_REFLECTION(N) \
|
|
|
|
AI_MATKEY_TEXFLAGS(aiTextureType_REFLECTION,N)
|
|
|
|
|
|
|
|
#define AI_MATKEY_TEXFLAGS_UNKNOWN(N) \
|
|
|
|
AI_MATKEY_TEXFLAGS(aiTextureType_UNKNOWN,N)
|
2008-11-16 21:56:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
#define AI_MATKEY_ORENNAYAR_ROUGHNESS "$shading.orennayar.roughness",0,0
|
|
|
|
#define AI_MATKEY_MINNAERT_DARKNESS "$shading.minnaert.darkness",0,0
|
|
|
|
#define AI_MATKEY_COOK_TORRANCE_PARAM "$shading.cookt.param",0,0
|
2008-05-05 12:36:31 +00:00
|
|
|
|
|
|
|
/** @def AI_MATKEY_GLOBAL_BACKGROUND_IMAGE
|
2009-02-11 20:56:05 +00:00
|
|
|
* Global property defined by some loaders. Contains the path to
|
|
|
|
* the image file to be used as background image.
|
|
|
|
*
|
|
|
|
* @deprecated
|
|
|
|
*/
|
2008-11-16 21:56:45 +00:00
|
|
|
#define AI_MATKEY_GLOBAL_BACKGROUND_IMAGE "$global.bg.image2d",0,0
|
2008-05-05 12:36:31 +00:00
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
2009-01-12 22:06:54 +00:00
|
|
|
/** @brief Retrieve a material property with a specific key from the material
|
2008-05-05 12:36:31 +00:00
|
|
|
*
|
|
|
|
* @param pMat Pointer to the input material. May not be NULL
|
|
|
|
* @param pKey Key to search for. One of the AI_MATKEY_XXX constants.
|
2009-01-15 17:15:05 +00:00
|
|
|
* @param type Specifies the type of the texture to be retrieved (
|
|
|
|
* e.g. diffuse, specular, height map ...)
|
|
|
|
* @param index Index of the texture to be retrieved.
|
2008-05-05 12:36:31 +00:00
|
|
|
* @param pPropOut Pointer to receive a pointer to a valid aiMaterialProperty
|
|
|
|
* structure or NULL if the key has not been found.
|
|
|
|
*/
|
|
|
|
// ---------------------------------------------------------------------------
|
2009-01-12 22:06:54 +00:00
|
|
|
ASSIMP_API C_ENUM aiReturn aiGetMaterialProperty(
|
2009-01-15 17:15:05 +00:00
|
|
|
const C_STRUCT aiMaterial* pMat,
|
2008-06-03 21:50:53 +00:00
|
|
|
const char* pKey,
|
2009-01-15 17:15:05 +00:00
|
|
|
C_ENUM aiTextureType type,
|
2008-11-16 21:56:45 +00:00
|
|
|
unsigned int index,
|
2008-06-03 21:50:53 +00:00
|
|
|
const C_STRUCT aiMaterialProperty** pPropOut);
|
2008-05-05 12:36:31 +00:00
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
2009-01-12 22:06:54 +00:00
|
|
|
/** @brief Retrieve an array of float values with a specific key
|
2008-05-05 12:36:31 +00:00
|
|
|
* from the material
|
|
|
|
*
|
2008-11-16 21:56:45 +00:00
|
|
|
* Pass one of the AI_MATKEY_XXX constants for the last three parameters (the
|
2009-01-15 17:15:05 +00:00
|
|
|
* example reads the #AI_MATKEY_UVTRANSFORM property of the first diffuse texture)
|
2009-01-13 18:58:07 +00:00
|
|
|
* @code
|
2008-11-16 21:56:45 +00:00
|
|
|
* aiUVTransform trafo;
|
|
|
|
* unsigned int max = sizeof(aiUVTransform);
|
|
|
|
* if (AI_SUCCESS != aiGetMaterialFloatArray(mat, AI_MATKEY_UVTRANSFORM(aiTextureType_DIFFUSE,0),
|
|
|
|
* (float*)&trafo, &max) || sizeof(aiUVTransform) != max)
|
|
|
|
* {
|
|
|
|
* // error handling
|
|
|
|
* }
|
|
|
|
* @endcode
|
|
|
|
*
|
2008-05-05 12:36:31 +00:00
|
|
|
* @param pMat Pointer to the input material. May not be NULL
|
|
|
|
* @param pKey Key to search for. One of the AI_MATKEY_XXX constants.
|
|
|
|
* @param pOut Pointer to a buffer to receive the result.
|
|
|
|
* @param pMax Specifies the size of the given buffer, in float's.
|
|
|
|
* Receives the number of values (not bytes!) read.
|
2008-11-16 21:56:45 +00:00
|
|
|
* @param type (see the code sample above)
|
|
|
|
* @param index (see the code sample above)
|
|
|
|
* @return Specifies whether the key has been found. If not, the output
|
|
|
|
* arrays remains unmodified and pMax is set to 0.
|
2008-05-05 12:36:31 +00:00
|
|
|
*/
|
|
|
|
// ---------------------------------------------------------------------------
|
2009-01-12 22:06:54 +00:00
|
|
|
ASSIMP_API C_ENUM aiReturn aiGetMaterialFloatArray(
|
2009-01-15 17:15:05 +00:00
|
|
|
const C_STRUCT aiMaterial* pMat,
|
2008-06-03 21:50:53 +00:00
|
|
|
const char* pKey,
|
2009-01-15 17:15:05 +00:00
|
|
|
unsigned int type,
|
2008-11-16 21:56:45 +00:00
|
|
|
unsigned int index,
|
2008-06-03 21:50:53 +00:00
|
|
|
float* pOut,
|
|
|
|
unsigned int* pMax);
|
2008-05-05 12:36:31 +00:00
|
|
|
|
2008-11-16 21:56:45 +00:00
|
|
|
|
2008-05-05 12:36:31 +00:00
|
|
|
#ifdef __cplusplus
|
2008-11-16 21:56:45 +00:00
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
2009-01-12 22:06:54 +00:00
|
|
|
/** @brief Retrieve a single float property with a specific key from the material.
|
2008-11-16 21:56:45 +00:00
|
|
|
*
|
|
|
|
* Pass one of the AI_MATKEY_XXX constants for the last three parameters (the
|
2009-01-15 17:15:05 +00:00
|
|
|
* example reads the #AI_MATKEY_SHININESS_STRENGTH property of the first diffuse texture)
|
2009-01-13 18:58:07 +00:00
|
|
|
* @code
|
2008-11-16 21:56:45 +00:00
|
|
|
* float specStrength = 1.f; // default value, remains unmodified if we fail.
|
2009-01-15 17:15:05 +00:00
|
|
|
* aiGetMaterialFloat(mat, AI_MATKEY_SHININESS_STRENGTH,
|
2008-11-16 21:56:45 +00:00
|
|
|
* (float*)&specStrength);
|
|
|
|
* @endcode
|
|
|
|
*
|
|
|
|
* @param pMat Pointer to the input material. May not be NULL
|
|
|
|
* @param pKey Key to search for. One of the AI_MATKEY_XXX constants.
|
|
|
|
* @param pOut Receives the output float.
|
|
|
|
* @param type (see the code sample above)
|
|
|
|
* @param index (see the code sample above)
|
|
|
|
* @return Specifies whether the key has been found. If not, the output
|
|
|
|
* float remains unmodified.
|
|
|
|
*/
|
|
|
|
// ---------------------------------------------------------------------------
|
2009-01-12 22:06:54 +00:00
|
|
|
inline aiReturn aiGetMaterialFloat(const aiMaterial* pMat,
|
2008-11-16 21:56:45 +00:00
|
|
|
const char* pKey,
|
|
|
|
unsigned int type,
|
2009-01-15 17:15:05 +00:00
|
|
|
unsigned int index,
|
2008-11-16 21:56:45 +00:00
|
|
|
float* pOut)
|
|
|
|
{
|
|
|
|
return aiGetMaterialFloatArray(pMat,pKey,type,index,pOut,(unsigned int*)0x0);
|
|
|
|
}
|
|
|
|
|
2008-05-05 12:36:31 +00:00
|
|
|
#else
|
2008-11-16 21:56:45 +00:00
|
|
|
|
|
|
|
// Use our friend, the C preprocessor
|
|
|
|
#define aiGetMaterialFloat (pMat, type, index, pKey, pOut) \
|
|
|
|
aiGetMaterialFloatArray(pMat, type, index, pKey, pOut, NULL)
|
|
|
|
|
2008-05-05 12:36:31 +00:00
|
|
|
#endif //!__cplusplus
|
|
|
|
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
2009-01-12 22:06:54 +00:00
|
|
|
/** @brief Retrieve an array of integer values with a specific key
|
2008-11-16 21:56:45 +00:00
|
|
|
* from a material
|
2008-05-05 12:36:31 +00:00
|
|
|
*
|
2008-11-16 21:56:45 +00:00
|
|
|
* See the sample for aiGetMaterialFloatArray for more information.
|
2008-05-05 12:36:31 +00:00
|
|
|
*/
|
|
|
|
// ---------------------------------------------------------------------------
|
2009-01-12 22:06:54 +00:00
|
|
|
ASSIMP_API C_ENUM aiReturn aiGetMaterialIntegerArray(const C_STRUCT aiMaterial* pMat,
|
2008-06-03 21:50:53 +00:00
|
|
|
const char* pKey,
|
2009-01-15 17:15:05 +00:00
|
|
|
unsigned int type,
|
|
|
|
unsigned int index,
|
2008-06-03 21:50:53 +00:00
|
|
|
int* pOut,
|
|
|
|
unsigned int* pMax);
|
2008-05-05 12:36:31 +00:00
|
|
|
|
2008-11-16 21:56:45 +00:00
|
|
|
|
2008-05-05 12:36:31 +00:00
|
|
|
#ifdef __cplusplus
|
2008-11-16 21:56:45 +00:00
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
2009-01-12 22:06:54 +00:00
|
|
|
/** @brief Retrieve an integer property with a specific key from a material
|
2008-11-16 21:56:45 +00:00
|
|
|
*
|
|
|
|
* See the sample for aiGetMaterialFloat for more information.
|
|
|
|
*/
|
|
|
|
// ---------------------------------------------------------------------------
|
2008-05-09 17:24:28 +00:00
|
|
|
inline aiReturn aiGetMaterialInteger(const C_STRUCT aiMaterial* pMat,
|
2008-11-16 21:56:45 +00:00
|
|
|
const char* pKey,
|
|
|
|
unsigned int type,
|
2009-01-15 17:15:05 +00:00
|
|
|
unsigned int index,
|
2008-11-16 21:56:45 +00:00
|
|
|
int* pOut)
|
|
|
|
{
|
|
|
|
return aiGetMaterialIntegerArray(pMat,pKey,type,index,pOut,(unsigned int*)0x0);
|
|
|
|
}
|
|
|
|
|
2008-05-05 12:36:31 +00:00
|
|
|
#else
|
2008-11-16 21:56:45 +00:00
|
|
|
|
2008-05-05 12:36:31 +00:00
|
|
|
// use our friend, the C preprocessor
|
2008-11-16 21:56:45 +00:00
|
|
|
#define aiGetMaterialInteger (pMat, type, index, pKey, pOut) \
|
|
|
|
aiGetMaterialIntegerArray(pMat, type, index, pKey, pOut, NULL)
|
|
|
|
|
2008-05-05 12:36:31 +00:00
|
|
|
#endif //!__cplusplus
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
2009-01-12 22:06:54 +00:00
|
|
|
/** @brief Retrieve a color value from the material property table
|
2008-05-05 12:36:31 +00:00
|
|
|
*
|
2008-11-16 21:56:45 +00:00
|
|
|
* See the sample for aiGetMaterialFloat for more information.
|
2008-05-05 12:36:31 +00:00
|
|
|
*/
|
|
|
|
// ---------------------------------------------------------------------------
|
2009-01-12 22:06:54 +00:00
|
|
|
ASSIMP_API C_ENUM aiReturn aiGetMaterialColor(const C_STRUCT aiMaterial* pMat,
|
2008-06-03 21:50:53 +00:00
|
|
|
const char* pKey,
|
2009-01-15 17:15:05 +00:00
|
|
|
unsigned int type,
|
2008-11-16 21:56:45 +00:00
|
|
|
unsigned int index,
|
2009-01-15 17:15:05 +00:00
|
|
|
C_STRUCT aiColor4D* pOut);
|
2008-05-05 12:36:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
2009-01-12 22:06:54 +00:00
|
|
|
/** @brief Retrieve a string from the material property table
|
2008-05-05 12:36:31 +00:00
|
|
|
*
|
2008-11-16 21:56:45 +00:00
|
|
|
* See the sample for aiGetMaterialFloat for more information.
|
2008-05-05 12:36:31 +00:00
|
|
|
*/
|
|
|
|
// ---------------------------------------------------------------------------
|
2009-01-12 22:06:54 +00:00
|
|
|
ASSIMP_API C_ENUM aiReturn aiGetMaterialString(const C_STRUCT aiMaterial* pMat,
|
2008-06-03 21:50:53 +00:00
|
|
|
const char* pKey,
|
2009-01-15 17:15:05 +00:00
|
|
|
unsigned int type,
|
2008-11-16 21:56:45 +00:00
|
|
|
unsigned int index,
|
2009-01-12 22:06:54 +00:00
|
|
|
C_STRUCT aiString* pOut);
|
2008-05-09 17:24:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
2009-01-12 22:06:54 +00:00
|
|
|
/** @brief Helper function to get a texture from a material structure.
|
2008-05-09 17:24:28 +00:00
|
|
|
*
|
2009-02-11 20:56:05 +00:00
|
|
|
* This function is provided just for convenience. You could also read the
|
|
|
|
* texture by reading all of its properties manually. This function bundles
|
|
|
|
* all of them in a huge function-monster.
|
|
|
|
*
|
|
|
|
* @param[in] mat Pointer to the input material. May not be NULL
|
|
|
|
* @param[in] type Specifies the type of the texture to read (e.g. diffuse,
|
|
|
|
* specular, height map ...).
|
|
|
|
* @param[in] index Index of the texture layer to be read. The function
|
|
|
|
* fails if the requested layer is not available.
|
|
|
|
* @param[out] path Receives the output path
|
|
|
|
* This parameter mist be non-null.
|
|
|
|
* @param mapping The texture mapping mode to be used.
|
|
|
|
* Pass NULL if you'e not interested in this information.
|
|
|
|
* @param[out] uvindex For UV-mapped textures: receives the index of the UV
|
|
|
|
* source channel. Unmodified otherwise.
|
|
|
|
* Pass NULL if you'e not interested in this information.
|
|
|
|
* @param[out] blend Receives the blend factor for the texture
|
|
|
|
* Pass NULL if you'e not interested in this information.
|
|
|
|
* @param[out] op Receives the texture blend operation to be perform between
|
|
|
|
* this texture and the previous texture.
|
|
|
|
* Pass NULL if you'e not interested in this information.
|
|
|
|
* @param[out] mapmode Receives the mapping modes to be used for the texture.
|
|
|
|
* Pass NULL if you'e not interested in this information. Otherwise,
|
|
|
|
* pass a pointer to an array of two aiTextureMapMode's (one for each
|
|
|
|
* axis, UV order).
|
|
|
|
* @return AI_SUCCESS on success, something else otherwise. Have fun.
|
2008-05-09 17:24:28 +00:00
|
|
|
*/
|
|
|
|
// ---------------------------------------------------------------------------
|
2008-06-03 21:50:53 +00:00
|
|
|
#ifdef __cplusplus
|
2008-11-16 21:56:45 +00:00
|
|
|
ASSIMP_API aiReturn aiGetMaterialTexture(const C_STRUCT aiMaterial* mat,
|
2009-02-11 20:56:05 +00:00
|
|
|
aiTextureType type,
|
2008-11-16 21:56:45 +00:00
|
|
|
unsigned int index,
|
2009-01-12 22:06:54 +00:00
|
|
|
aiString* path,
|
2009-02-11 20:56:05 +00:00
|
|
|
aiTextureMapping* mapping = NULL,
|
2008-11-16 21:56:45 +00:00
|
|
|
unsigned int* uvindex = NULL,
|
|
|
|
float* blend = NULL,
|
|
|
|
aiTextureOp* op = NULL,
|
2009-02-11 20:56:05 +00:00
|
|
|
aiTextureMapMode* mapmode = NULL,
|
|
|
|
unsigned int* flags = NULL);
|
2008-06-03 21:50:53 +00:00
|
|
|
#else
|
2009-01-12 22:06:54 +00:00
|
|
|
C_ENUM aiReturn aiGetMaterialTexture(const C_STRUCT aiMaterial* mat,
|
|
|
|
C_ENUM aiTextureType type,
|
2008-11-16 21:56:45 +00:00
|
|
|
unsigned int index,
|
|
|
|
C_STRUCT aiString* path,
|
2009-02-11 20:56:05 +00:00
|
|
|
C_ENUM aiTextureMapping* mapping /*= NULL*/,
|
2009-01-12 22:06:54 +00:00
|
|
|
unsigned int* uvindex /*= NULL*/,
|
|
|
|
float* blend /*= NULL*/,
|
|
|
|
C_ENUM aiTextureOp* op /*= NULL*/,
|
2009-02-11 20:56:05 +00:00
|
|
|
C_ENUM aiTextureMapMode* mapmode /*= NULL*/,
|
|
|
|
unsigned int* flags /*= NULL*/);
|
2008-06-03 21:50:53 +00:00
|
|
|
#endif // !#ifdef __cplusplus
|
2008-05-05 12:36:31 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
2008-06-03 21:50:53 +00:00
|
|
|
|
|
|
|
#include "aiMaterial.inl"
|
|
|
|
|
2008-05-05 12:36:31 +00:00
|
|
|
#endif //!__cplusplus
|
|
|
|
#endif //!!AI_MATERIAL_H_INC
|