arsa  2.7
Public Member Functions | Public Attributes | Friends | List of all members
irr::video::SMaterialLayer Class Reference

Struct for holding material parameters which exist per texture layer. More...

#include <SMaterialLayer.h>

Public Member Functions

 SMaterialLayer ()
 Default constructor. More...
 
 SMaterialLayer (const SMaterialLayer &other)
 Copy constructor. More...
 
 ~SMaterialLayer ()
 Destructor. More...
 
SMaterialLayeroperator= (const SMaterialLayer &other)
 Assignment operator. More...
 
core::matrix4getTextureMatrix ()
 Gets the texture transformation matrix. More...
 
const core::matrix4getTextureMatrix () const
 Gets the immutable texture transformation matrix. More...
 
void setTextureMatrix (const core::matrix4 &mat)
 Sets the texture transformation matrix to mat. More...
 
bool operator!= (const SMaterialLayer &b) const
 Inequality operator. More...
 
bool operator== (const SMaterialLayer &b) const
 Equality operator. More...
 

Public Attributes

ITextureTexture
 Texture. More...
 
u8 TextureWrapU:4
 Texture Clamp Mode. More...
 
u8 TextureWrapV:4
 
u8 TextureWrapW:4
 
bool BilinearFilter:1
 Is bilinear filtering enabled? Default: true. More...
 
bool TrilinearFilter:1
 Is trilinear filtering enabled? Default: false. More...
 
u8 AnisotropicFilter
 Is anisotropic filtering enabled? Default: 0, disabled. More...
 
s8 LODBias
 Bias for the mipmap choosing decision. More...
 

Friends

class SMaterial
 

Detailed Description

Struct for holding material parameters which exist per texture layer.

Definition at line 49 of file SMaterialLayer.h.

Constructor & Destructor Documentation

◆ SMaterialLayer() [1/2]

irr::video::SMaterialLayer::SMaterialLayer ( )
inline

Default constructor.

Definition at line 53 of file SMaterialLayer.h.

54  BilinearFilter(true), TrilinearFilter(false), AnisotropicFilter(0), LODBias(0), TextureMatrix(0)
55  {
56  }
bool TrilinearFilter
Is trilinear filtering enabled? Default: false.
u8 TextureWrapU
Texture Clamp Mode.
Texture repeats.
ITexture * Texture
Texture.
u8 AnisotropicFilter
Is anisotropic filtering enabled? Default: 0, disabled.
bool BilinearFilter
Is bilinear filtering enabled? Default: true.
s8 LODBias
Bias for the mipmap choosing decision.

◆ SMaterialLayer() [2/2]

irr::video::SMaterialLayer::SMaterialLayer ( const SMaterialLayer other)
inline

Copy constructor.

Parameters
otherMaterial layer to copy from.

Definition at line 60 of file SMaterialLayer.h.

61  {
62  // This pointer is checked during assignment
63  TextureMatrix = 0;
64  *this = other;
65  }

◆ ~SMaterialLayer()

irr::video::SMaterialLayer::~SMaterialLayer ( )
inline

Destructor.

Definition at line 68 of file SMaterialLayer.h.

69  {
70  if ( TextureMatrix )
71  {
72  MatrixAllocator.destruct(TextureMatrix);
73  MatrixAllocator.deallocate(TextureMatrix);
74  }
75  }

Member Function Documentation

◆ getTextureMatrix() [1/2]

core::matrix4& irr::video::SMaterialLayer::getTextureMatrix ( )
inline

Gets the texture transformation matrix.

Returns
Texture matrix of this layer.

Definition at line 121 of file SMaterialLayer.h.

122  {
123  if (!TextureMatrix)
124  {
125  TextureMatrix = MatrixAllocator.allocate(1);
126  MatrixAllocator.construct(TextureMatrix,core::IdentityMatrix);
127  }
128  return *TextureMatrix;
129  }
IRRLICHT_API const matrix4 IdentityMatrix
global const identity matrix

◆ getTextureMatrix() [2/2]

const core::matrix4& irr::video::SMaterialLayer::getTextureMatrix ( ) const
inline

Gets the immutable texture transformation matrix.

Returns
Texture matrix of this layer.

Definition at line 133 of file SMaterialLayer.h.

134  {
135  if (TextureMatrix)
136  return *TextureMatrix;
137  else
138  return core::IdentityMatrix;
139  }
IRRLICHT_API const matrix4 IdentityMatrix
global const identity matrix

◆ operator!=()

bool irr::video::SMaterialLayer::operator!= ( const SMaterialLayer b) const
inline

Inequality operator.

Parameters
bLayer to compare to.
Returns
True if layers are different, else false.

Definition at line 159 of file SMaterialLayer.h.

160  {
161  bool different =
162  Texture != b.Texture ||
163  TextureWrapU != b.TextureWrapU ||
164  TextureWrapV != b.TextureWrapV ||
165  TextureWrapW != b.TextureWrapW ||
166  BilinearFilter != b.BilinearFilter ||
167  TrilinearFilter != b.TrilinearFilter ||
168  AnisotropicFilter != b.AnisotropicFilter ||
169  LODBias != b.LODBias;
170  if (different)
171  return true;
172  else
173  different |= (TextureMatrix != b.TextureMatrix) &&
174  (!TextureMatrix || !b.TextureMatrix || (*TextureMatrix != *(b.TextureMatrix)));
175  return different;
176  }
bool TrilinearFilter
Is trilinear filtering enabled? Default: false.
u8 TextureWrapU
Texture Clamp Mode.
ITexture * Texture
Texture.
u8 AnisotropicFilter
Is anisotropic filtering enabled? Default: 0, disabled.
bool BilinearFilter
Is bilinear filtering enabled? Default: true.
GLboolean GLboolean GLboolean b
s8 LODBias
Bias for the mipmap choosing decision.

◆ operator=()

SMaterialLayer& irr::video::SMaterialLayer::operator= ( const SMaterialLayer other)
inline

Assignment operator.

Parameters
otherMaterial layer to copy from.
Returns
This material layer, updated.

Definition at line 80 of file SMaterialLayer.h.

81  {
82  // Check for self-assignment!
83  if (this == &other)
84  return *this;
85 
86  Texture = other.Texture;
87  if (TextureMatrix)
88  {
89  if (other.TextureMatrix)
90  *TextureMatrix = *other.TextureMatrix;
91  else
92  {
93  MatrixAllocator.destruct(TextureMatrix);
94  MatrixAllocator.deallocate(TextureMatrix);
95  TextureMatrix = 0;
96  }
97  }
98  else
99  {
100  if (other.TextureMatrix)
101  {
102  TextureMatrix = MatrixAllocator.allocate(1);
103  MatrixAllocator.construct(TextureMatrix,*other.TextureMatrix);
104  }
105  else
106  TextureMatrix = 0;
107  }
108  TextureWrapU = other.TextureWrapU;
109  TextureWrapV = other.TextureWrapV;
110  TextureWrapW = other.TextureWrapW;
111  BilinearFilter = other.BilinearFilter;
112  TrilinearFilter = other.TrilinearFilter;
113  AnisotropicFilter = other.AnisotropicFilter;
114  LODBias = other.LODBias;
115 
116  return *this;
117  }
bool TrilinearFilter
Is trilinear filtering enabled? Default: false.
u8 TextureWrapU
Texture Clamp Mode.
ITexture * Texture
Texture.
u8 AnisotropicFilter
Is anisotropic filtering enabled? Default: 0, disabled.
bool BilinearFilter
Is bilinear filtering enabled? Default: true.
s8 LODBias
Bias for the mipmap choosing decision.

◆ operator==()

bool irr::video::SMaterialLayer::operator== ( const SMaterialLayer b) const
inline

Equality operator.

Parameters
bLayer to compare to.
Returns
True if layers are equal, else false.

Definition at line 181 of file SMaterialLayer.h.

182  { return !(b!=*this); }
GLboolean GLboolean GLboolean b

◆ setTextureMatrix()

void irr::video::SMaterialLayer::setTextureMatrix ( const core::matrix4 mat)
inline

Sets the texture transformation matrix to mat.

NOTE: Pipelines can ignore this matrix when the texture is 0.

Parameters
matNew texture matrix for this layer.

Definition at line 145 of file SMaterialLayer.h.

146  {
147  if (!TextureMatrix)
148  {
149  TextureMatrix = MatrixAllocator.allocate(1);
150  MatrixAllocator.construct(TextureMatrix,mat);
151  }
152  else
153  *TextureMatrix = mat;
154  }

Friends And Related Function Documentation

◆ SMaterial

friend class SMaterial
friend

Definition at line 218 of file SMaterialLayer.h.

Member Data Documentation

◆ AnisotropicFilter

u8 irr::video::SMaterialLayer::AnisotropicFilter

Is anisotropic filtering enabled? Default: 0, disabled.

In Irrlicht you can use anisotropic texture filtering in conjunction with bilinear or trilinear texture filtering to improve rendering results. Primitives will look less blurry with this flag switched on. The number gives the maximal anisotropy degree, and is often in the range 2-16. Value 1 is equivalent to 0, but should be avoided.

Definition at line 208 of file SMaterialLayer.h.

◆ BilinearFilter

bool irr::video::SMaterialLayer::BilinearFilter

Is bilinear filtering enabled? Default: true.

Definition at line 194 of file SMaterialLayer.h.

◆ LODBias

s8 irr::video::SMaterialLayer::LODBias

Bias for the mipmap choosing decision.

This value can make the textures more or less blurry than with the default value of 0. The value (divided by 8.f) is added to the mipmap level chosen initially, and thus takes a smaller mipmap for a region if the value is positive.

Definition at line 215 of file SMaterialLayer.h.

◆ Texture

ITexture* irr::video::SMaterialLayer::Texture

Texture.

Definition at line 185 of file SMaterialLayer.h.

◆ TextureWrapU

u8 irr::video::SMaterialLayer::TextureWrapU

Texture Clamp Mode.

Values are taken from E_TEXTURE_CLAMP.

Definition at line 189 of file SMaterialLayer.h.

◆ TextureWrapV

u8 irr::video::SMaterialLayer::TextureWrapV

Definition at line 190 of file SMaterialLayer.h.

◆ TextureWrapW

u8 irr::video::SMaterialLayer::TextureWrapW

Definition at line 191 of file SMaterialLayer.h.

◆ TrilinearFilter

bool irr::video::SMaterialLayer::TrilinearFilter

Is trilinear filtering enabled? Default: false.

If the trilinear filter flag is enabled, the bilinear filtering flag is ignored.

Definition at line 199 of file SMaterialLayer.h.


The documentation for this class was generated from the following file: