5 #ifndef __S_MATERIAL_H_INCLUDED__ 6 #define __S_MATERIAL_H_INCLUDED__ 122 const u32 tmp = (alphaSource << 20) | (modulate << 16) | (srcFact << 12) | (dstFact << 8) | (srcFact << 4) | dstFact;
132 const u32 tmp = (alphaSource << 20) | (modulate << 16) | (srcAlphaFact << 12) | (dstAlphaFact << 8) | (srcRGBFact << 4) | dstRGBFact;
142 alphaSource = (state & 0x00F00000) >> 20;
155 alphaSource = (state & 0x00F00000) >> 20;
787 {
return !(
b!=*
this); }
u8 ZBuffer
Is the ZBuffer enabled? Default: ECFN_LESSEQUAL.
Is backface culling enabled? Default: true.
This modes subtracts destination from source.
const core::matrix4 & getTextureMatrix(u32 i) const
Gets the immutable texture transformation matrix for level i.
All typical anti-alias and smooth modes.
SMaterial()
Default constructor. Creates a solid, lit material with white colors.
point smoothing, often in software and slow, only with OpenGL
bool FrontfaceCulling
Is frontface culling enabled? Default: false.
Is fog enabled? Default: false.
E_MATERIAL_TYPE MaterialType
Type of the material. Specifies how everything is blended together.
IRRLICHT_API const matrix4 IdentityMatrix
global const identity matrix
E_MATERIAL_TYPE
Abstracted and easy to use fixed function/programmable pipeline material modes.
Use vertex color for ambient light.
bool getFlag(E_MATERIAL_FLAG flag) const
Gets the Material flag.
u8 ColorMaterial
Defines the interpretation of vertex color in the lighting equation.
ITexture * getTexture(u32 i) const
Gets the i-th texture.
dest (srcR, srcG, srcB, srcA)
float f32
32 bit floating point variable.
f32 Shininess
Value affecting the size of specular highlights.
Depth test disabled (disable also write to depth buffer)
void setTexture(u32 i, ITexture *tex)
Sets the i-th texture.
bool PointCloud
Draw as point cloud or filled triangles? Default: false.
Is the ZBuffer enabled? Default: true.
E_COLOR_MATERIAL
These flags allow to define the interpretation of vertex color when lighting is enabled.
bool UseMipMaps
Shall mipmaps be used if available.
bool TrilinearFilter
Is trilinear filtering enabled? Default: false.
void setTextureMatrix(u32 i, const core::matrix4 &mat)
Sets the i-th texture transformation matrix.
u8 ColorMask
Defines the enabled color planes.
char c8
8 bit character variable.
Flag for blend operation.
bool operator==(const SMaterial &b) const
Equality operator.
core::matrix4 & getTextureMatrix(u32 i)
Gets the texture transformation matrix for level i.
bool GouraudShading
Flat or Gouraud shading? Default: true.
f32 PolygonOffsetDepthBias
A constant z-buffer offset for a polygon/line/point.
bool isTransparent() const
Use vertex color for diffuse light, this is default.
#define IRRLICHT_API
Set FPU settings.
u8 TextureWrapU
Texture Clamp Mode.
E_BLEND_OPERATION
Values defining the blend operation.
f32 PolygonOffsetSlopeScale
Variable Z-Buffer offset based on the slope of the polygon.
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)
Pack srcFact, dstFact, Modulate and alpha source to MaterialTypeParam or BlendFactor.
f32 MaterialTypeParam2
Second free parameter, dependent on the material type.
f32 Thickness
Thickness of non-3dimensional elements such as lines and points.
SColor EmissiveColor
Light emitted by this material. Default is to emit no light.
Everything in the Irrlicht Engine can be found in this namespace.
const c8 *const PolygonOffsetDirectionNames[]
Names for polygon offset direction.
void setFlag(E_MATERIAL_FLAG flag, bool value)
Sets the Material flag to the given value.
ColorMaterial enum for vertex color interpretation.
bool textureBlendFunc_hasAlpha(const E_BLEND_FACTOR factor)
has blend factor alphablending
E_BLEND_OPERATION BlendOperation
Store the blend operation of choice.
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)
Unpack srcFact, dstFact, modulo and alphaSource factors.
f32 BlendFactor
Store the blend factors.
ColorMask bits, for enabling the color planes.
SColor DiffuseColor
How much diffuse light coming from a light source is reflected by this material.
unsigned char u8
8 bit unsigned variable.
Choose minimum value of each color channel.
src & dest (srcA, srcA, srcA, srcA)
bool operator!=(const SMaterial &b) const
Inequality operator.
Is bilinear filtering enabled? Default: true.
src & dest (destA, destA, destA, destA)
E_COLOR_PLANE
Enum values for enabling/disabling color planes for rendering.
Use texture alpha channel.
E_ANTI_ALIASING_MODE
These flags are used to specify the anti-aliasing and smoothing modes.
SMaterial(const SMaterial &other)
Copy constructor.
Choose minimum value of each color channel after applying blend factors, not widely supported.
A transparent reflecting material with an optional additional non reflecting texture layer.
bool BackfaceCulling
Is backface culling enabled? Default: true.
E_MODULATE_FUNC
MaterialTypeParam: e.g. DirectX: D3DTOP_MODULATE, D3DTOP_MODULATE2X, D3DTOP_MODULATE4X.
u8 AntiAliasing
Sets the antialiasing mode.
GLsizei const GLfloat * value
Use to turn off anti-aliasing for this material.
SColor AmbientColor
How much ambient light (a global light) is reflected by this material.
E_COMPARISON_FUNC
Comparison function, e.g. for depth buffer test.
Struct for holding material parameters which exist per texture layer.
Use no alpha, somewhat redundant with other settings.
core::matrix4 & getTextureMatrix()
Gets the texture transformation matrix.
const c8 *const ZWriteNames[]
Names for E_ZWRITE.
src & dest (1-destA, 1-destA, 1-destA, 1-destA)
Use vertex color for specular light.
Normalizes normals. Default: false.
unsigned int u32
32 bit unsigned variable.
ITexture * Texture
Texture.
This mode subtracts the color values.
SColor SpecularColor
How much specular light (highlights from a light) is reflected.
Use vertex color for both diffuse and ambient light.
src (1-destR, 1-destG, 1-destB, 1-destA)
Enhanced anti-aliasing for transparent materials.
u8 PolygonOffsetFactor
DEPRECATED. Will be removed after Irrlicht 1.9. Please use PolygonOffsetDepthBias instead.
E_ALPHA_SOURCE
Source of the alpha value to take.
src & dest (1-srcA, 1-srcA, 1-srcA, 1-srcA)
f32 FR(u32 x)
Floating-point representation of an integer value.
bool NormalizeNormals
Should normals be normalized?
Is anisotropic filtering? Default: false.
IRRLICHT_API SMaterial IdentityMaterial
global const identity Material
Flag for enabling/disabling mipmap usage.
Choose minimum value of each color channel based on alpha value, not widely supported.
bool FogEnable
Is fog enabled? Default: false.
Class representing a 32 bit ARGB color.
u8 AnisotropicFilter
Is anisotropic filtering enabled? Default: 0, disabled.
bool BilinearFilter
Is bilinear filtering enabled? Default: true.
4x4 matrix. Mostly used as transformation matrix for 3d calculations.
May be written to the zbuffer or is it readonly. Default: true.
IRRLICHT_API u32 MATERIAL_MAX_TEXTURES_USED
By default this is identical to MATERIAL_MAX_TEXTURES.
Will this material be lighted? Default: true.
Choose maximum value of each color channel.
<= test, default for e.g. depth test
Default anti-aliasing mode.
SMaterial & operator=(const SMaterial &other)
Assignment operator.
Default blending adds the color values.
dest (1-srcR, 1-srcG, 1-srcB, 1-srcA)
GLboolean GLboolean GLboolean b
E_MATERIAL_FLAG
Material flags.
E_ZWRITE ZWriteEnable
Is the zbuffer writable or is it read-only. Default: EZW_AUTO.
bool Lighting
Will this material be lighted? Default: true.
SMaterialLayer TextureLayer[MATERIAL_MAX_TEXTURES]
Texture layer array.
exclusive less comparison, i.e. <
E_POLYGON_OFFSET PolygonOffsetDirection
DEPRECATED. Will be removed after Irrlicht 1.9.
Choose maximum value of each color channel after applying blend factors, not widely supported.
Push pixel towards the far plane, away from the eye.
Interface of a Video Driver dependent Texture.
Makes the material transparent based on the texture alpha channel.
High-quality anti-aliasing, not always supported, automatically enables SIMPLE mode.
Succeeds almost always, except for exact equality.
void unpack_textureBlendFuncSeparate(E_BLEND_FACTOR &srcRGBFact, E_BLEND_FACTOR &dstRGBFact, E_BLEND_FACTOR &srcAlphaFact, E_BLEND_FACTOR &dstAlphaFact, E_MODULATE_FUNC &modulo, u32 &alphaSource, const f32 param)
Unpack srcRGBFact, dstRGBFact, srcAlphaFact, dstAlphaFact, modulo and alphaSource factors.
bool Wireframe
Draw as wireframe or filled triangles? Default: false.
src (destR, destG, destB, destA)
E_ZWRITE
For SMaterial.ZWriteEnable.
Don't use vertex color for lighting.
Makes the material transparent based on the vertex alpha value.
f32 pack_textureBlendFuncSeparate(const E_BLEND_FACTOR srcRGBFact, const E_BLEND_FACTOR dstRGBFact, const E_BLEND_FACTOR srcAlphaFact, const E_BLEND_FACTOR dstAlphaFact, const E_MODULATE_FUNC modulate=EMFN_MODULATE_1X, const u32 alphaSource=EAS_TEXTURE)
Pack srcRGBFact, dstRGBFact, srcAlphaFact, dstAlphaFact, Modulate and alpha source to MaterialTypePar...
zwrite always enabled for this material
Flat or Gouraud shading? Default: true.
zwrite always disabled for this material
Access to all layers texture wrap settings. Overwrites separate layer settings.
Is trilinear filtering enabled? Default: false.
Use vertex color for emissive light.
Struct for holding parameters for a material renderer.
Choose maximum value of each color channel based on alpha value, not widely supported.
bool isAlphaBlendOperation() const
Check if material needs alpha blending.
f32 MaterialTypeParam
Free parameter, dependent on the material type.
#define _IRR_MATERIAL_MAX_TEXTURES_
Maximum number of texture an SMaterial can have, up to 8 are supported by Irrlicht.
E_TEXTURE_CLAMP
Texture coord clamp mode outside [0.0, 1.0].
Draw as wireframe or filled triangles? Default: false.
Pull pixels towards the camera.
Is frontface culling enabled? Default: false.
src (min(srcA, 1-destA), idem, ...)
E_POLYGON_OFFSET
DEPRECATED. Will be removed after Irrlicht 1.9.
Draw as point cloud or filled triangles? Default: false.
void setTextureMatrix(const core::matrix4 &mat)
Sets the texture transformation matrix to mat.