![]() |
Skylicht Engine
|
Struct for holding parameters for a material renderer. More...
#include <C:/Projects/skylicht-engine/Projects/Irrlicht/Include/SMaterial.h>
Public Member Functions | |
| SMaterial () | |
| Default constructor. Creates a solid, lit material with white colors. | |
| SMaterial (const SMaterial &other) | |
| Copy constructor. | |
| SMaterial & | operator= (const SMaterial &other) |
| Assignment operator. | |
| core::matrix4 & | getTextureMatrix (u32 i) |
| Gets the texture transformation matrix for level i. | |
| const core::matrix4 & | getTextureMatrix (u32 i) const |
| Gets the immutable texture transformation matrix for level i. | |
| void | setTextureMatrix (u32 i, const core::matrix4 &mat) |
| Sets the i-th texture transformation matrix. | |
| ITexture * | getTexture (u32 i) const |
| Gets the i-th texture. | |
| void | setTexture (u32 i, ITexture *tex) |
| Sets the i-th texture. | |
| void | setFlag (E_MATERIAL_FLAG flag, bool value, int intValue=0) |
| Sets the Material flag to the given value. | |
| bool | getFlag (E_MATERIAL_FLAG flag) const |
| Gets the Material flag. | |
| bool | operator!= (const SMaterial &b) const |
| Inequality operator. | |
| bool | operator== (const SMaterial &b) const |
| Equality operator. | |
Public Attributes | |
| void * | MaterialInfo |
| Extern tag infomation. | |
| SMaterialLayer | TextureLayer [MATERIAL_MAX_TEXTURES] |
| Texture layer array. | |
| s32 | MaterialType |
| Type of the material. Specifies how everything is blended together. | |
| SColor | AmbientColor |
| How much ambient light (a global light) is reflected by this material. | |
| SColor | DiffuseColor |
| How much diffuse light coming from a light source is reflected by this material. | |
| SColor | EmissiveColor |
| Light emitted by this material. Default is to emit no light. | |
| SColor | SpecularColor |
| How much specular light (highlights from a light) is reflected. | |
| f32 | Shininess |
| Value affecting the size of specular highlights. | |
| f32 | MaterialTypeParam |
| Free parameter, dependent on the material type. | |
| f32 | MaterialTypeParam2 |
| Second free parameter, dependent on the material type. | |
| f32 | Thickness |
| Thickness of non-3dimensional elements such as lines and points. | |
| u8 | ZBuffer |
| Is the ZBuffer enabled? Default: ECFN_LESSEQUAL. | |
| u8 | AntiAliasing |
| Sets the antialiasing mode. | |
| u8 | ColorMask:4 |
| Defines the enabled color planes. | |
| u8 | ColorMaterial:3 |
| Defines the interpretation of vertex color in the lighting equation. | |
| E_BLEND_OPERATION | BlendOperation:4 |
| Store the blend operation of choice. | |
| f32 | BlendFactor |
| Store the blend factors. | |
| u8 | PolygonOffsetFactor:3 |
| Factor specifying how far the polygon offset should be made. | |
| E_POLYGON_OFFSET | PolygonOffsetDirection:1 |
| Flag defining the direction the polygon offset is applied to. | |
| bool | Wireframe:1 |
| Draw as wireframe or filled triangles? Default: false. | |
| bool | PointCloud:1 |
| Draw as point cloud or filled triangles? Default: false. | |
| bool | GouraudShading:1 |
| Flat or Gouraud shading? Default: true. | |
| bool | Lighting:1 |
| Will this material be lighted? Default: true. | |
| bool | ZWriteEnable:1 |
| Is the zbuffer writeable or is it read-only. Default: true. | |
| bool | BackfaceCulling:1 |
| Is backface culling enabled? Default: true. | |
| bool | FrontfaceCulling:1 |
| Is frontface culling enabled? Default: false. | |
| bool | FogEnable:1 |
| Is fog enabled? Default: false. | |
| bool | NormalizeNormals:1 |
| Should normals be normalized? | |
| bool | UseMipMaps:1 |
| Shall mipmaps be used if available. | |
Struct for holding parameters for a material renderer.
|
inline |
Copy constructor.
| other | Material to copy from. |
|
inline |
Gets the Material flag.
| flag | The flag to query. |
Gets the i-th texture.
| i | The desired level. |
|
inline |
Gets the texture transformation matrix for level i.
| i | The desired level. Must not be larger than MATERIAL_MAX_TEXTURES. |
|
inline |
Gets the immutable texture transformation matrix for level i.
| i | The desired level. |
|
inline |
Inequality operator.
| b | Material to compare to. |
Assignment operator.
| other | Material to copy from. |
|
inline |
Equality operator.
| b | Material to compare to. |
|
inline |
Sets the Material flag to the given value.
| flag | The flag to be set. |
| value | The new value for the flag. |
Sets the i-th texture.
If i>=MATERIAL_MAX_TEXTURES this setting will be ignored.
| i | The desired level. |
| tex | Texture for texture level i. |
|
inline |
Sets the i-th texture transformation matrix.
| i | The desired level. |
| mat | Texture matrix for texture level i. |
| SColor irr::video::SMaterial::AmbientColor |
How much ambient light (a global light) is reflected by this material.
The default is full white, meaning objects are completely globally illuminated. Reduce this if you want to see diffuse or specular light effects.
| u8 irr::video::SMaterial::AntiAliasing |
Sets the antialiasing mode.
Values are chosen from E_ANTI_ALIASING_MODE. Default is EAAM_SIMPLE|EAAM_LINE_SMOOTH, i.e. simple multi-sample anti-aliasing and lime smoothing is enabled.
| f32 irr::video::SMaterial::BlendFactor |
Store the blend factors.
textureBlendFunc/textureBlendFuncSeparate functions should be used to write properly blending factors to this parameter. If you use EMT_ONETEXTURE_BLEND type for this material, this field should be equal to MaterialTypeParam.
| E_BLEND_OPERATION irr::video::SMaterial::BlendOperation |
Store the blend operation of choice.
Values to be chosen from E_BLEND_OPERATION.
| u8 irr::video::SMaterial::ColorMask |
Defines the enabled color planes.
Values are defined as or'ed values of the E_COLOR_PLANE enum. Only enabled color planes will be rendered to the current render target. Typical use is to disable all colors when rendering only to depth or stencil buffer, or using Red and Green for Stereo rendering.
| u8 irr::video::SMaterial::ColorMaterial |
Defines the interpretation of vertex color in the lighting equation.
Values should be chosen from E_COLOR_MATERIAL. When lighting is enabled, vertex color can be used instead of the material values for light modulation. This allows to easily change e.g. the diffuse light behavior of each face. The default, ECM_DIFFUSE, will result in a very similar rendering as with lighting turned off, just with light shading.
| SColor irr::video::SMaterial::DiffuseColor |
How much diffuse light coming from a light source is reflected by this material.
The default is full white.
| f32 irr::video::SMaterial::MaterialTypeParam |
Free parameter, dependent on the material type.
Mostly ignored, used for example in EMT_PARALLAX_MAP_SOLID and EMT_TRANSPARENT_ALPHA_CHANNEL.
| f32 irr::video::SMaterial::MaterialTypeParam2 |
Second free parameter, dependent on the material type.
Mostly ignored.
| bool irr::video::SMaterial::NormalizeNormals |
Should normals be normalized?
Always use this if the mesh lit and scaled. Default: false
| E_POLYGON_OFFSET irr::video::SMaterial::PolygonOffsetDirection |
Flag defining the direction the polygon offset is applied to.
Can be to front or to back, specififed by values from E_POLYGON_OFFSET.
| u8 irr::video::SMaterial::PolygonOffsetFactor |
Factor specifying how far the polygon offset should be made.
Specifying 0 disables the polygon offset. The direction is specified spearately. The factor can be from 0 to 7.
| f32 irr::video::SMaterial::Shininess |
Value affecting the size of specular highlights.
A value of 20 is common. If set to 0, no specular highlights are being used. To activate, simply set the shininess of a material to a value in the range [0.5;128]:
You can change the color of the highlights using
The specular color of the dynamic lights (SLight::SpecularColor) will influence the the highlight color too, but they are set to a useful value by default when creating the light scene node. Here is a simple example on how to use specular highlights:
| SColor irr::video::SMaterial::SpecularColor |
How much specular light (highlights from a light) is reflected.
The default is to reflect white specular light. See SMaterial::Shininess on how to enable specular lights.
| bool irr::video::SMaterial::UseMipMaps |
Shall mipmaps be used if available.
Sometimes, disabling mipmap usage can be useful. Default: true
| bool irr::video::SMaterial::Wireframe |
Draw as wireframe or filled triangles? Default: false.
The user can access a material flag using
or
| u8 irr::video::SMaterial::ZBuffer |
Is the ZBuffer enabled? Default: ECFN_LESSEQUAL.
If you want to disable depth test for this material just set this parameter to ECFN_DISABLED. Values are from E_COMPARISON_FUNC.
| bool irr::video::SMaterial::ZWriteEnable |
Is the zbuffer writeable or is it read-only. Default: true.
This flag is forced to false if the MaterialType is a transparent type and the scene parameter ALLOW_ZWRITE_ON_TRANSPARENT is not set. If you set this parameter to true, make sure that ZBuffer value is other than ECFN_DISABLED