 |
Irrlicht 3D Engine
|
|
Go to the documentation of this file.
5 #ifndef __S_MATERIAL_H_INCLUDED__
6 #define __S_MATERIAL_H_INCLUDED__
118 const u32 tmp = (alphaSource << 12) | (modulate << 8) | (srcFact << 4) | dstFact;
127 const u32 state =
IR(param);
128 alphaSource = (state & 0x0000F000) >> 12;
668 {
return !(b!=*
this); }
core::matrix4 & getTextureMatrix()
Gets the texture transformation matrix.
@ ECFN_LESS
exclusive less comparison, i.e. <
@ EMF_ZWRITE_ENABLE
May be written to the zbuffer or is it readonly. Default: true.
@ EAAM_SIMPLE
Default anti-aliasing mode.
@ EPO_BACK
Push pixel towards the far plane, away from the eye.
void setTexture(u32 i, ITexture *tex)
Sets the i-th texture.
@ ECP_NONE
No color enabled.
u8 ColorMaterial
Defines the interpretation of vertex color in the lighting equation.
@ EMF_NORMALIZE_NORMALS
Normalizes normals. Default: false.
@ EMF_GOURAUD_SHADING
Flat or Gouraud shading? Default: true.
E_COMPARISON_FUNC
Comparison function, e.g. for depth buffer test.
@ EBF_SRC_COLOR
dest (srcR, srcG, srcB, srcA)
bool TrilinearFilter
Is trilinear filtering enabled? Default: false.
f32 MaterialTypeParam
Free parameter, dependent on the material type.
@ EAAM_QUALITY
High-quality anti-aliasing, not always supported, automatically enables SIMPLE mode.
E_COLOR_PLANE
Enum values for enabling/disabling color planes for rendering.
@ ECFN_GREATER
inverse of <=
@ EBF_ONE_MINUS_DST_ALPHA
src & dest (1-destA, 1-destA, 1-destA, 1-destA)
E_MATERIAL_FLAG
Material flags.
E_ANTI_ALIASING_MODE
These flags are used to specify the anti-aliasing and smoothing modes.
@ ECFN_NEVER
Test never succeeds, this equals disable.
@ EBF_ONE_MINUS_SRC_COLOR
dest (1-srcR, 1-srcG, 1-srcB, 1-srcA)
@ EMT_TRANSPARENT_VERTEX_ALPHA
Makes the material transparent based on the vertex alpha value.
@ EMF_BILINEAR_FILTER
Is bilinear filtering enabled? Default: true.
bool FogEnable
Is fog enabled? Default: false.
bool FrontfaceCulling
Is frontface culling enabled? Default: false.
@ ECFN_NOTEQUAL
Succeeds almost always, except for exact equality.
#define IRRLICHT_API
Set FPU settings.
@ EBF_ONE_MINUS_SRC_ALPHA
src & dest (1-srcA, 1-srcA, 1-srcA, 1-srcA)
char c8
8 bit character variable.
@ EMT_SOLID
Standard solid material.
@ ECP_GREEN
Green enabled.
E_BLEND_OPERATION BlendOperation
Store the blend operation of choice.
@ EAAM_POINT_SMOOTH
point smoothing, often in software and slow, only with OpenGL
@ EBO_NONE
No blending happens.
f32 Shininess
Value affecting the size of specular highlights.
@ EBF_ZERO
src & dest (0, 0, 0, 0)
bool PointCloud
Draw as point cloud or filled triangles? Default: false.
@ EBF_SRC_ALPHA
src & dest (srcA, srcA, srcA, srcA)
bool operator!=(const SMaterial &b) const
Inequality operator.
@ EMF_BLEND_OPERATION
Flag for blend operation.
@ EBO_MAX_ALPHA
Choose maximum value of each color channel based on alpha value, not widely supported.
@ EMF_ZBUFFER
Is the ZBuffer enabled? Default: true.
Interface of a Video Driver dependent Texture.
bool operator==(const SMaterial &b) const
Equality operator.
f32 MaterialTypeParam2
Second free parameter, dependent on the material type.
@ ECM_EMISSIVE
Use vertex color for emissive light.
SMaterial()
Default constructor. Creates a solid, lit material with white colors.
@ ECM_SPECULAR
Use vertex color for specular light.
@ ECFN_LESSEQUAL
<= test, default for e.g. depth test
SColor EmissiveColor
Light emitted by this material. Default is to emit no light.
@ EMF_POINTCLOUD
Draw as point cloud or filled triangles? Default: false.
E_TEXTURE_CLAMP
Texture coord clamp mode outside [0.0, 1.0].
@ EAS_TEXTURE
Use texture alpha channel.
@ EBO_MIN_FACTOR
Choose minimum value of each color channel after applying blend factors, not widely supported.
@ EMF_BACK_FACE_CULLING
Is backface culling enabled? Default: true.
SColor DiffuseColor
How much diffuse light coming from a light source is reflected by this material.
SColor SpecularColor
How much specular light (highlights from a light) is reflected.
ITexture * getTexture(u32 i) const
Gets the i-th texture.
4x4 matrix. Mostly used as transformation matrix for 3d calculations.
@ ECP_ALL
All planes enabled.
@ ECM_AMBIENT
Use vertex color for ambient light.
@ EBO_MIN
Choose minimum value of each color channel.
@ EMF_COLOR_MATERIAL
ColorMaterial enum for vertex color interpretation.
@ EAS_NONE
Use no alpha, somewhat redundant with other settings.
@ EBF_DST_COLOR
src (destR, destG, destB, destA)
Struct for holding material parameters which exist per texture layer.
u8 PolygonOffsetFactor
Factor specifying how far the polygon offset should be made.
SMaterialLayer TextureLayer[MATERIAL_MAX_TEXTURES]
Texture layer array.
@ EMF_FRONT_FACE_CULLING
Is frontface culling enabled? Default: false.
@ EBF_ONE_MINUS_DST_COLOR
src (1-destR, 1-destG, 1-destB, 1-destA)
@ EMF_ANTI_ALIASING
AntiAliasing mode.
f32 FR(u32 x)
Floating-point representation of an integer value.
core::matrix4 & getTextureMatrix(u32 i)
Gets the texture transformation matrix for level i.
bool GouraudShading
Flat or Gouraud shading? Default: true.
@ ECP_ALPHA
Alpha enabled.
E_POLYGON_OFFSET
Flags for the definition of the polygon offset feature.
float f32
32 bit floating point variable.
const core::matrix4 & getTextureMatrix(u32 i) const
Gets the immutable texture transformation matrix for level i.
E_MATERIAL_TYPE
Abstracted and easy to use fixed function/programmable pipeline material modes.
bool NormalizeNormals
Should normals be normalized?
bool BilinearFilter
Is bilinear filtering enabled? Default: true.
@ ECP_RGB
All colors, no alpha.
@ EMF_ANISOTROPIC_FILTER
Is anisotropic filtering? Default: false.
f32 Thickness
Thickness of non-3dimensional elements such as lines and points.
@ EMF_TRILINEAR_FILTER
Is trilinear filtering enabled? Default: false.
@ ECM_DIFFUSE_AND_AMBIENT
Use vertex color for both diffuse and ambient light.
E_MATERIAL_TYPE MaterialType
Type of the material. Specifies how everything is blended together.
@ EBO_REVSUBTRACT
This modes subtracts destination from source.
void setFlag(E_MATERIAL_FLAG flag, bool value)
Sets the Material flag to the given value.
@ EAAM_FULL_BASIC
All typical anti-alias and smooth modes.
bool getFlag(E_MATERIAL_FLAG flag) const
Gets the Material flag.
SColor AmbientColor
How much ambient light (a global light) is reflected by this material.
@ EMT_TRANSPARENT_REFLECTION_2_LAYER
A transparent reflecting material with an optional additional non reflecting texture layer.
@ ECFN_GREATEREQUAL
>= test
E_COLOR_MATERIAL
These flags allow to define the interpretation of vertex color when lighting is enabled.
ITexture * Texture
Texture.
@ EMF_TEXTURE_WRAP
Access to all layers texture wrap settings. Overwrites separate layer settings.
bool Lighting
Will this material be lighted? Default: true.
const u32 MATERIAL_MAX_TEXTURES
Maximum number of texture an SMaterial can have.
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.
bool UseMipMaps
Shall mipmaps be used if available.
@ EBO_MIN_ALPHA
Choose minimum value of each color channel based on alpha value, not widely supported.
bool ZWriteEnable
Is the zbuffer writeable or is it read-only. Default: true.
const IRRLICHT_API matrix4 IdentityMatrix
global const identity matrix
E_BLEND_FACTOR
Flag for EMT_ONETEXTURE_BLEND, ( BlendFactor ) BlendFunc = source * sourceFactor + dest * destFactor.
@ EBF_SRC_ALPHA_SATURATE
src (min(srcA, 1-destA), idem, ...)
bool isTransparent() const
@ EBO_MAX_FACTOR
Choose maximum value of each color channel after applying blend factors, not widely supported.
u8 TextureWrapU
Texture Clamp Mode.
Everything in the Irrlicht Engine can be found in this namespace.
const c8 *const PolygonOffsetDirectionNames[]
Names for polygon offset direction.
@ EMF_FOG_ENABLE
Is fog enabled? Default: false.
@ EMF_LIGHTING
Will this material be lighted? Default: true.
@ EMF_POLYGON_OFFSET
Flag for polygon offset.
@ EAAM_LINE_SMOOTH
Line smoothing.
@ ECFN_EQUAL
Exact equality.
unsigned int u32
32 bit unsigned variable.
@ EBO_SUBTRACT
This mode subtracts the color values.
@ EBF_DST_ALPHA
src & dest (destA, destA, destA, destA)
SMaterial & operator=(const SMaterial &other)
Assignment operator.
@ ECM_DIFFUSE
Use vertex color for diffuse light, this is default.
u8 AntiAliasing
Sets the antialiasing mode.
@ EAAM_ALPHA_TO_COVERAGE
Enhanced anti-aliasing for transparent materials.
@ ECM_NONE
Don't use vertex color for lighting.
#define _IRR_MATERIAL_MAX_TEXTURES_
Maximum number of texture an SMaterial can have, up to 8 are supported by Irrlicht.
E_MODULATE_FUNC
MaterialTypeParam: e.g. DirectX: D3DTOP_MODULATE, D3DTOP_MODULATE2X, D3DTOP_MODULATE4X.
bool textureBlendFunc_hasAlpha(const E_BLEND_FACTOR factor)
EMT_ONETEXTURE_BLEND: has BlendFactor Alphablending.
@ EBO_ADD
Default blending adds the color values.
Struct for holding parameters for a material renderer.
void setTextureMatrix(u32 i, const core::matrix4 &mat)
Sets the i-th texture transformation matrix.
u8 ColorMask
Defines the enabled color planes.
@ EMF_USE_MIP_MAPS
Flag for enabling/disabling mipmap usage.
@ EMT_TRANSPARENT_ALPHA_CHANNEL
Makes the material transparent based on the texture alpha channel.
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.
E_POLYGON_OFFSET PolygonOffsetDirection
Flag defining the direction the polygon offset is applied to.
E_BLEND_OPERATION
Values defining the blend operation used when blend is enabled.
u8 ZBuffer
Is the ZBuffer enabled? Default: ECFN_LESSEQUAL.
@ EMF_WIREFRAME
Draw as wireframe or filled triangles? Default: false.
@ EAAM_OFF
Use to turn off anti-aliasing for this material.
Class representing a 32 bit ARGB color.
@ EMF_COLOR_MASK
ColorMask bits, for enabling the color planes.
void setTextureMatrix(const core::matrix4 &mat)
Sets the texture transformation matrix to mat.
@ EPO_FRONT
Pull pixels towards the camera.
@ EMT_TRANSPARENT_ADD_COLOR
A transparent material.
E_ALPHA_SOURCE
Source of the alpha value to take.
@ ECFN_ALWAYS
test succeeds always
@ EBF_ONE
src & dest (1, 1, 1, 1)
bool Wireframe
Draw as wireframe or filled triangles? Default: false.
@ EBO_MAX
Choose maximum value of each color channel.
unsigned char u8
8 bit unsigned variable.
SMaterial(const SMaterial &other)
Copy constructor.
IRRLICHT_API SMaterial IdentityMaterial
global const identity Material
u8 AnisotropicFilter
Is anisotropic filtering enabled? Default: 0, disabled.
bool BackfaceCulling
Is backface culling enabled? Default: true.
@ EAS_VERTEX_COLOR
Use vertex color alpha.