Loading...
Searching...
No Matches
SMaterial.h
Go to the documentation of this file.
// Copyright (C) 2002-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __S_MATERIAL_H_INCLUDED__
#define __S_MATERIAL_H_INCLUDED__
#include "SColor.h"
#include "matrix4.h"
#include "irrArray.h"
#include "irrMath.h"
#include "EMaterialTypes.h"
#include "EMaterialFlags.h"
#include "SMaterialLayer.h"
namespace irr
{
namespace video
{
class ITexture;
enum E_BLEND_FACTOR
{
EBF_ZERO = 0,
EBF_ONE,
EBF_DST_COLOR,
EBF_ONE_MINUS_DST_COLOR,
EBF_SRC_COLOR,
EBF_ONE_MINUS_SRC_COLOR,
EBF_SRC_ALPHA,
EBF_ONE_MINUS_SRC_ALPHA,
EBF_DST_ALPHA,
EBF_ONE_MINUS_DST_ALPHA,
EBF_SRC_ALPHA_SATURATE
};
enum E_BLEND_OPERATION
{
EBO_NONE = 0,
EBO_ADD,
EBO_SUBTRACT,
EBO_REVSUBTRACT,
EBO_MIN,
EBO_MAX,
EBO_MIN_FACTOR,
EBO_MAX_FACTOR,
EBO_MIN_ALPHA,
EBO_MAX_ALPHA
};
enum E_MODULATE_FUNC
{
EMFN_MODULATE_1X = 1,
EMFN_MODULATE_2X = 2,
EMFN_MODULATE_4X = 4
};
enum E_COMPARISON_FUNC
{
ECFN_NEVER=0,
ECFN_LESSEQUAL=1,
ECFN_EQUAL=2,
ECFN_LESS,
ECFN_NOTEQUAL,
ECFN_GREATEREQUAL,
ECFN_GREATER,
ECFN_ALWAYS
};
enum E_COLOR_PLANE
{
ECP_NONE=0,
ECP_ALPHA=1,
ECP_RED=2,
ECP_GREEN=4,
ECP_BLUE=8,
ECP_RGB=14,
ECP_ALL=15
};
enum E_ALPHA_SOURCE
{
EAS_NONE=0,
EAS_VERTEX_COLOR,
EAS_TEXTURE
};
inline f32 pack_textureBlendFunc ( const E_BLEND_FACTOR srcFact, const E_BLEND_FACTOR dstFact, const E_MODULATE_FUNC modulate=EMFN_MODULATE_1X, const u32 alphaSource=EAS_TEXTURE )
{
const u32 tmp = (alphaSource << 12) | (modulate << 8) | (srcFact << 4) | dstFact;
return FR(tmp);
}
inline void unpack_textureBlendFunc ( E_BLEND_FACTOR &srcFact, E_BLEND_FACTOR &dstFact,
E_MODULATE_FUNC &modulo, u32& alphaSource, const f32 param )
{
const u32 state = IR(param);
alphaSource = (state & 0x0000F000) >> 12;
modulo = E_MODULATE_FUNC( ( state & 0x00000F00 ) >> 8 );
srcFact = E_BLEND_FACTOR ( ( state & 0x000000F0 ) >> 4 );
dstFact = E_BLEND_FACTOR ( ( state & 0x0000000F ) );
}
inline bool textureBlendFunc_hasAlpha ( const E_BLEND_FACTOR factor )
{
switch ( factor )
{
case EBF_SRC_ALPHA:
case EBF_ONE_MINUS_SRC_ALPHA:
case EBF_DST_ALPHA:
case EBF_ONE_MINUS_DST_ALPHA:
case EBF_SRC_ALPHA_SATURATE:
return true;
default:
return false;
}
}
enum E_ANTI_ALIASING_MODE
{
EAAM_OFF=0,
EAAM_SIMPLE=1,
EAAM_QUALITY=3,
EAAM_LINE_SMOOTH=4,
EAAM_POINT_SMOOTH=8,
EAAM_FULL_BASIC=15,
EAAM_ALPHA_TO_COVERAGE=16
};
enum E_COLOR_MATERIAL
{
ECM_NONE=0,
ECM_DIFFUSE,
ECM_AMBIENT,
ECM_EMISSIVE,
ECM_SPECULAR,
ECM_DIFFUSE_AND_AMBIENT
};
enum E_POLYGON_OFFSET
{
EPO_BACK=0,
EPO_FRONT=1
};
const c8* const PolygonOffsetDirectionNames[] =
{
"Back",
"Front",
0
};
const u32 MATERIAL_MAX_TEXTURES = _IRR_MATERIAL_MAX_TEXTURES_;
class SMaterial
{
public:
SMaterial()
: MaterialType(EMT_SOLID), AmbientColor(255,255,255,255), DiffuseColor(255,255,255,255),
EmissiveColor(0,0,0,0), SpecularColor(255,255,255,255),
Shininess(0.0f), MaterialTypeParam(0.0f), MaterialTypeParam2(0.0f), Thickness(1.0f),
ZBuffer(ECFN_LESSEQUAL), AntiAliasing(EAAM_SIMPLE), ColorMask(ECP_ALL),
ColorMaterial(ECM_DIFFUSE), BlendOperation(EBO_NONE),
PolygonOffsetFactor(0), PolygonOffsetDirection(EPO_FRONT),
Wireframe(false), PointCloud(false), GouraudShading(true),
Lighting(true), ZWriteEnable(true), BackfaceCulling(true), FrontfaceCulling(false),
FogEnable(false), NormalizeNormals(false), UseMipMaps(true)
{ }
SMaterial(const SMaterial& other)
{
// These pointers are checked during assignment
for (u32 i=0; i<MATERIAL_MAX_TEXTURES; ++i)
TextureLayer[i].TextureMatrix = 0;
*this = other;
}
SMaterial& operator=(const SMaterial& other)
{
// Check for self-assignment!
if (this == &other)
return *this;
MaterialType = other.MaterialType;
AmbientColor = other.AmbientColor;
DiffuseColor = other.DiffuseColor;
EmissiveColor = other.EmissiveColor;
SpecularColor = other.SpecularColor;
Shininess = other.Shininess;
MaterialTypeParam = other.MaterialTypeParam;
MaterialTypeParam2 = other.MaterialTypeParam2;
Thickness = other.Thickness;
for (u32 i=0; i<MATERIAL_MAX_TEXTURES; ++i)
{
TextureLayer[i] = other.TextureLayer[i];
}
Wireframe = other.Wireframe;
PointCloud = other.PointCloud;
GouraudShading = other.GouraudShading;
Lighting = other.Lighting;
ZWriteEnable = other.ZWriteEnable;
BackfaceCulling = other.BackfaceCulling;
FrontfaceCulling = other.FrontfaceCulling;
FogEnable = other.FogEnable;
NormalizeNormals = other.NormalizeNormals;
ZBuffer = other.ZBuffer;
AntiAliasing = other.AntiAliasing;
ColorMask = other.ColorMask;
ColorMaterial = other.ColorMaterial;
BlendOperation = other.BlendOperation;
PolygonOffsetFactor = other.PolygonOffsetFactor;
PolygonOffsetDirection = other.PolygonOffsetDirection;
UseMipMaps = other.UseMipMaps;
return *this;
}
SMaterialLayer TextureLayer[MATERIAL_MAX_TEXTURES];
E_MATERIAL_TYPE MaterialType;
SColor AmbientColor;
SColor DiffuseColor;
SColor EmissiveColor;
SColor SpecularColor;
f32 Shininess;
f32 MaterialTypeParam;
f32 MaterialTypeParam2;
f32 Thickness;
u8 ZBuffer;
u8 AntiAliasing;
u8 ColorMask:4;
u8 ColorMaterial:3;
E_BLEND_OPERATION BlendOperation:4;
u8 PolygonOffsetFactor:3;
E_POLYGON_OFFSET PolygonOffsetDirection:1;
bool Wireframe:1;
bool PointCloud:1;
bool GouraudShading:1;
bool Lighting:1;
bool ZWriteEnable:1;
bool BackfaceCulling:1;
bool FrontfaceCulling:1;
bool FogEnable:1;
bool NormalizeNormals:1;
bool UseMipMaps:1;
core::matrix4& getTextureMatrix(u32 i)
{
return TextureLayer[i].getTextureMatrix();
}
const core::matrix4& getTextureMatrix(u32 i) const
{
if (i<MATERIAL_MAX_TEXTURES)
return TextureLayer[i].getTextureMatrix();
else
return core::IdentityMatrix;
}
void setTextureMatrix(u32 i, const core::matrix4& mat)
{
if (i>=MATERIAL_MAX_TEXTURES)
return;
TextureLayer[i].setTextureMatrix(mat);
}
ITexture* getTexture(u32 i) const
{
return i < MATERIAL_MAX_TEXTURES ? TextureLayer[i].Texture : 0;
}
void setTexture(u32 i, ITexture* tex)
{
if (i>=MATERIAL_MAX_TEXTURES)
return;
TextureLayer[i].Texture = tex;
}
void setFlag(E_MATERIAL_FLAG flag, bool value)
{
switch (flag)
{
case EMF_WIREFRAME:
Wireframe = value; break;
case EMF_POINTCLOUD:
PointCloud = value; break;
case EMF_GOURAUD_SHADING:
GouraudShading = value; break;
case EMF_LIGHTING:
Lighting = value; break;
case EMF_ZBUFFER:
ZBuffer = value; break;
case EMF_ZWRITE_ENABLE:
ZWriteEnable = value; break;
case EMF_BACK_FACE_CULLING:
BackfaceCulling = value; break;
case EMF_FRONT_FACE_CULLING:
FrontfaceCulling = value; break;
case EMF_BILINEAR_FILTER:
{
for (u32 i=0; i<MATERIAL_MAX_TEXTURES; ++i)
TextureLayer[i].BilinearFilter = value;
}
break;
case EMF_TRILINEAR_FILTER:
{
for (u32 i=0; i<MATERIAL_MAX_TEXTURES; ++i)
TextureLayer[i].TrilinearFilter = value;
}
break;
case EMF_ANISOTROPIC_FILTER:
{
if (value)
for (u32 i=0; i<MATERIAL_MAX_TEXTURES; ++i)
TextureLayer[i].AnisotropicFilter = 0xFF;
else
for (u32 i=0; i<MATERIAL_MAX_TEXTURES; ++i)
TextureLayer[i].AnisotropicFilter = 0;
}
break;
case EMF_FOG_ENABLE:
FogEnable = value; break;
case EMF_NORMALIZE_NORMALS:
NormalizeNormals = value; break;
case EMF_TEXTURE_WRAP:
{
for (u32 i=0; i<MATERIAL_MAX_TEXTURES; ++i)
{
TextureLayer[i].TextureWrapU = (E_TEXTURE_CLAMP)value;
TextureLayer[i].TextureWrapV = (E_TEXTURE_CLAMP)value;
}
}
break;
case EMF_ANTI_ALIASING:
AntiAliasing = value?EAAM_SIMPLE:EAAM_OFF; break;
case EMF_COLOR_MASK:
ColorMask = value?ECP_ALL:ECP_NONE; break;
case EMF_COLOR_MATERIAL:
ColorMaterial = value?ECM_DIFFUSE:ECM_NONE; break;
case EMF_USE_MIP_MAPS:
UseMipMaps = value; break;
case EMF_BLEND_OPERATION:
BlendOperation = value?EBO_ADD:EBO_NONE; break;
case EMF_POLYGON_OFFSET:
PolygonOffsetFactor = value?1:0;
PolygonOffsetDirection = EPO_BACK;
break;
default:
break;
}
}
bool getFlag(E_MATERIAL_FLAG flag) const
{
switch (flag)
{
case EMF_WIREFRAME:
return Wireframe;
case EMF_POINTCLOUD:
return PointCloud;
case EMF_GOURAUD_SHADING:
return GouraudShading;
case EMF_LIGHTING:
return Lighting;
case EMF_ZBUFFER:
return ZBuffer!=ECFN_NEVER;
case EMF_ZWRITE_ENABLE:
return ZWriteEnable;
case EMF_BACK_FACE_CULLING:
return BackfaceCulling;
case EMF_FRONT_FACE_CULLING:
return FrontfaceCulling;
case EMF_BILINEAR_FILTER:
return TextureLayer[0].BilinearFilter;
case EMF_TRILINEAR_FILTER:
return TextureLayer[0].TrilinearFilter;
case EMF_ANISOTROPIC_FILTER:
return TextureLayer[0].AnisotropicFilter!=0;
case EMF_FOG_ENABLE:
return FogEnable;
case EMF_NORMALIZE_NORMALS:
return NormalizeNormals;
case EMF_TEXTURE_WRAP:
return !(TextureLayer[0].TextureWrapU ||
TextureLayer[0].TextureWrapV ||
TextureLayer[1].TextureWrapU ||
TextureLayer[1].TextureWrapV ||
TextureLayer[2].TextureWrapU ||
TextureLayer[2].TextureWrapV ||
TextureLayer[3].TextureWrapU ||
TextureLayer[3].TextureWrapV);
case EMF_ANTI_ALIASING:
return (AntiAliasing==1);
case EMF_COLOR_MASK:
return (ColorMask!=ECP_NONE);
case EMF_COLOR_MATERIAL:
return (ColorMaterial != ECM_NONE);
case EMF_USE_MIP_MAPS:
return UseMipMaps;
case EMF_BLEND_OPERATION:
return BlendOperation != EBO_NONE;
case EMF_POLYGON_OFFSET:
return PolygonOffsetFactor != 0;
}
return false;
}
inline bool operator!=(const SMaterial& b) const
{
bool different =
MaterialType != b.MaterialType ||
AmbientColor != b.AmbientColor ||
DiffuseColor != b.DiffuseColor ||
EmissiveColor != b.EmissiveColor ||
SpecularColor != b.SpecularColor ||
Shininess != b.Shininess ||
MaterialTypeParam != b.MaterialTypeParam ||
MaterialTypeParam2 != b.MaterialTypeParam2 ||
Thickness != b.Thickness ||
Wireframe != b.Wireframe ||
PointCloud != b.PointCloud ||
GouraudShading != b.GouraudShading ||
Lighting != b.Lighting ||
ZBuffer != b.ZBuffer ||
ZWriteEnable != b.ZWriteEnable ||
BackfaceCulling != b.BackfaceCulling ||
FrontfaceCulling != b.FrontfaceCulling ||
FogEnable != b.FogEnable ||
NormalizeNormals != b.NormalizeNormals ||
AntiAliasing != b.AntiAliasing ||
ColorMask != b.ColorMask ||
ColorMaterial != b.ColorMaterial ||
BlendOperation != b.BlendOperation ||
PolygonOffsetFactor != b.PolygonOffsetFactor ||
PolygonOffsetDirection != b.PolygonOffsetDirection ||
UseMipMaps != b.UseMipMaps;
for (u32 i=0; (i<MATERIAL_MAX_TEXTURES) && !different; ++i)
{
different |= (TextureLayer[i] != b.TextureLayer[i]);
}
return different;
}
inline bool operator==(const SMaterial& b) const
{ return !(b!=*this); }
bool isTransparent() const
{
return MaterialType==EMT_TRANSPARENT_ADD_COLOR ||
MaterialType==EMT_TRANSPARENT_ALPHA_CHANNEL ||
MaterialType==EMT_TRANSPARENT_VERTEX_ALPHA ||
MaterialType==EMT_TRANSPARENT_REFLECTION_2_LAYER;
}
};
IRRLICHT_API extern SMaterial IdentityMaterial;
} // end namespace video
} // end namespace irr
#endif
EMaterialFlags.h
EMaterialTypes.h
_IRR_MATERIAL_MAX_TEXTURES_
#define _IRR_MATERIAL_MAX_TEXTURES_
Maximum number of texture an SMaterial can have, up to 8 are supported by Irrlicht.
Definition IrrCompileConfig.h:121
IRRLICHT_API
#define IRRLICHT_API
Set FPU settings.
Definition IrrCompileConfig.h:694
SColor.h
SMaterialLayer.h
irr::video::ITexture
Interface of a Video Driver dependent Texture.
Definition ITexture.h:99
irr::video::SColor
Class representing a 32 bit ARGB color.
Definition SColor.h:202
irr::video::SMaterial::EmissiveColor
SColor EmissiveColor
Light emitted by this material. Default is to emit no light.
Definition SMaterial.h:313
irr::video::SMaterial::ZWriteEnable
bool ZWriteEnable
Is the zbuffer writeable or is it read-only. Default: true.
Definition SMaterial.h:422
irr::video::SMaterial::ColorMaterial
u8 ColorMaterial
Defines the interpretation of vertex color in the lighting equation.
Definition SMaterial.h:387
irr::video::SMaterial::SpecularColor
SColor SpecularColor
How much specular light (highlights from a light) is reflected.
Definition SMaterial.h:318
irr::video::SMaterial::TextureLayer
SMaterialLayer TextureLayer[MATERIAL_MAX_TEXTURES]
Texture layer array.
Definition SMaterial.h:297
irr::video::SMaterial::isTransparent
bool isTransparent() const
Definition SMaterial.h:670
irr::video::SMaterial::operator==
bool operator==(const SMaterial &b) const
Equality operator.
Definition SMaterial.h:667
irr::video::SMaterial::getTextureMatrix
const core::matrix4 & getTextureMatrix(u32 i) const
Gets the immutable texture transformation matrix for level i.
Definition SMaterial.h:452
irr::video::SMaterial::getFlag
bool getFlag(E_MATERIAL_FLAG flag) const
Gets the Material flag.
Definition SMaterial.h:569
irr::video::SMaterial::MaterialTypeParam2
f32 MaterialTypeParam2
Second free parameter, dependent on the material type.
Definition SMaterial.h:359
irr::video::SMaterial::AmbientColor
SColor AmbientColor
How much ambient light (a global light) is reflected by this material.
Definition SMaterial.h:306
irr::video::SMaterial::setTexture
void setTexture(u32 i, ITexture *tex)
Sets the i-th texture.
Definition SMaterial.h:482
irr::video::SMaterial::PointCloud
bool PointCloud
Draw as point cloud or filled triangles? Default: false.
Definition SMaterial.h:410
irr::video::SMaterial::setFlag
void setFlag(E_MATERIAL_FLAG flag, bool value)
Sets the Material flag to the given value.
Definition SMaterial.h:492
irr::video::SMaterial::getTextureMatrix
core::matrix4 & getTextureMatrix(u32 i)
Gets the texture transformation matrix for level i.
Definition SMaterial.h:444
irr::video::SMaterial::ColorMask
u8 ColorMask
Defines the enabled color planes.
Definition SMaterial.h:379
irr::video::SMaterial::Thickness
f32 Thickness
Thickness of non-3dimensional elements such as lines and points.
Definition SMaterial.h:362
irr::video::SMaterial::SMaterial
SMaterial(const SMaterial &other)
Copy constructor.
Definition SMaterial.h:244
irr::video::SMaterial::setTextureMatrix
void setTextureMatrix(u32 i, const core::matrix4 &mat)
Sets the i-th texture transformation matrix.
Definition SMaterial.h:463
irr::video::SMaterial::Wireframe
bool Wireframe
Draw as wireframe or filled triangles? Default: false.
Definition SMaterial.h:407
irr::video::SMaterial::ZBuffer
u8 ZBuffer
Is the ZBuffer enabled? Default: ECFN_LESSEQUAL.
Definition SMaterial.h:366
irr::video::SMaterial::Shininess
f32 Shininess
Value affecting the size of specular highlights.
Definition SMaterial.h:350
irr::video::SMaterial::MaterialType
E_MATERIAL_TYPE MaterialType
Type of the material. Specifies how everything is blended together.
Definition SMaterial.h:300
irr::video::SMaterial::AntiAliasing
u8 AntiAliasing
Sets the antialiasing mode.
Definition SMaterial.h:372
irr::video::SMaterial::UseMipMaps
bool UseMipMaps
Shall mipmaps be used if available.
Definition SMaterial.h:439
irr::video::SMaterial::operator=
SMaterial & operator=(const SMaterial &other)
Assignment operator.
Definition SMaterial.h:254
irr::video::SMaterial::FrontfaceCulling
bool FrontfaceCulling
Is frontface culling enabled? Default: false.
Definition SMaterial.h:428
irr::video::SMaterial::FogEnable
bool FogEnable
Is fog enabled? Default: false.
Definition SMaterial.h:431
irr::video::SMaterial::getTexture
ITexture * getTexture(u32 i) const
Gets the i-th texture.
Definition SMaterial.h:473
irr::video::SMaterial::PolygonOffsetDirection
E_POLYGON_OFFSET PolygonOffsetDirection
Flag defining the direction the polygon offset is applied to.
Definition SMaterial.h:401
irr::video::SMaterial::GouraudShading
bool GouraudShading
Flat or Gouraud shading? Default: true.
Definition SMaterial.h:413
irr::video::SMaterial::DiffuseColor
SColor DiffuseColor
How much diffuse light coming from a light source is reflected by this material.
Definition SMaterial.h:310
irr::video::SMaterial::SMaterial
SMaterial()
Default constructor. Creates a solid, lit material with white colors.
Definition SMaterial.h:230
irr::video::SMaterial::operator!=
bool operator!=(const SMaterial &b) const
Inequality operator.
Definition SMaterial.h:628
irr::video::SMaterial::NormalizeNormals
bool NormalizeNormals
Should normals be normalized?
Definition SMaterial.h:435
irr::video::SMaterial::MaterialTypeParam
f32 MaterialTypeParam
Free parameter, dependent on the material type.
Definition SMaterial.h:355
irr::video::SMaterial::BackfaceCulling
bool BackfaceCulling
Is backface culling enabled? Default: true.
Definition SMaterial.h:425
irr::video::SMaterial::PolygonOffsetFactor
u8 PolygonOffsetFactor
Factor specifying how far the polygon offset should be made.
Definition SMaterial.h:397
irr::video::SMaterial::BlendOperation
E_BLEND_OPERATION BlendOperation
Store the blend operation of choice.
Definition SMaterial.h:392
irr::video::SMaterial::Lighting
bool Lighting
Will this material be lighted? Default: true.
Definition SMaterial.h:416
irr::video::SMaterialLayer
Struct for holding material parameters which exist per texture layer.
Definition SMaterialLayer.h:49
irrArray.h
irrMath.h
FR
f32 FR(u32 x)
Floating-point representation of an integer value.
Definition irrMath.h:363
IR
u32 IR(f32 x)
Definition irrMath.h:353
matrix4.h
irr::core::matrix4
CMatrix4< f32 > matrix4
Typedef for f32 matrix.
Definition matrix4.h:2235
irr::core::IdentityMatrix
IRRLICHT_API const matrix4 IdentityMatrix
global const identity matrix
irr::video
The video namespace contains classes for accessing the video driver. All 2d and 3d rendering is done ...
Definition EDriverFeatures.h:11
irr::video::E_ALPHA_SOURCE
E_ALPHA_SOURCE
Source of the alpha value to take.
Definition SMaterial.h:105
irr::video::EAS_NONE
@ EAS_NONE
Use no alpha, somewhat redundant with other settings.
Definition SMaterial.h:107
irr::video::EAS_VERTEX_COLOR
@ EAS_VERTEX_COLOR
Use vertex color alpha.
Definition SMaterial.h:109
irr::video::EAS_TEXTURE
@ EAS_TEXTURE
Use texture alpha channel.
Definition SMaterial.h:111
irr::video::E_MODULATE_FUNC
E_MODULATE_FUNC
MaterialTypeParam: e.g. DirectX: D3DTOP_MODULATE, D3DTOP_MODULATE2X, D3DTOP_MODULATE4X.
Definition SMaterial.h:55
irr::video::EMFN_MODULATE_2X
@ EMFN_MODULATE_2X
Definition SMaterial.h:57
irr::video::EMFN_MODULATE_1X
@ EMFN_MODULATE_1X
Definition SMaterial.h:56
irr::video::EMFN_MODULATE_4X
@ EMFN_MODULATE_4X
Definition SMaterial.h:58
irr::video::E_COLOR_MATERIAL
E_COLOR_MATERIAL
These flags allow to define the interpretation of vertex color when lighting is enabled.
Definition SMaterial.h:185
irr::video::ECM_NONE
@ ECM_NONE
Don't use vertex color for lighting.
Definition SMaterial.h:187
irr::video::ECM_EMISSIVE
@ ECM_EMISSIVE
Use vertex color for emissive light.
Definition SMaterial.h:193
irr::video::ECM_DIFFUSE_AND_AMBIENT
@ ECM_DIFFUSE_AND_AMBIENT
Use vertex color for both diffuse and ambient light.
Definition SMaterial.h:197
irr::video::ECM_SPECULAR
@ ECM_SPECULAR
Use vertex color for specular light.
Definition SMaterial.h:195
irr::video::ECM_DIFFUSE
@ ECM_DIFFUSE
Use vertex color for diffuse light, this is default.
Definition SMaterial.h:189
irr::video::ECM_AMBIENT
@ ECM_AMBIENT
Use vertex color for ambient light.
Definition SMaterial.h:191
irr::video::PolygonOffsetDirectionNames
const c8 *const PolygonOffsetDirectionNames[]
Names for polygon offset direction.
Definition SMaterial.h:214
irr::video::E_TEXTURE_CLAMP
E_TEXTURE_CLAMP
Texture coord clamp mode outside [0.0, 1.0].
Definition SMaterialLayer.h:19
irr::video::textureBlendFunc_hasAlpha
bool textureBlendFunc_hasAlpha(const E_BLEND_FACTOR factor)
EMT_ONETEXTURE_BLEND: has BlendFactor Alphablending.
Definition SMaterial.h:135
irr::video::IdentityMaterial
IRRLICHT_API SMaterial IdentityMaterial
global const identity Material
irr::video::unpack_textureBlendFunc
void unpack_textureBlendFunc(E_BLEND_FACTOR &srcFact, E_BLEND_FACTOR &dstFact, E_MODULATE_FUNC &modulo, u32 &alphaSource, const f32 param)
EMT_ONETEXTURE_BLEND: unpack srcFact & dstFact and Modulo to MaterialTypeParam.
Definition SMaterial.h:124
irr::video::E_BLEND_OPERATION
E_BLEND_OPERATION
Values defining the blend operation used when blend is enabled.
Definition SMaterial.h:40
irr::video::EBO_NONE
@ EBO_NONE
No blending happens.
Definition SMaterial.h:41
irr::video::EBO_MIN
@ EBO_MIN
Choose minimum value of each color channel.
Definition SMaterial.h:45
irr::video::EBO_REVSUBTRACT
@ EBO_REVSUBTRACT
This modes subtracts destination from source.
Definition SMaterial.h:44
irr::video::EBO_MIN_FACTOR
@ EBO_MIN_FACTOR
Choose minimum value of each color channel after applying blend factors, not widely supported.
Definition SMaterial.h:47
irr::video::EBO_SUBTRACT
@ EBO_SUBTRACT
This mode subtracts the color values.
Definition SMaterial.h:43
irr::video::EBO_MAX_ALPHA
@ EBO_MAX_ALPHA
Choose maximum value of each color channel based on alpha value, not widely supported.
Definition SMaterial.h:50
irr::video::EBO_MAX_FACTOR
@ EBO_MAX_FACTOR
Choose maximum value of each color channel after applying blend factors, not widely supported.
Definition SMaterial.h:48
irr::video::EBO_ADD
@ EBO_ADD
Default blending adds the color values.
Definition SMaterial.h:42
irr::video::EBO_MIN_ALPHA
@ EBO_MIN_ALPHA
Choose minimum value of each color channel based on alpha value, not widely supported.
Definition SMaterial.h:49
irr::video::EBO_MAX
@ EBO_MAX
Choose maximum value of each color channel.
Definition SMaterial.h:46
irr::video::E_POLYGON_OFFSET
E_POLYGON_OFFSET
Flags for the definition of the polygon offset feature.
Definition SMaterial.h:203
irr::video::EPO_BACK
@ EPO_BACK
Push pixel towards the far plane, away from the eye.
Definition SMaterial.h:206
irr::video::EPO_FRONT
@ EPO_FRONT
Pull pixels towards the camera.
Definition SMaterial.h:210
irr::video::E_MATERIAL_FLAG
E_MATERIAL_FLAG
Material flags.
Definition EMaterialFlags.h:15
irr::video::EMF_FRONT_FACE_CULLING
@ EMF_FRONT_FACE_CULLING
Is frontface culling enabled? Default: false.
Definition EMaterialFlags.h:40
irr::video::EMF_POINTCLOUD
@ EMF_POINTCLOUD
Draw as point cloud or filled triangles? Default: false.
Definition EMaterialFlags.h:20
irr::video::EMF_NORMALIZE_NORMALS
@ EMF_NORMALIZE_NORMALS
Normalizes normals. Default: false.
Definition EMaterialFlags.h:66
irr::video::EMF_ZBUFFER
@ EMF_ZBUFFER
Is the ZBuffer enabled? Default: true.
Definition EMaterialFlags.h:29
irr::video::EMF_ZWRITE_ENABLE
@ EMF_ZWRITE_ENABLE
May be written to the zbuffer or is it readonly. Default: true.
Definition EMaterialFlags.h:33
irr::video::EMF_FOG_ENABLE
@ EMF_FOG_ENABLE
Is fog enabled? Default: false.
Definition EMaterialFlags.h:58
irr::video::EMF_COLOR_MASK
@ EMF_COLOR_MASK
ColorMask bits, for enabling the color planes.
Definition EMaterialFlags.h:75
irr::video::EMF_TRILINEAR_FILTER
@ EMF_TRILINEAR_FILTER
Is trilinear filtering enabled? Default: false.
Definition EMaterialFlags.h:48
irr::video::EMF_TEXTURE_WRAP
@ EMF_TEXTURE_WRAP
Access to all layers texture wrap settings. Overwrites separate layer settings.
Definition EMaterialFlags.h:69
irr::video::EMF_COLOR_MATERIAL
@ EMF_COLOR_MATERIAL
ColorMaterial enum for vertex color interpretation.
Definition EMaterialFlags.h:78
irr::video::EMF_GOURAUD_SHADING
@ EMF_GOURAUD_SHADING
Flat or Gouraud shading? Default: true.
Definition EMaterialFlags.h:23
irr::video::EMF_USE_MIP_MAPS
@ EMF_USE_MIP_MAPS
Flag for enabling/disabling mipmap usage.
Definition EMaterialFlags.h:81
irr::video::EMF_ANISOTROPIC_FILTER
@ EMF_ANISOTROPIC_FILTER
Is anisotropic filtering? Default: false.
Definition EMaterialFlags.h:55
irr::video::EMF_ANTI_ALIASING
@ EMF_ANTI_ALIASING
AntiAliasing mode.
Definition EMaterialFlags.h:72
irr::video::EMF_BLEND_OPERATION
@ EMF_BLEND_OPERATION
Flag for blend operation.
Definition EMaterialFlags.h:84
irr::video::EMF_WIREFRAME
@ EMF_WIREFRAME
Draw as wireframe or filled triangles? Default: false.
Definition EMaterialFlags.h:17
irr::video::EMF_POLYGON_OFFSET
@ EMF_POLYGON_OFFSET
Flag for polygon offset.
Definition EMaterialFlags.h:87
irr::video::EMF_LIGHTING
@ EMF_LIGHTING
Will this material be lighted? Default: true.
Definition EMaterialFlags.h:26
irr::video::EMF_BACK_FACE_CULLING
@ EMF_BACK_FACE_CULLING
Is backface culling enabled? Default: true.
Definition EMaterialFlags.h:36
irr::video::EMF_BILINEAR_FILTER
@ EMF_BILINEAR_FILTER
Is bilinear filtering enabled? Default: true.
Definition EMaterialFlags.h:43
irr::video::E_ANTI_ALIASING_MODE
E_ANTI_ALIASING_MODE
These flags are used to specify the anti-aliasing and smoothing modes.
Definition SMaterial.h:159
irr::video::EAAM_SIMPLE
@ EAAM_SIMPLE
Default anti-aliasing mode.
Definition SMaterial.h:163
irr::video::EAAM_QUALITY
@ EAAM_QUALITY
High-quality anti-aliasing, not always supported, automatically enables SIMPLE mode.
Definition SMaterial.h:165
irr::video::EAAM_LINE_SMOOTH
@ EAAM_LINE_SMOOTH
Line smoothing.
Definition SMaterial.h:167
irr::video::EAAM_POINT_SMOOTH
@ EAAM_POINT_SMOOTH
point smoothing, often in software and slow, only with OpenGL
Definition SMaterial.h:169
irr::video::EAAM_OFF
@ EAAM_OFF
Use to turn off anti-aliasing for this material.
Definition SMaterial.h:161
irr::video::EAAM_ALPHA_TO_COVERAGE
@ EAAM_ALPHA_TO_COVERAGE
Enhanced anti-aliasing for transparent materials.
Definition SMaterial.h:174
irr::video::EAAM_FULL_BASIC
@ EAAM_FULL_BASIC
All typical anti-alias and smooth modes.
Definition SMaterial.h:171
irr::video::E_COLOR_PLANE
E_COLOR_PLANE
Enum values for enabling/disabling color planes for rendering.
Definition SMaterial.h:84
irr::video::ECP_GREEN
@ ECP_GREEN
Green enabled.
Definition SMaterial.h:92
irr::video::ECP_BLUE
@ ECP_BLUE
Blue enabled.
Definition SMaterial.h:94
irr::video::ECP_RED
@ ECP_RED
Red enabled.
Definition SMaterial.h:90
irr::video::ECP_RGB
@ ECP_RGB
All colors, no alpha.
Definition SMaterial.h:96
irr::video::ECP_ALL
@ ECP_ALL
All planes enabled.
Definition SMaterial.h:98
irr::video::ECP_NONE
@ ECP_NONE
No color enabled.
Definition SMaterial.h:86
irr::video::ECP_ALPHA
@ ECP_ALPHA
Alpha enabled.
Definition SMaterial.h:88
irr::video::E_MATERIAL_TYPE
E_MATERIAL_TYPE
Abstracted and easy to use fixed function/programmable pipeline material modes.
Definition EMaterialTypes.h:15
irr::video::EMT_TRANSPARENT_ADD_COLOR
@ EMT_TRANSPARENT_ADD_COLOR
A transparent material.
Definition EMaterialTypes.h:88
irr::video::EMT_TRANSPARENT_VERTEX_ALPHA
@ EMT_TRANSPARENT_VERTEX_ALPHA
Makes the material transparent based on the vertex alpha value.
Definition EMaterialTypes.h:116
irr::video::EMT_TRANSPARENT_REFLECTION_2_LAYER
@ EMT_TRANSPARENT_REFLECTION_2_LAYER
A transparent reflecting material with an optional additional non reflecting texture layer.
Definition EMaterialTypes.h:124
irr::video::EMT_SOLID
@ EMT_SOLID
Standard solid material.
Definition EMaterialTypes.h:19
irr::video::EMT_TRANSPARENT_ALPHA_CHANNEL
@ EMT_TRANSPARENT_ALPHA_CHANNEL
Makes the material transparent based on the texture alpha channel.
Definition EMaterialTypes.h:101
irr::video::E_BLEND_FACTOR
E_BLEND_FACTOR
Flag for EMT_ONETEXTURE_BLEND, ( BlendFactor ) BlendFunc = source * sourceFactor + dest * destFactor.
Definition SMaterial.h:24
irr::video::EBF_ONE_MINUS_DST_COLOR
@ EBF_ONE_MINUS_DST_COLOR
src (1-destR, 1-destG, 1-destB, 1-destA)
Definition SMaterial.h:28
irr::video::EBF_SRC_ALPHA_SATURATE
@ EBF_SRC_ALPHA_SATURATE
src (min(srcA, 1-destA), idem, ...)
Definition SMaterial.h:35
irr::video::EBF_SRC_ALPHA
@ EBF_SRC_ALPHA
src & dest (srcA, srcA, srcA, srcA)
Definition SMaterial.h:31
irr::video::EBF_ONE
@ EBF_ONE
src & dest (1, 1, 1, 1)
Definition SMaterial.h:26
irr::video::EBF_ONE_MINUS_DST_ALPHA
@ EBF_ONE_MINUS_DST_ALPHA
src & dest (1-destA, 1-destA, 1-destA, 1-destA)
Definition SMaterial.h:34
irr::video::EBF_SRC_COLOR
@ EBF_SRC_COLOR
dest (srcR, srcG, srcB, srcA)
Definition SMaterial.h:29
irr::video::EBF_DST_ALPHA
@ EBF_DST_ALPHA
src & dest (destA, destA, destA, destA)
Definition SMaterial.h:33
irr::video::EBF_ZERO
@ EBF_ZERO
src & dest (0, 0, 0, 0)
Definition SMaterial.h:25
irr::video::EBF_ONE_MINUS_SRC_ALPHA
@ EBF_ONE_MINUS_SRC_ALPHA
src & dest (1-srcA, 1-srcA, 1-srcA, 1-srcA)
Definition SMaterial.h:32
irr::video::EBF_DST_COLOR
@ EBF_DST_COLOR
src (destR, destG, destB, destA)
Definition SMaterial.h:27
irr::video::EBF_ONE_MINUS_SRC_COLOR
@ EBF_ONE_MINUS_SRC_COLOR
dest (1-srcR, 1-srcG, 1-srcB, 1-srcA)
Definition SMaterial.h:30
irr::video::MATERIAL_MAX_TEXTURES
const u32 MATERIAL_MAX_TEXTURES
Maximum number of texture an SMaterial can have.
Definition SMaterial.h:223
irr::video::pack_textureBlendFunc
f32 pack_textureBlendFunc(const E_BLEND_FACTOR srcFact, const E_BLEND_FACTOR dstFact, const E_MODULATE_FUNC modulate=EMFN_MODULATE_1X, const u32 alphaSource=EAS_TEXTURE)
EMT_ONETEXTURE_BLEND: pack srcFact, dstFact, Modulate and alpha source to MaterialTypeParam.
Definition SMaterial.h:116
irr::video::E_COMPARISON_FUNC
E_COMPARISON_FUNC
Comparison function, e.g. for depth buffer test.
Definition SMaterial.h:63
irr::video::ECFN_LESS
@ ECFN_LESS
exclusive less comparison, i.e. <
Definition SMaterial.h:71
irr::video::ECFN_GREATER
@ ECFN_GREATER
inverse of <=
Definition SMaterial.h:77
irr::video::ECFN_GREATEREQUAL
@ ECFN_GREATEREQUAL
>= test
Definition SMaterial.h:75
irr::video::ECFN_NEVER
@ ECFN_NEVER
Test never succeeds, this equals disable.
Definition SMaterial.h:65
irr::video::ECFN_LESSEQUAL
@ ECFN_LESSEQUAL
<= test, default for e.g. depth test
Definition SMaterial.h:67
irr::video::ECFN_ALWAYS
@ ECFN_ALWAYS
test succeeds always
Definition SMaterial.h:79
irr::video::ECFN_EQUAL
@ ECFN_EQUAL
Exact equality.
Definition SMaterial.h:69
irr::video::ECFN_NOTEQUAL
@ ECFN_NOTEQUAL
Succeeds almost always, except for exact equality.
Definition SMaterial.h:73
irr
Everything in the Irrlicht Engine can be found in this namespace.
Definition aabbox3d.h:13
irr::f32
float f32
32 bit floating point variable.
Definition irrTypes.h:104
irr::u32
unsigned int u32
32 bit unsigned variable.
Definition irrTypes.h:58
irr::u8
unsigned char u8
8 bit unsigned variable.
Definition irrTypes.h:18
irr::c8
char c8
8 bit character variable.
Definition irrTypes.h:31
- Irrlicht Engine Documentation © 2003-2012 by Nikolaus Gebhardt. Generated on for Irrlicht 3D Engine by Doxygen 1.15.0