Skylicht Engine
Loading...
Searching...
No Matches
SMaterial.h
1// Copyright (C) 2002-2012 Nikolaus Gebhardt
2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in irrlicht.h
4
5#ifndef __S_MATERIAL_H_INCLUDED__
6#define __S_MATERIAL_H_INCLUDED__
7
8#include "SColor.h"
9#include "matrix4.h"
10#include "irrArray.h"
11#include "irrMath.h"
12#include "EMaterialTypes.h"
13#include "EMaterialFlags.h"
14#include "SMaterialLayer.h"
15
16namespace irr
17{
18namespace video
19{
20 class ITexture;
21
37
52
55 {
56 EMFN_MODULATE_1X = 1,
57 EMFN_MODULATE_2X = 2,
58 EMFN_MODULATE_4X = 4
59 };
60
83
102
104
115
117
118 inline f32 pack_textureBlendFunc(const E_BLEND_FACTOR srcFact, const E_BLEND_FACTOR dstFact,
119 const E_MODULATE_FUNC modulate=EMFN_MODULATE_1X, const u32 alphaSource=EAS_TEXTURE)
120 {
121 const u32 tmp = (alphaSource << 20) | (modulate << 16) | (srcFact << 12) | (dstFact << 8) | (srcFact << 4) | dstFact;
122 return FR(tmp);
123 }
124
126
127 inline f32 pack_textureBlendFuncSeparate(const E_BLEND_FACTOR srcRGBFact, const E_BLEND_FACTOR dstRGBFact,
128 const E_BLEND_FACTOR srcAlphaFact, const E_BLEND_FACTOR dstAlphaFact,
129 const E_MODULATE_FUNC modulate=EMFN_MODULATE_1X, const u32 alphaSource=EAS_TEXTURE)
130 {
131 const u32 tmp = (alphaSource << 20) | (modulate << 16) | (srcAlphaFact << 12) | (dstAlphaFact << 8) | (srcRGBFact << 4) | dstRGBFact;
132 return FR(tmp);
133 }
134
136
138 E_MODULATE_FUNC &modulo, u32& alphaSource, const f32 param)
139 {
140 const u32 state = IR(param);
141 alphaSource = (state & 0x00F00000) >> 20;
142 modulo = E_MODULATE_FUNC( ( state & 0x000F0000 ) >> 16 );
143 srcFact = E_BLEND_FACTOR ( ( state & 0x000000F0 ) >> 4 );
144 dstFact = E_BLEND_FACTOR ( ( state & 0x0000000F ) );
145 }
146
148
150 E_BLEND_FACTOR &srcAlphaFact, E_BLEND_FACTOR &dstAlphaFact,
151 E_MODULATE_FUNC &modulo, u32& alphaSource, const f32 param)
152 {
153 const u32 state = IR(param);
154 alphaSource = (state & 0x00F00000) >> 20;
155 modulo = E_MODULATE_FUNC( ( state & 0x000F0000 ) >> 16 );
156 srcAlphaFact = E_BLEND_FACTOR ( ( state & 0x0000F000 ) >> 12 );
157 dstAlphaFact = E_BLEND_FACTOR ( ( state & 0x00000F00 ) >> 8 );
158 srcRGBFact = E_BLEND_FACTOR ( ( state & 0x000000F0 ) >> 4 );
159 dstRGBFact = E_BLEND_FACTOR ( ( state & 0x0000000F ) );
160 }
161
163 inline bool textureBlendFunc_hasAlpha ( const E_BLEND_FACTOR factor )
164 {
165 switch ( factor )
166 {
167 case EBF_SRC_ALPHA:
169 case EBF_DST_ALPHA:
172 return true;
173 default:
174 return false;
175 }
176 }
177
178
180
204
206
227
229
231 {
233
236
239 };
240
243 {
244 "Back",
245 "Front",
246 0
247 };
248
249
251 const u32 MATERIAL_MAX_TEXTURES = _IRR_MATERIAL_MAX_TEXTURES_;
252
255 {
256 public:
259 : MaterialType(0), AmbientColor(255,255,255,255), DiffuseColor(255,255,255,255),
260 EmissiveColor(0,0,0,0), SpecularColor(255,255,255,255),
261 Shininess(0.0f), MaterialTypeParam(0.0f), MaterialTypeParam2(0.0f), Thickness(1.0f),
265 Wireframe(false), PointCloud(false), GouraudShading(true),
266 Lighting(true), ZWriteEnable(true), BackfaceCulling(true), FrontfaceCulling(false),
267 FogEnable(false), NormalizeNormals(false), UseMipMaps(true), MaterialInfo(NULL)
268 { }
269
271
272 SMaterial(const SMaterial& other)
273 {
274 // These pointers are checked during assignment
275 for (u32 i=0; i<MATERIAL_MAX_TEXTURES; ++i)
276 TextureLayer[i].TextureMatrix = 0;
277 *this = other;
278 }
279
281
283 {
284 // Check for self-assignment!
285 if (this == &other)
286 return *this;
287
289
294 Shininess = other.Shininess;
297 Thickness = other.Thickness;
298 for (u32 i=0; i<MATERIAL_MAX_TEXTURES; ++i)
299 {
300 TextureLayer[i] = other.TextureLayer[i];
301 }
302
303 Wireframe = other.Wireframe;
304 PointCloud = other.PointCloud;
306 Lighting = other.Lighting;
310 FogEnable = other.FogEnable;
312 ZBuffer = other.ZBuffer;
314 ColorMask = other.ColorMask;
317 BlendFactor = other.BlendFactor;
320 UseMipMaps = other.UseMipMaps;
322
323 return *this;
324 }
325
328
331
334
336
340
342
344
347
349
352
354
384
386
389
391
393
396
398
402
404
408
410
415
417
423
425
427
429
433
435
438
440
442
444
447 bool Wireframe:1;
448
451
454
456 bool Lighting:1;
457
459
464
467
470
472 bool FogEnable:1;
473
475
477
479
481
483
486 {
487 return TextureLayer[i].getTextureMatrix();
488 }
489
491
494 {
496 return TextureLayer[i].getTextureMatrix();
497 else
499 }
500
502
505 {
507 return;
508 TextureLayer[i].setTextureMatrix(mat);
509 }
510
512
515 {
516 //return i < MATERIAL_MAX_TEXTURES ? TextureLayer[i].Texture : 0;
517 return TextureLayer[i].Texture;
518 }
519
521
524 void setTexture(u32 i, ITexture* tex)
525 {
526 //if (i>=MATERIAL_MAX_TEXTURES)
527 // return;
528 TextureLayer[i].Texture = tex;
529 }
530
532
534 void setFlag(E_MATERIAL_FLAG flag, bool value, int intValue = 0)
535 {
536 switch (flag)
537 {
538 case EMF_WIREFRAME:
539 Wireframe = value; break;
540 case EMF_POINTCLOUD:
541 PointCloud = value; break;
543 GouraudShading = value; break;
544 case EMF_LIGHTING:
545 Lighting = value; break;
546 case EMF_ZBUFFER:
547 ZBuffer = value; break;
549 ZWriteEnable = value; break;
551 BackfaceCulling = value; break;
553 FrontfaceCulling = value; break;
555 {
556 for (u32 i=0; i<MATERIAL_MAX_TEXTURES; ++i)
557 TextureLayer[i].BilinearFilter = value;
558 }
559 break;
561 {
562 for (u32 i=0; i<MATERIAL_MAX_TEXTURES; ++i)
563 TextureLayer[i].TrilinearFilter = value;
564 }
565 break;
567 {
568 if (value)
569 for (u32 i=0; i<MATERIAL_MAX_TEXTURES; ++i)
570 TextureLayer[i].AnisotropicFilter = intValue;
571 else
572 for (u32 i=0; i<MATERIAL_MAX_TEXTURES; ++i)
573 TextureLayer[i].AnisotropicFilter = 0;
574 }
575 break;
576 case EMF_FOG_ENABLE:
577 FogEnable = value; break;
579 NormalizeNormals = value; break;
580 case EMF_TEXTURE_WRAP:
581 {
582 for (u32 i=0; i<MATERIAL_MAX_TEXTURES; ++i)
583 {
584 TextureLayer[i].TextureWrapU = (E_TEXTURE_CLAMP)value;
585 TextureLayer[i].TextureWrapV = (E_TEXTURE_CLAMP)value;
586 }
587 }
588 break;
590 AntiAliasing = value?EAAM_SIMPLE:EAAM_OFF; break;
591 case EMF_COLOR_MASK:
592 ColorMask = value?ECP_ALL:ECP_NONE; break;
594 ColorMaterial = value?ECM_DIFFUSE:ECM_NONE; break;
595 case EMF_USE_MIP_MAPS:
596 UseMipMaps = value; break;
598 BlendOperation = value?EBO_ADD:EBO_NONE; break;
599 case EMF_BLEND_FACTOR:
600 break;
602 PolygonOffsetFactor = value?1:0;
604 break;
605 default:
606 break;
607 }
608 }
609
611
613 bool getFlag(E_MATERIAL_FLAG flag) const
614 {
615 switch (flag)
616 {
617 case EMF_WIREFRAME:
618 return Wireframe;
619 case EMF_POINTCLOUD:
620 return PointCloud;
622 return GouraudShading;
623 case EMF_LIGHTING:
624 return Lighting;
625 case EMF_ZBUFFER:
626 return ZBuffer!=ECFN_DISABLED;
628 return ZWriteEnable;
630 return BackfaceCulling;
632 return FrontfaceCulling;
634 return TextureLayer[0].BilinearFilter;
636 return TextureLayer[0].TrilinearFilter;
638 return TextureLayer[0].AnisotropicFilter!=0;
639 case EMF_FOG_ENABLE:
640 return FogEnable;
642 return NormalizeNormals;
643 case EMF_TEXTURE_WRAP:
644 return !(TextureLayer[0].TextureWrapU ||
645 TextureLayer[0].TextureWrapV ||
646 TextureLayer[1].TextureWrapU ||
647 TextureLayer[1].TextureWrapV ||
648 TextureLayer[2].TextureWrapU ||
649 TextureLayer[2].TextureWrapV ||
650 TextureLayer[3].TextureWrapU ||
651 TextureLayer[3].TextureWrapV);
653 return (AntiAliasing==1);
654 case EMF_COLOR_MASK:
655 return (ColorMask!=ECP_NONE);
657 return (ColorMaterial != ECM_NONE);
658 case EMF_USE_MIP_MAPS:
659 return UseMipMaps;
661 return BlendOperation != EBO_NONE;
662 case EMF_BLEND_FACTOR:
663 return BlendFactor != 0.f;
665 return PolygonOffsetFactor != 0;
666 }
667
668 return false;
669 }
670
672
674 inline bool operator!=(const SMaterial& b) const
675 {
676 bool different =
682 Shininess != b.Shininess ||
685 Thickness != b.Thickness ||
686 Wireframe != b.Wireframe ||
687 PointCloud != b.PointCloud ||
689 Lighting != b.Lighting ||
690 ZBuffer != b.ZBuffer ||
694 FogEnable != b.FogEnable ||
697 ColorMask != b.ColorMask ||
704
705 for (u32 i=0; (i<MATERIAL_MAX_TEXTURES) && !different; ++i)
706 {
707 different |= (TextureLayer[i] != b.TextureLayer[i]);
708 }
709 return different;
710 }
711
713
715 inline bool operator==(const SMaterial& b) const
716 { return !(b!=*this); }
717
718 };
719
721 IRRLICHT_API extern SMaterial IdentityMaterial;
722
723} // end namespace video
724} // end namespace irr
725
726#endif
Interface of a Video Driver dependent Texture.
Definition ITexture.h:119
Class representing a 32 bit ARGB color.
Definition SColor.h:285
SColor EmissiveColor
Light emitted by this material. Default is to emit no light.
Definition SMaterial.h:346
bool ZWriteEnable
Is the zbuffer writeable or is it read-only. Default: true.
Definition SMaterial.h:463
u8 ColorMaterial
Defines the interpretation of vertex color in the lighting equation.
Definition SMaterial.h:422
SColor SpecularColor
How much specular light (highlights from a light) is reflected.
Definition SMaterial.h:351
s32 MaterialType
Type of the material. Specifies how everything is blended together.
Definition SMaterial.h:333
SMaterialLayer TextureLayer[MATERIAL_MAX_TEXTURES]
Texture layer array.
Definition SMaterial.h:330
bool operator==(const SMaterial &b) const
Equality operator.
Definition SMaterial.h:715
const core::matrix4 & getTextureMatrix(u32 i) const
Gets the immutable texture transformation matrix for level i.
Definition SMaterial.h:493
bool getFlag(E_MATERIAL_FLAG flag) const
Gets the Material flag.
Definition SMaterial.h:613
f32 MaterialTypeParam2
Second free parameter, dependent on the material type.
Definition SMaterial.h:392
SColor AmbientColor
How much ambient light (a global light) is reflected by this material.
Definition SMaterial.h:339
void setTexture(u32 i, ITexture *tex)
Sets the i-th texture.
Definition SMaterial.h:524
bool PointCloud
Draw as point cloud or filled triangles? Default: false.
Definition SMaterial.h:450
f32 BlendFactor
Store the blend factors.
Definition SMaterial.h:432
core::matrix4 & getTextureMatrix(u32 i)
Gets the texture transformation matrix for level i.
Definition SMaterial.h:485
void * MaterialInfo
Extern tag infomation.
Definition SMaterial.h:327
u8 ColorMask
Defines the enabled color planes.
Definition SMaterial.h:414
f32 Thickness
Thickness of non-3dimensional elements such as lines and points.
Definition SMaterial.h:395
SMaterial(const SMaterial &other)
Copy constructor.
Definition SMaterial.h:272
void setTextureMatrix(u32 i, const core::matrix4 &mat)
Sets the i-th texture transformation matrix.
Definition SMaterial.h:504
bool Wireframe
Draw as wireframe or filled triangles? Default: false.
Definition SMaterial.h:447
u8 ZBuffer
Is the ZBuffer enabled? Default: ECFN_LESSEQUAL.
Definition SMaterial.h:401
f32 Shininess
Value affecting the size of specular highlights.
Definition SMaterial.h:383
u8 AntiAliasing
Sets the antialiasing mode.
Definition SMaterial.h:407
bool UseMipMaps
Shall mipmaps be used if available.
Definition SMaterial.h:480
SMaterial & operator=(const SMaterial &other)
Assignment operator.
Definition SMaterial.h:282
bool FrontfaceCulling
Is frontface culling enabled? Default: false.
Definition SMaterial.h:469
bool FogEnable
Is fog enabled? Default: false.
Definition SMaterial.h:472
ITexture * getTexture(u32 i) const
Gets the i-th texture.
Definition SMaterial.h:514
E_POLYGON_OFFSET PolygonOffsetDirection
Flag defining the direction the polygon offset is applied to.
Definition SMaterial.h:441
bool GouraudShading
Flat or Gouraud shading? Default: true.
Definition SMaterial.h:453
SColor DiffuseColor
How much diffuse light coming from a light source is reflected by this material.
Definition SMaterial.h:343
SMaterial()
Default constructor. Creates a solid, lit material with white colors.
Definition SMaterial.h:258
bool operator!=(const SMaterial &b) const
Inequality operator.
Definition SMaterial.h:674
bool NormalizeNormals
Should normals be normalized?
Definition SMaterial.h:476
f32 MaterialTypeParam
Free parameter, dependent on the material type.
Definition SMaterial.h:388
void setFlag(E_MATERIAL_FLAG flag, bool value, int intValue=0)
Sets the Material flag to the given value.
Definition SMaterial.h:534
bool BackfaceCulling
Is backface culling enabled? Default: true.
Definition SMaterial.h:466
u8 PolygonOffsetFactor
Factor specifying how far the polygon offset should be made.
Definition SMaterial.h:437
E_BLEND_OPERATION BlendOperation
Store the blend operation of choice.
Definition SMaterial.h:426
bool Lighting
Will this material be lighted? Default: true.
Definition SMaterial.h:456
Struct for holding material parameters which exist per texture layer.
Definition SMaterialLayer.h:49
CMatrix4< f32 > matrix4
Typedef for f32 matrix.
Definition matrix4.h:2241
IRRLICHT_API const matrix4 IdentityMatrix
global const identity matrix
The video namespace contains classes for accessing the video driver. All 2d and 3d rendering is done ...
Definition EDriverFeatures.h:11
E_ALPHA_SOURCE
Source of the alpha value to take.
Definition SMaterial.h:107
@ EAS_NONE
Use no alpha, somewhat redundant with other settings.
Definition SMaterial.h:109
@ EAS_VERTEX_COLOR
Use vertex color alpha.
Definition SMaterial.h:111
@ EAS_TEXTURE
Use texture alpha channel.
Definition SMaterial.h:113
E_MODULATE_FUNC
MaterialTypeParam: e.g. DirectX: D3DTOP_MODULATE, D3DTOP_MODULATE2X, D3DTOP_MODULATE4X.
Definition SMaterial.h:55
E_COLOR_MATERIAL
These flags allow to define the interpretation of vertex color when lighting is enabled.
Definition SMaterial.h:213
@ ECM_NONE
Don't use vertex color for lighting.
Definition SMaterial.h:215
@ ECM_EMISSIVE
Use vertex color for emissive light.
Definition SMaterial.h:221
@ ECM_DIFFUSE_AND_AMBIENT
Use vertex color for both diffuse and ambient light.
Definition SMaterial.h:225
@ ECM_SPECULAR
Use vertex color for specular light.
Definition SMaterial.h:223
@ ECM_DIFFUSE
Use vertex color for diffuse light, this is default.
Definition SMaterial.h:217
@ ECM_AMBIENT
Use vertex color for ambient light.
Definition SMaterial.h:219
const c8 *const PolygonOffsetDirectionNames[]
Names for polygon offset direction.
Definition SMaterial.h:242
E_TEXTURE_CLAMP
Texture coord clamp mode outside [0.0, 1.0].
Definition SMaterialLayer.h:19
bool textureBlendFunc_hasAlpha(const E_BLEND_FACTOR factor)
has blend factor alphablending
Definition SMaterial.h:163
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.
Definition SMaterial.h:149
IRRLICHT_API SMaterial IdentityMaterial
global const identity Material
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.
Definition SMaterial.h:137
E_BLEND_OPERATION
Values defining the blend operation.
Definition SMaterial.h:40
@ EBO_NONE
No blending happens.
Definition SMaterial.h:41
@ EBO_MIN
Choose minimum value of each color channel.
Definition SMaterial.h:45
@ EBO_REVSUBTRACT
This modes subtracts destination from source.
Definition SMaterial.h:44
@ EBO_MIN_FACTOR
Choose minimum value of each color channel after applying blend factors, not widely supported.
Definition SMaterial.h:47
@ EBO_SUBTRACT
This mode subtracts the color values.
Definition SMaterial.h:43
@ EBO_MAX_ALPHA
Choose maximum value of each color channel based on alpha value, not widely supported.
Definition SMaterial.h:50
@ EBO_MAX_FACTOR
Choose maximum value of each color channel after applying blend factors, not widely supported.
Definition SMaterial.h:48
@ EBO_ADD
Default blending adds the color values.
Definition SMaterial.h:42
@ EBO_MIN_ALPHA
Choose minimum value of each color channel based on alpha value, not widely supported.
Definition SMaterial.h:49
@ EBO_MAX
Choose maximum value of each color channel.
Definition SMaterial.h:46
E_POLYGON_OFFSET
Flags for the definition of the polygon offset feature.
Definition SMaterial.h:231
@ EPO_BACK
Push pixel towards the far plane, away from the eye.
Definition SMaterial.h:234
@ EPO_FRONT
Pull pixels towards the camera.
Definition SMaterial.h:238
E_MATERIAL_FLAG
Material flags.
Definition EMaterialFlags.h:15
@ EMF_FRONT_FACE_CULLING
Is frontface culling enabled? Default: false.
Definition EMaterialFlags.h:40
@ EMF_POINTCLOUD
Draw as point cloud or filled triangles? Default: false.
Definition EMaterialFlags.h:20
@ EMF_NORMALIZE_NORMALS
Normalizes normals. Default: false.
Definition EMaterialFlags.h:66
@ EMF_ZBUFFER
Is the ZBuffer enabled? Default: true.
Definition EMaterialFlags.h:29
@ EMF_ZWRITE_ENABLE
May be written to the zbuffer or is it readonly. Default: true.
Definition EMaterialFlags.h:33
@ EMF_FOG_ENABLE
Is fog enabled? Default: false.
Definition EMaterialFlags.h:58
@ EMF_COLOR_MASK
ColorMask bits, for enabling the color planes.
Definition EMaterialFlags.h:75
@ EMF_TRILINEAR_FILTER
Is trilinear filtering enabled? Default: false.
Definition EMaterialFlags.h:48
@ EMF_TEXTURE_WRAP
Access to all layers texture wrap settings. Overwrites separate layer settings.
Definition EMaterialFlags.h:69
@ EMF_COLOR_MATERIAL
ColorMaterial enum for vertex color interpretation.
Definition EMaterialFlags.h:78
@ EMF_GOURAUD_SHADING
Flat or Gouraud shading? Default: true.
Definition EMaterialFlags.h:23
@ EMF_USE_MIP_MAPS
Flag for enabling/disabling mipmap usage.
Definition EMaterialFlags.h:81
@ EMF_ANISOTROPIC_FILTER
Is anisotropic filtering? Default: false.
Definition EMaterialFlags.h:55
@ EMF_ANTI_ALIASING
AntiAliasing mode.
Definition EMaterialFlags.h:72
@ EMF_BLEND_OPERATION
Flag for blend operation.
Definition EMaterialFlags.h:84
@ EMF_WIREFRAME
Draw as wireframe or filled triangles? Default: false.
Definition EMaterialFlags.h:17
@ EMF_POLYGON_OFFSET
Flag for polygon offset.
Definition EMaterialFlags.h:87
@ EMF_LIGHTING
Will this material be lighted? Default: true.
Definition EMaterialFlags.h:26
@ EMF_BACK_FACE_CULLING
Is backface culling enabled? Default: true.
Definition EMaterialFlags.h:36
@ EMF_BLEND_FACTOR
Flag for blend factor.
Definition EMaterialFlags.h:90
@ EMF_BILINEAR_FILTER
Is bilinear filtering enabled? Default: true.
Definition EMaterialFlags.h:43
E_ANTI_ALIASING_MODE
These flags are used to specify the anti-aliasing and smoothing modes.
Definition SMaterial.h:187
@ EAAM_SIMPLE
Default anti-aliasing mode.
Definition SMaterial.h:191
@ EAAM_QUALITY
High-quality anti-aliasing, not always supported, automatically enables SIMPLE mode.
Definition SMaterial.h:193
@ EAAM_LINE_SMOOTH
Line smoothing.
Definition SMaterial.h:195
@ EAAM_POINT_SMOOTH
point smoothing, often in software and slow, only with OpenGL
Definition SMaterial.h:197
@ EAAM_OFF
Use to turn off anti-aliasing for this material.
Definition SMaterial.h:189
@ EAAM_ALPHA_TO_COVERAGE
Enhanced anti-aliasing for transparent materials.
Definition SMaterial.h:202
@ EAAM_FULL_BASIC
All typical anti-alias and smooth modes.
Definition SMaterial.h:199
E_COLOR_PLANE
Enum values for enabling/disabling color planes for rendering.
Definition SMaterial.h:86
@ ECP_GREEN
Green enabled.
Definition SMaterial.h:94
@ ECP_BLUE
Blue enabled.
Definition SMaterial.h:96
@ ECP_RED
Red enabled.
Definition SMaterial.h:92
@ ECP_RGB
All colors, no alpha.
Definition SMaterial.h:98
@ ECP_ALL
All planes enabled.
Definition SMaterial.h:100
@ ECP_NONE
No color enabled.
Definition SMaterial.h:88
@ ECP_ALPHA
Alpha enabled.
Definition SMaterial.h:90
E_BLEND_FACTOR
Flag for EMT_ONETEXTURE_BLEND, ( BlendFactor ) BlendFunc = source * sourceFactor + dest * destFactor.
Definition SMaterial.h:24
@ EBF_ONE_MINUS_DST_COLOR
src (1-destR, 1-destG, 1-destB, 1-destA)
Definition SMaterial.h:28
@ EBF_SRC_ALPHA_SATURATE
src (min(srcA, 1-destA), idem, ...)
Definition SMaterial.h:35
@ EBF_SRC_ALPHA
src & dest (srcA, srcA, srcA, srcA)
Definition SMaterial.h:31
@ EBF_ONE
src & dest (1, 1, 1, 1)
Definition SMaterial.h:26
@ EBF_ONE_MINUS_DST_ALPHA
src & dest (1-destA, 1-destA, 1-destA, 1-destA)
Definition SMaterial.h:34
@ EBF_SRC_COLOR
dest (srcR, srcG, srcB, srcA)
Definition SMaterial.h:29
@ EBF_DST_ALPHA
src & dest (destA, destA, destA, destA)
Definition SMaterial.h:33
@ EBF_ZERO
src & dest (0, 0, 0, 0)
Definition SMaterial.h:25
@ EBF_ONE_MINUS_SRC_ALPHA
src & dest (1-srcA, 1-srcA, 1-srcA, 1-srcA)
Definition SMaterial.h:32
@ EBF_DST_COLOR
src (destR, destG, destB, destA)
Definition SMaterial.h:27
@ EBF_ONE_MINUS_SRC_COLOR
dest (1-srcR, 1-srcG, 1-srcB, 1-srcA)
Definition SMaterial.h:30
const u32 MATERIAL_MAX_TEXTURES
Maximum number of texture an SMaterial can have.
Definition SMaterial.h:251
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.
Definition SMaterial.h:118
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...
Definition SMaterial.h:127
E_COMPARISON_FUNC
Comparison function, e.g. for depth buffer test.
Definition SMaterial.h:63
@ ECFN_LESS
exclusive less comparison, i.e. <
Definition SMaterial.h:71
@ ECFN_GREATER
inverse of <=
Definition SMaterial.h:77
@ ECFN_GREATEREQUAL
>= test
Definition SMaterial.h:75
@ ECFN_NEVER
Test never succeeds.
Definition SMaterial.h:81
@ ECFN_LESSEQUAL
<= test, default for e.g. depth test
Definition SMaterial.h:67
@ ECFN_ALWAYS
test succeeds always
Definition SMaterial.h:79
@ ECFN_EQUAL
Exact equality.
Definition SMaterial.h:69
@ ECFN_NOTEQUAL
Succeeds almost always, except for exact equality.
Definition SMaterial.h:73
@ ECFN_DISABLED
Depth test disabled (disable also write to depth buffer).
Definition SMaterial.h:65
Everything in the Irrlicht Engine can be found in this namespace.
Definition Skylicht.h:33
float f32
32 bit floating point variable.
Definition irrTypes.h:104
unsigned int u32
32 bit unsigned variable.
Definition irrTypes.h:58
unsigned char u8
8 bit unsigned variable.
Definition irrTypes.h:18
char c8
8 bit character variable.
Definition irrTypes.h:31
signed int s32
32 bit signed variable.
Definition irrTypes.h:66