Struct for holding parameters for a material renderer. More...
#include <SMaterial.h>
Struct for holding parameters for a material renderer.
Definition at line 226 of file SMaterial.h.
irr::video::SMaterial::SMaterial | ( | ) | [inline] |
Default constructor. Creates a solid, lit material with white colors.
Definition at line 230 of file SMaterial.h.
irr::video::SMaterial::SMaterial | ( | const SMaterial & | other | ) | [inline] |
Copy constructor.
other | Material to copy from. |
Definition at line 244 of file SMaterial.h.
References irr::video::MATERIAL_MAX_TEXTURES, and TextureLayer.
bool irr::video::SMaterial::getFlag | ( | E_MATERIAL_FLAG | flag | ) | const [inline] |
Gets the Material flag.
flag | The flag to query. |
Definition at line 569 of file SMaterial.h.
References irr::video::SMaterialLayer::AnisotropicFilter, AntiAliasing, BackfaceCulling, irr::video::SMaterialLayer::BilinearFilter, BlendOperation, ColorMask, ColorMaterial, irr::video::EBO_NONE, irr::video::ECFN_NEVER, irr::video::ECM_NONE, irr::video::ECP_NONE, irr::video::EMF_ANISOTROPIC_FILTER, irr::video::EMF_ANTI_ALIASING, irr::video::EMF_BACK_FACE_CULLING, irr::video::EMF_BILINEAR_FILTER, irr::video::EMF_BLEND_OPERATION, irr::video::EMF_COLOR_MASK, irr::video::EMF_COLOR_MATERIAL, irr::video::EMF_FOG_ENABLE, irr::video::EMF_FRONT_FACE_CULLING, irr::video::EMF_GOURAUD_SHADING, irr::video::EMF_LIGHTING, irr::video::EMF_NORMALIZE_NORMALS, irr::video::EMF_POINTCLOUD, irr::video::EMF_POLYGON_OFFSET, irr::video::EMF_TEXTURE_WRAP, irr::video::EMF_TRILINEAR_FILTER, irr::video::EMF_USE_MIP_MAPS, irr::video::EMF_WIREFRAME, irr::video::EMF_ZBUFFER, irr::video::EMF_ZWRITE_ENABLE, FogEnable, FrontfaceCulling, GouraudShading, Lighting, NormalizeNormals, PointCloud, PolygonOffsetFactor, TextureLayer, irr::video::SMaterialLayer::TextureWrapU, irr::video::SMaterialLayer::TextureWrapV, irr::video::SMaterialLayer::TrilinearFilter, UseMipMaps, Wireframe, ZBuffer, and ZWriteEnable.
Gets the i-th texture.
i | The desired level. |
Definition at line 473 of file SMaterial.h.
References irr::video::MATERIAL_MAX_TEXTURES, irr::video::SMaterialLayer::Texture, and TextureLayer.
core::matrix4& irr::video::SMaterial::getTextureMatrix | ( | u32 | i | ) | [inline] |
Gets the texture transformation matrix for level i.
i | The desired level. Must not be larger than MATERIAL_MAX_TEXTURES. |
Definition at line 444 of file SMaterial.h.
References irr::video::SMaterialLayer::getTextureMatrix(), and TextureLayer.
const core::matrix4& irr::video::SMaterial::getTextureMatrix | ( | u32 | i | ) | const [inline] |
Gets the immutable texture transformation matrix for level i.
i | The desired level. |
Definition at line 452 of file SMaterial.h.
References irr::video::SMaterialLayer::getTextureMatrix(), irr::core::IdentityMatrix, irr::video::MATERIAL_MAX_TEXTURES, and TextureLayer.
bool irr::video::SMaterial::isTransparent | ( | ) | const [inline] |
Definition at line 670 of file SMaterial.h.
References irr::video::EMT_TRANSPARENT_ADD_COLOR, irr::video::EMT_TRANSPARENT_ALPHA_CHANNEL, irr::video::EMT_TRANSPARENT_REFLECTION_2_LAYER, irr::video::EMT_TRANSPARENT_VERTEX_ALPHA, and MaterialType.
bool irr::video::SMaterial::operator!= | ( | const SMaterial & | b | ) | const [inline] |
Inequality operator.
b | Material to compare to. |
Definition at line 628 of file SMaterial.h.
References AmbientColor, AntiAliasing, BackfaceCulling, BlendOperation, ColorMask, ColorMaterial, DiffuseColor, EmissiveColor, FogEnable, FrontfaceCulling, GouraudShading, Lighting, irr::video::MATERIAL_MAX_TEXTURES, MaterialType, MaterialTypeParam, MaterialTypeParam2, NormalizeNormals, PointCloud, PolygonOffsetDirection, PolygonOffsetFactor, Shininess, SpecularColor, TextureLayer, Thickness, UseMipMaps, Wireframe, ZBuffer, and ZWriteEnable.
Assignment operator.
other | Material to copy from. |
Definition at line 254 of file SMaterial.h.
References AmbientColor, AntiAliasing, BackfaceCulling, BlendOperation, ColorMask, ColorMaterial, DiffuseColor, EmissiveColor, FogEnable, FrontfaceCulling, GouraudShading, Lighting, irr::video::MATERIAL_MAX_TEXTURES, MaterialType, MaterialTypeParam, MaterialTypeParam2, NormalizeNormals, PointCloud, PolygonOffsetDirection, PolygonOffsetFactor, Shininess, SpecularColor, TextureLayer, Thickness, UseMipMaps, Wireframe, ZBuffer, and ZWriteEnable.
bool irr::video::SMaterial::operator== | ( | const SMaterial & | b | ) | const [inline] |
Equality operator.
b | Material to compare to. |
Definition at line 667 of file SMaterial.h.
void irr::video::SMaterial::setFlag | ( | E_MATERIAL_FLAG | flag, |
bool | value | ||
) | [inline] |
Sets the Material flag to the given value.
flag | The flag to be set. |
value | The new value for the flag. |
Definition at line 492 of file SMaterial.h.
References AntiAliasing, BackfaceCulling, BlendOperation, ColorMask, ColorMaterial, irr::video::EAAM_OFF, irr::video::EAAM_SIMPLE, irr::video::EBO_ADD, irr::video::EBO_NONE, irr::video::ECM_DIFFUSE, irr::video::ECM_NONE, irr::video::ECP_ALL, irr::video::ECP_NONE, irr::video::EMF_ANISOTROPIC_FILTER, irr::video::EMF_ANTI_ALIASING, irr::video::EMF_BACK_FACE_CULLING, irr::video::EMF_BILINEAR_FILTER, irr::video::EMF_BLEND_OPERATION, irr::video::EMF_COLOR_MASK, irr::video::EMF_COLOR_MATERIAL, irr::video::EMF_FOG_ENABLE, irr::video::EMF_FRONT_FACE_CULLING, irr::video::EMF_GOURAUD_SHADING, irr::video::EMF_LIGHTING, irr::video::EMF_NORMALIZE_NORMALS, irr::video::EMF_POINTCLOUD, irr::video::EMF_POLYGON_OFFSET, irr::video::EMF_TEXTURE_WRAP, irr::video::EMF_TRILINEAR_FILTER, irr::video::EMF_USE_MIP_MAPS, irr::video::EMF_WIREFRAME, irr::video::EMF_ZBUFFER, irr::video::EMF_ZWRITE_ENABLE, irr::video::EPO_BACK, FogEnable, FrontfaceCulling, GouraudShading, Lighting, irr::video::MATERIAL_MAX_TEXTURES, NormalizeNormals, PointCloud, PolygonOffsetDirection, PolygonOffsetFactor, TextureLayer, irr::video::SMaterialLayer::TextureWrapU, irr::video::SMaterialLayer::TextureWrapV, UseMipMaps, Wireframe, ZBuffer, and ZWriteEnable.
Referenced by irr::scene::ISceneNode::setMaterialFlag().
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. |
Definition at line 482 of file SMaterial.h.
References irr::video::MATERIAL_MAX_TEXTURES, irr::video::SMaterialLayer::Texture, and TextureLayer.
Referenced by irr::scene::ISceneNode::setMaterialTexture().
void irr::video::SMaterial::setTextureMatrix | ( | u32 | i, |
const core::matrix4 & | mat | ||
) | [inline] |
Sets the i-th texture transformation matrix.
i | The desired level. |
mat | Texture matrix for texture level i. |
Definition at line 463 of file SMaterial.h.
References irr::video::MATERIAL_MAX_TEXTURES, irr::video::SMaterialLayer::setTextureMatrix(), and TextureLayer.
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.
Definition at line 306 of file SMaterial.h.
Referenced by operator!=(), and operator=().
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.
Definition at line 372 of file SMaterial.h.
Referenced by irr::video::SOverrideMaterial::apply(), getFlag(), operator!=(), operator=(), and setFlag().
Is backface culling enabled? Default: true.
Definition at line 425 of file SMaterial.h.
Referenced by irr::video::SOverrideMaterial::apply(), getFlag(), operator!=(), operator=(), and setFlag().
Store the blend operation of choice.
Values to be chosen from E_BLEND_OPERATION. The actual way to use this value is not yet determined, so ignore it for now.
Definition at line 392 of file SMaterial.h.
Referenced by irr::video::SOverrideMaterial::apply(), getFlag(), operator!=(), operator=(), and setFlag().
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.
Definition at line 379 of file SMaterial.h.
Referenced by irr::video::SOverrideMaterial::apply(), getFlag(), operator!=(), operator=(), and setFlag().
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.
Definition at line 387 of file SMaterial.h.
Referenced by irr::video::SOverrideMaterial::apply(), getFlag(), operator!=(), operator=(), and setFlag().
How much diffuse light coming from a light source is reflected by this material.
The default is full white.
Definition at line 310 of file SMaterial.h.
Referenced by operator!=(), and operator=().
Light emitted by this material. Default is to emit no light.
Definition at line 313 of file SMaterial.h.
Referenced by operator!=(), and operator=().
Is fog enabled? Default: false.
Definition at line 431 of file SMaterial.h.
Referenced by irr::video::SOverrideMaterial::apply(), getFlag(), operator!=(), operator=(), and setFlag().
Is frontface culling enabled? Default: false.
Definition at line 428 of file SMaterial.h.
Referenced by irr::video::SOverrideMaterial::apply(), getFlag(), operator!=(), operator=(), and setFlag().
Flat or Gouraud shading? Default: true.
Definition at line 413 of file SMaterial.h.
Referenced by irr::video::SOverrideMaterial::apply(), getFlag(), operator!=(), operator=(), and setFlag().
Will this material be lighted? Default: true.
Definition at line 416 of file SMaterial.h.
Referenced by irr::video::SOverrideMaterial::apply(), getFlag(), operator!=(), operator=(), and setFlag().
Type of the material. Specifies how everything is blended together.
Definition at line 300 of file SMaterial.h.
Referenced by isTransparent(), operator!=(), operator=(), and irr::scene::ISceneNode::setMaterialType().
Free parameter, dependent on the material type.
Mostly ignored, used for example in EMT_PARALLAX_MAP_SOLID and EMT_TRANSPARENT_ALPHA_CHANNEL.
Definition at line 355 of file SMaterial.h.
Referenced by operator!=(), and operator=().
Second free parameter, dependent on the material type.
Mostly ignored.
Definition at line 359 of file SMaterial.h.
Referenced by operator!=(), and operator=().
Should normals be normalized?
Always use this if the mesh lit and scaled. Default: false
Definition at line 435 of file SMaterial.h.
Referenced by irr::video::SOverrideMaterial::apply(), getFlag(), operator!=(), operator=(), and setFlag().
Draw as point cloud or filled triangles? Default: false.
Definition at line 410 of file SMaterial.h.
Referenced by irr::video::SOverrideMaterial::apply(), getFlag(), operator!=(), operator=(), and setFlag().
Flag defining the direction the polygon offset is applied to.
Can be to front or to back, specififed by values from E_POLYGON_OFFSET.
Definition at line 401 of file SMaterial.h.
Referenced by irr::video::SOverrideMaterial::apply(), operator!=(), operator=(), and setFlag().
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.
Definition at line 397 of file SMaterial.h.
Referenced by irr::video::SOverrideMaterial::apply(), getFlag(), operator!=(), operator=(), and setFlag().
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]:
sceneNode->getMaterial(0).Shininess = 20.0f;
You can change the color of the highlights using
sceneNode->getMaterial(0).SpecularColor.set(255,255,255,255);
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:
// load and display mesh scene::IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( smgr->getMesh("data/faerie.md2")); node->setMaterialTexture(0, driver->getTexture("data/Faerie2.pcx")); // set diffuse texture node->setMaterialFlag(video::EMF_LIGHTING, true); // enable dynamic lighting node->getMaterial(0).Shininess = 20.0f; // set size of specular highlights // add white light scene::ILightSceneNode* light = smgr->addLightSceneNode(0, core::vector3df(5,5,5), video::SColorf(1.0f, 1.0f, 1.0f));
Definition at line 350 of file SMaterial.h.
Referenced by operator!=(), and operator=().
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.
Definition at line 318 of file SMaterial.h.
Referenced by operator!=(), and operator=().
Texture layer array.
Definition at line 297 of file SMaterial.h.
Referenced by irr::video::SOverrideMaterial::apply(), getFlag(), getTexture(), getTextureMatrix(), operator!=(), operator=(), setFlag(), setTexture(), setTextureMatrix(), and SMaterial().
Thickness of non-3dimensional elements such as lines and points.
Definition at line 362 of file SMaterial.h.
Referenced by operator!=(), and operator=().
Shall mipmaps be used if available.
Sometimes, disabling mipmap usage can be useful. Default: true
Definition at line 439 of file SMaterial.h.
Referenced by irr::video::SOverrideMaterial::apply(), getFlag(), operator!=(), operator=(), and setFlag().
Draw as wireframe or filled triangles? Default: false.
The user can access a material flag using
material.Wireframe=true
or
material.setFlag(EMF_WIREFRAME, true);
Definition at line 407 of file SMaterial.h.
Referenced by irr::video::SOverrideMaterial::apply(), getFlag(), operator!=(), operator=(), and setFlag().
Is the ZBuffer enabled? Default: ECFN_LESSEQUAL.
Values are from E_COMPARISON_FUNC.
Definition at line 366 of file SMaterial.h.
Referenced by irr::video::SOverrideMaterial::apply(), getFlag(), operator!=(), operator=(), and setFlag().
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.
Definition at line 422 of file SMaterial.h.
Referenced by irr::video::SOverrideMaterial::apply(), getFlag(), operator!=(), operator=(), and setFlag().