A material represent ALL the states relatives to the aspect of a primitive. More...
#include <material.h>
Inherits NLMISC::CRefCount.
Classes | |
| struct | CLightMap |
| struct | CTexEnv |
| struct | CUserTexMat |
Public Types | |
| enum | ZFunc { always = 0, never, equal, notequal, less, lessequal, greater, greaterequal, zfuncCount } |
| enum | TBlend { one = 0, zero, srcalpha, invsrcalpha, srccolor, invsrccolor, blendConstantColor, blendConstantInvColor, blendConstantAlpha, blendConstantInvAlpha, blendCount } |
Blend enums. More... | |
| enum | TShader { Normal = 0, Bump, UserColor, LightMap, Specular, Caustics, PerPixelLighting, PerPixelLightingNoSpec, Cloud, Water, shaderCount } |
Normal shader:
| |
| enum | TTexCoordGenMode { TexCoordGenReflect = 0, TexCoordGenObjectSpace, TexCoordGenEyeSpace, numTexCoordGenMode } |
TexGen Mode. More... | |
| typedef std::vector< CLightMap > | TTexturePtrs |
Texture Env Modes. | |
| enum | TTexOperator { Replace = 0, Modulate, Add, AddSigned, InterpolateTexture, InterpolatePrevious, InterpolateDiffuse, InterpolateConstant, EMBM, Mad, TexOperatorCount } |
Environements operators: Replace: out= arg0 Modulate: out= arg0 * arg1 Add: out= arg0 + arg1 AddSigned: out= arg0 + arg1 -0.5 Interpolate*: out= arg0*As + arg1*(1-As), where As is taken from the SrcAlpha of Texture/Previous/Diffuse/Constant, respectively if operator is InterpolateTexture/InterpolatePrevious/InterpolateDiffuse/InterpolateConstant. More... | |
| enum | TTexSource { Texture = 0, Previous, Diffuse, Constant, TexSourceCount } |
Source argument. More... | |
| enum | TTexOperand { SrcColor = 0, InvSrcColor, SrcAlpha, InvSrcAlpha, TexOperandCount } |
Operand for the argument. More... | |
Texture Addressing Modes. They are valid only with the normal texture shader. | |
| enum | TTexAddressingMode { TextureOff = 0, FetchTexture, PassThrough, CullFragment, OffsetTexture, OffsetTextureScale, DependentARTexture, DependentGBTexture, DP3, DP3Texture2D, DP3CubeMap, DP3ReflectCubeMap, DP3ConstEyeReflectCubeMap, DP3DiffuseCubeMap, DP3DepthReplace, TexAddrCount } |
Public Member Functions | |
| void | setShader (TShader val) |
| Set the shader for this material. | |
| TShader | getShader () const |
| get the current material shadertype. | |
| bool | getStainedGlassWindow () |
| void | setStainedGlassWindow (bool val) |
| void | flushTextures (IDriver &driver, uint selectedTexture) |
| Flush textures. Force texture generation. | |
| void | serial (NLMISC::IStream &f) |
| bool | isSupportedByDriver (IDriver &drv, bool forceBaseCaps) const |
| test if material a driver supports rendering of that material | |
| uint32 | getFlags () const |
| uint32 | getTouched (void) const |
| void | clearTouched (uint32 flag) |
Object. | |
| CMaterial () | |
| ctor. | |
| CMaterial (const CMaterial &mat) | |
| see operator=. | |
| ~CMaterial () | |
| dtor. | |
| CMaterial & | operator= (const CMaterial &mat) |
| Do not copy DrvInfos, copy all infos and set IDRV_TOUCHED_ALL. | |
Texture. | |
| void | setTexture (uint8 stage, ITexture *ptex) |
| set a texture for a special stage. | |
| ITexture * | getTexture (uint8 stage) const |
| bool | texturePresent (uint8 stage) const |
| uint | getNumUsedTextureStages () const |
Blending. | |
| void | setBlend (bool active) |
| void | setBlendFunc (TBlend src, TBlend dst) |
| void | setSrcBlend (TBlend val) |
| void | setDstBlend (TBlend val) |
| bool | getBlend () const |
| TBlend | getSrcBlend (void) const |
| TBlend | getDstBlend (void) const |
Texture Addressing Mode Method | |
| void | enableTexAddrMode (bool enable=true) |
| enable / disable the use of special texture addressing modes When enabled, all texture addressing modes are set to 'None' | |
| bool | texAddrEnabled () const |
| test whether texture addressing mode are enabled | |
| void | setTexAddressingMode (uint8 stage, TTexAddressingMode mode) |
| Set a texture addressing mode for the given stage. | |
| TTexAddressingMode | getTexAddressingMode (uint8 stage) |
| Get the texture addressing mode for the given stage. | |
Double sided. | |
| void | setDoubleSided (bool active) |
| bool | getDoubleSided () const |
Alpha Test | |
| void | setAlphaTest (bool active) |
| bool | getAlphaTest () const |
| void | setAlphaTestThreshold (float thre) |
| change the threshold against alpha is tested. | |
| float | getAlphaTestThreshold () const |
ZBuffer. | |
| void | setZFunc (ZFunc val) |
| void | setZWrite (bool active) |
| void | setZBias (float val) |
| The z bias is a z dispacement of the object to solve z precision problem. | |
| ZFunc | getZFunc (void) const |
| bool | getZWrite (void) const |
| float | getZBias (void) const |
Color/Lighting.. | |
| void | setColor (CRGBA rgba) |
| The Color is used only if lighting is disabled. Also, color is replaced by per vertex color (if any). | |
| void | setLighting (bool active, CRGBA emissive=CRGBA(0, 0, 0), CRGBA ambient=CRGBA(0, 0, 0), CRGBA diffuse=CRGBA(0, 0, 0), CRGBA specular=CRGBA(0, 0, 0), float shininess=10) |
| Batch setup lighting. Opacity is in diffuse.A. | |
| void | setEmissive (CRGBA emissive=CRGBA(0, 0, 0)) |
| Set the emissive part ot material. Useful only if setLighting(true) has been done. | |
| void | setAmbient (CRGBA ambient=CRGBA(0, 0, 0)) |
| Set the Ambient part ot material. Useful only if setLighting(true) has been done. | |
| void | setDiffuse (CRGBA diffuse=CRGBA(0, 0, 0)) |
| Set the Diffuse part ot material. Useful only if setLighting(true) has been done. NB: opacity is NOT copied from diffuse.A. | |
| void | setOpacity (uint8 opa) |
| Set the Opacity part ot material. Useful only if setLighting(true) has been done. | |
| void | setSpecular (CRGBA specular=CRGBA(0, 0, 0)) |
| Set the specular part ot material. Useful only if setLighting(true) has been done. | |
| void | setShininess (float shininess) |
| Set the shininess part ot material. Useful only if setLighting(true) has been done. | |
| void | setLightedVertexColor (bool useLightedVertexColor) |
| Set the color material flag. Used when the material is lighted. True to use the diffuse color of the material when lighted, false to use the color vertex. | |
| bool | getLightedVertexColor () const |
| Get the lighted vertex color flag. | |
| bool | isLighted () const |
| bool | isLightedVertexColor () const |
| Return true if this material uses color material as diffuse when lighted, else return false if it uses color vertex. | |
| CRGBA | getColor (void) const |
| CRGBA | getEmissive () const |
| CRGBA | getAmbient () const |
| CRGBA | getDiffuse () const |
| return diffuse part. NB: A==opacity. | |
| uint8 | getOpacity () const |
| CRGBA | getSpecular () const |
| float | getShininess () const |
Texture environnement. Normal shader only. | |
| void | texEnvOpRGB (uint stage, TTexOperator ope) |
| This part is valid for Normal shaders (nlassert). | |
| void | texEnvArg0RGB (uint stage, TTexSource src, TTexOperand oper) |
| void | texEnvArg1RGB (uint stage, TTexSource src, TTexOperand oper) |
| void | texEnvArg2RGB (uint stage, TTexSource src, TTexOperand oper) |
| void | texEnvOpAlpha (uint stage, TTexOperator ope) |
| void | texEnvArg0Alpha (uint stage, TTexSource src, TTexOperand oper) |
| void | texEnvArg1Alpha (uint stage, TTexSource src, TTexOperand oper) |
| void | texEnvArg2Alpha (uint stage, TTexSource src, TTexOperand oper) |
| void | texConstantColor (uint stage, CRGBA color) |
| Setup the constant color for a stage. Used for the TTexSource:Constant. | |
| uint32 | getTexEnvMode (uint stage) |
| For push/pop only, get the packed version of the environnment mode. | |
| void | setTexEnvMode (uint stage, uint32 packed) |
| For push/pop only, set the packed version of the environnment mode. | |
| CRGBA | getTexConstantColor (uint stage) |
| TTexOperator | getTexEnvOpRGB (uint stage) const |
| TTexOperator | getTexEnvOpAlpha (uint stage) const |
| void | setTexCoordGen (uint stage, bool generate) |
| bool | getTexCoordGen (uint stage) const |
| void | setTexCoordGenMode (uint stage, TTexCoordGenMode mode) |
| TTexCoordGenMode | getTexCoordGenMode (uint stage) const |
| void | enableUserTexMat (uint stage, bool enabled=true) |
| bool | isUserTexMatEnabled (uint stage) const |
| void | setUserTexMat (uint stage, const NLMISC::CMatrix &m) |
| Set a new texture matrix for the given stage. | |
| const NLMISC::CMatrix & | getUserTexMat (uint stage) const |
| Get a const ref. | |
| void | decompUserTexMat (uint stage, float &uTrans, float &vTrans, float &wRot, float &uScale, float &vScale) |
| Decompose a user texture matrix, We assume that this is only a matrix for 2d texture. | |
Texture UserColor. UserColor shader only. | |
| void | setUserColor (CRGBA userColor) |
| This part is valid for Normal shaders (nlassert). | |
| CRGBA | getUserColor () const |
LightMap. LightMap shader only. | |
| void | setLightMap (uint lmapId, ITexture *lmap) |
| This part is valid for LightMap shaders (nlassert). | |
| ITexture * | getLightMap (uint lmapId) const |
| Get the ith lightmap. (NULL if none). | |
| void | setLightMapFactor (uint lmapId, CRGBA factor) |
| Set the lightmap intensity. (def : White). | |
| void | setLightMapMulx2 (bool val) |
| Set the multiply x 2 mode to burn colors (used with lightmaps 8 bits) (def: false). | |
| void | setLMCColors (uint lmapId, CRGBA ambColor, CRGBA diffColor) |
| Used for LightMap Compression (LMC). Set the LMC color terms. default to black/white (no compression). | |
Tools.. | |
| void | initUnlit () |
| Init the material as unlit. | |
| void | initLighted () |
| Init the material as default white lighted material. | |
| void | selectTextureSet (uint index) |
| Select one texture set for all the textures of this material. | |
Public Attributes | |
| CSmartPtr< ITexture > | _Textures [IDRV_MAT_MAXTEXTURES] |
| uint8 | _TexAddrMode [IDRV_MAT_MAXTEXTURES] |
| CTexEnv | _TexEnvs [IDRV_MAT_MAXTEXTURES] |
| CRefPtr< IMaterialDrvInfos > | _MatDrvInfo |
| TTexturePtrs | _LightMaps |
| bool | _LightMapsMulx2 |
Private Attributes | |
| TShader | _ShaderType |
| uint32 | _Flags |
| TBlend | _SrcBlend |
| TBlend | _DstBlend |
| ZFunc | _ZFunction |
| float | _ZBias |
| CRGBA | _Color |
| CRGBA | _Emissive |
| CRGBA | _Ambient |
| CRGBA | _Diffuse |
| CRGBA | _Specular |
| float | _Shininess |
| float | _AlphaTestThreshold |
| uint32 | _Touched |
| bool | _StainedGlassWindow |
| uint16 | _TexCoordGenMode |
| std::auto_ptr< CUserTexMat > | _TexUserMat |
A material represent ALL the states relatives to the aspect of a primitive.
Definition at line 141 of file material.h.
| typedef std::vector<CLightMap> NL3D::CMaterial::TTexturePtrs |
Definition at line 728 of file material.h.
Blend enums.
see setSrcBlend()/setDstBlend()/setBlendFunc(). blendConstant* enums are only valid if driver->supportBlendConstantColor().
| one | |
| zero | |
| srcalpha | |
| invsrcalpha | |
| srccolor | |
| invsrccolor | |
| blendConstantColor | |
| blendConstantInvColor | |
| blendConstantAlpha | |
| blendConstantInvAlpha | |
| blendCount |
Definition at line 151 of file material.h.
Normal shader:
see texEnv*() methods. Bump:
Texture of stage 0 is added to the multiplication of Texture Alpha of stage 0 and Texture of stage 1
Alpha of texture in stage 0 is blended with alpha of texture in stage 1. Blend done with the alpha color of each stage and the whole is multiplied by the alpha in color vertex [AT0*ADiffuseCol+AT1*(1-ADiffuseCol)]*AStage
| Normal | |
| Bump | |
| UserColor | |
| LightMap | |
| Specular | |
| Caustics | |
| PerPixelLighting | |
| PerPixelLightingNoSpec | |
| Cloud | |
| Water | |
| shaderCount |
Definition at line 183 of file material.h.
Definition at line 236 of file material.h.
TexGen Mode.
TexCoordGenReflect: For Cube or Spherical EnvMapping. TexCoordGenObjectSpace: The UVW are generated from the XYZ defined in ObjectSpace (before transformation) TexCoordGenEyeSpace: The UVW are generated from the XYZ defined in EyeSpace (after ModelViewMatrix transformation) NB: use the TextureMatrix for more control on the wanted effect (eg: shadowMap projection etc...)
Definition at line 254 of file material.h.
Operand for the argument.
For Alpha arguments, only SrcAlpha and InvSrcAlpha are Valid!!
SrcColor: arg= ColorSource. InvSrcColor: arg= 1-ColorSource. SrcAlpha: arg= AlphaSource. InvSrcAlpha: arg= 1-AlphaSource.
Definition at line 227 of file material.h.
Environements operators: Replace: out= arg0 Modulate: out= arg0 * arg1 Add: out= arg0 + arg1 AddSigned: out= arg0 + arg1 -0.5 Interpolate*: out= arg0*As + arg1*(1-As), where As is taken from the SrcAlpha of Texture/Previous/Diffuse/Constant, respectively if operator is InterpolateTexture/InterpolatePrevious/InterpolateDiffuse/InterpolateConstant.
Multiply-Add (Mad) out= arg0 * arg1 + arg2. Must be supported by driver (see IDriver::supportMADOperator) EMBM : apply to both color and alpha : the current texture, whose format is DSDT, is used to offset the texture in the next stage, unless the EMBM unit is at the last stage, in which case it operates on texture at first stage NB : for EMBM, this must be supported by driver.
| Replace | |
| Modulate | |
| Add | |
| AddSigned | |
| InterpolateTexture | |
| InterpolatePrevious | |
| InterpolateDiffuse | |
| InterpolateConstant | |
| EMBM | |
| Mad | |
| TexOperatorCount |
Definition at line 209 of file material.h.
Source argument.
Texture: the arg is taken from the current texture of the stage. Previous: the arg is taken from the previous enabled stage. If stage 0, Previous==Diffuse. Diffuse: the arg is taken from the primary color vertex. Constant: the arg is taken from the constant color setuped for this texture stage.
Definition at line 218 of file material.h.
Definition at line 145 of file material.h.
| NL3D::CMaterial::CMaterial | ( | ) |
ctor.
By default, shader is normal, SrcBlend is srcalpha, dstblend is invsrcalpha, ZFunction is lessequal, ZBias is 0, Color is White: (255,255,255,255), not double sided.
Definition at line 39 of file material.cpp.
References _AlphaTestThreshold, _Color, _DstBlend, _Flags, _LightMapsMulx2, _ShaderType, _SrcBlend, _StainedGlassWindow, _TexCoordGenMode, _Touched, _ZBias, _ZFunction, NL3D::IDRV_MAT_ZWRITE, invsrcalpha, lessequal, Normal, NLMISC::CRGBA::set(), and srcalpha.
| NL3D::CMaterial::CMaterial | ( | const CMaterial & | mat | ) | [inline] |
see operator=.
Definition at line 270 of file material.h.
References _Flags, _Touched, and operator=().
| NL3D::CMaterial::~CMaterial | ( | ) |
dtor.
Definition at line 135 of file material.cpp.
References _MatDrvInfo, and NLMISC::CRefPtr< T >::kill().
| void NL3D::CMaterial::clearTouched | ( | uint32 | flag | ) | [inline] |
Definition at line 735 of file material.h.
References _Touched.
Referenced by NL3D::CDriverGL::setupMaterial(), and NL3D::CDriverD3D::setupMaterial().
| void NL3D::CMaterial::decompUserTexMat | ( | uint | stage, | |
| float & | uTrans, | |||
| float & | vTrans, | |||
| float & | wRot, | |||
| float & | uScale, | |||
| float & | vScale | |||
| ) |
Decompose a user texture matrix, We assume that this is only a matrix for 2d texture.
find the rotation around w
Definition at line 521 of file material.cpp.
References _TexUserMat, NLMISC::CMatrix::getI(), NLMISC::CMatrix::getJ(), NLMISC::CMatrix::getK(), NLMISC::CMatrix::getPos(), NLMISC::CVector::I, NL3D::IDRV_MAT_MAXTEXTURES, NLMISC::CMatrix::invert(), isUserTexMatEnabled(), NLMISC::CVector::J, NLMISC::CVector::K, nlassert, NLMISC::CVector::norm(), NLMISC::CVector::normalize(), NLMISC::Pi, NLMISC::CMatrix::setPos(), NLMISC::CMatrix::setRot(), NLMISC::CVector::x, and NLMISC::CVector::y.
Referenced by NL3D::CMaterialBase::copyFromMaterial().
| void NL3D::CMaterial::enableTexAddrMode | ( | bool | enable = true |
) |
enable / disable the use of special texture addressing modes When enabled, all texture addressing modes are set to 'None'
Definition at line 477 of file material.cpp.
References _Flags, _TexAddrMode, NL3D::IDRV_MAT_MAXTEXTURES, NL3D::IDRV_MAT_TEX_ADDR, and TextureOff.
Referenced by NL3D::CPSMultiTexturedParticle::setupMultiTexEnv().
Definition at line 378 of file driver_material_inline.h.
References _Flags, _TexUserMat, NL3D::IDRV_MAT_MAXTEXTURES, NL3D::IDRV_MAT_USER_TEX_0_MAT, NL3D::IDRV_MAT_USER_TEX_MAT_ALL, and nlassert.
Referenced by NL3D::CShadowMapManager::CShadowMapManager(), NL3D::UInstanceMaterial::enableUserTexMat(), NL3D::CSegRemanenceShape::setupMaterial(), NL3D::CPSConstraintMesh::setupRenderPasses(), NL3D::CWaterModel::setupSimpleRender(), NL3D::CPSRibbon::setupTextureMatrix(), and NL3D::CPSShockWave::setupUFactor().
Flush textures. Force texture generation.
Definition at line 370 of file material.cpp.
References _LightMaps, _ShaderType, _Textures, NL3D::IDRV_MAT_MAXTEXTURES, LightMap, and NL3D::IDriver::setupTexture().
Referenced by NL3D::CSegRemanenceShape::flushTextures().
| bool NL3D::CMaterial::getAlphaTest | ( | ) | const [inline] |
Definition at line 344 of file material.h.
References _Flags, and NL3D::IDRV_MAT_ALPHA_TEST.
Referenced by NL3D::CZoneLighter::getTexture(), NL3D::CDriverD3D::needsConstantForDiffuse(), NL3D::CDriverD3D::needsConstants(), NL3D::CMeshBlender::prepareRenderForGlobalAlpha(), and NL3D::CMeshBlender::restoreRender().
| float NL3D::CMaterial::getAlphaTestThreshold | ( | ) | const [inline] |
Definition at line 350 of file material.h.
References _AlphaTestThreshold.
Referenced by NL3D::UInstanceMaterial::getAlphaTestThreshold(), NL3D::CZoneLighter::getTexture(), NL3D::CMeshBlender::prepareRenderForGlobalAlpha(), NL3D::CDriverGL::setupMaterial(), and NL3D::CDriverD3D::setupMaterial().
| CRGBA NL3D::CMaterial::getAmbient | ( | ) | const [inline] |
Definition at line 408 of file material.h.
References _Ambient.
Referenced by NL3D::CRenderTrav::changeVPLightSetupMaterial(), NL3D::CMaterialBase::copyFromMaterial(), NL3D::UInstanceMaterial::getAmbient(), NL3D::CMeshGeom::render(), NL3D::CDriverGL::setupMaterial(), and NL3D::CDriverD3D::setupMaterial().
| bool NL3D::CMaterial::getBlend | ( | ) | const [inline] |
Definition at line 308 of file material.h.
References _Flags, and NL3D::IDRV_MAT_BLEND.
Referenced by NL3D::CShapeInfo::build(), NL3D::UInstanceMaterial::getBlend(), NL3D::CPSMaterial::getBlendingMode(), NL3D::CZoneLighter::getTexture(), NL3D::CDriverD3D::needsConstantForDiffuse(), NL3D::CDriverD3D::needsConstants(), NL3D::CMeshBlender::prepareRenderForGlobalAlpha(), NL3D::CSegRemanenceShape::render(), NL3D::CDriverGL::setupLightMapPass(), NL3D::CDriverD3D::setupMaterial(), and NL3D::CSegRemanence::updateOpacityFromShape().
| CRGBA NL3D::CMaterial::getColor | ( | void | ) | const [inline] |
Definition at line 406 of file material.h.
References _Color.
Referenced by NL3D::UInstanceMaterial::getColor(), NL3D::CMeshBlender::prepareRenderForGlobalAlphaCoarseMesh(), NL3D::CVisualCollisionManager::receiveShadowMap(), NL3D::CDriverGL::setupMaterial(), and NL3D::CDriverD3D::setupMaterial().
| CRGBA NL3D::CMaterial::getDiffuse | ( | ) | const [inline] |
return diffuse part. NB: A==opacity.
Definition at line 410 of file material.h.
References _Diffuse.
Referenced by NL3D::CRenderTrav::changeVPLightSetupMaterial(), NL3D::CMaterialBase::copyFromMaterial(), NL3D::UInstanceMaterial::getDiffuse(), NL3D::CMeshGeom::render(), NL3D::CDriverGL::setupMaterial(), and NL3D::CDriverD3D::setupMaterial().
| bool NL3D::CMaterial::getDoubleSided | ( | ) | const [inline] |
Definition at line 338 of file material.h.
References _Flags, and NL3D::IDRV_MAT_DOUBLE_SIDED.
Referenced by NL3D::CZoneLighter::getTexture().
| TBlend NL3D::CMaterial::getDstBlend | ( | void | ) | const [inline] |
Definition at line 310 of file material.h.
References _DstBlend.
Referenced by NL3D::CPSMaterial::getBlendingMode(), NL3D::UMaterial::getDstBlend(), NL3D::UInstanceMaterial::getDstBlend(), NL3D::CDriverD3D::needsConstantForDiffuse(), NL3D::CDriverD3D::needsConstants(), NL3D::CMeshBlender::prepareRenderForGlobalAlpha(), NL3D::CMeshBlender::prepareRenderForGlobalAlphaCoarseMesh(), NL3D::CDriverGL::setupMaterial(), and NL3D::CDriverD3D::setupMaterial().
| CRGBA NL3D::CMaterial::getEmissive | ( | ) | const [inline] |
Definition at line 407 of file material.h.
References _Emissive.
Referenced by NL3D::CRenderTrav::changeVPLightSetupMaterial(), NL3D::CMaterialBase::copyFromMaterial(), NL3D::UInstanceMaterial::getEmissive(), NL3D::CMeshGeom::render(), NL3D::CDriverGL::setupMaterial(), and NL3D::CDriverD3D::setupMaterial().
| uint32 NL3D::CMaterial::getFlags | ( | ) | const [inline] |
Definition at line 733 of file material.h.
References _Flags.
Referenced by NL3D::CDriverGL::setupMaterial(), NL3D::CDriverD3D::setupMaterial(), and NL3D::CDriverGL::setupUserTextureMatrix().
| bool NL3D::CMaterial::getLightedVertexColor | ( | ) | const [inline] |
Get the lighted vertex color flag.
Definition at line 199 of file driver_material_inline.h.
References _Flags, and NL3D::IDRV_MAT_LIGHTED_VERTEX_COLOR.
Referenced by NL3D::CDriverD3D::setupMaterial(), and NL3D::CPSConstraintMesh::setupRenderPasses().
Get the ith lightmap. (NULL if none).
Definition at line 416 of file material.cpp.
References _LightMaps, _ShaderType, LightMap, and nlassert.
Referenced by NL3D::CShapeBank::processWaitingShapes(), and NL3D::CAsyncFileManager3D::CMeshLoad::run().
| uint NL3D::CMaterial::getNumUsedTextureStages | ( | ) | const |
Definition at line 573 of file material.cpp.
References _Textures, and NL3D::IDRV_MAT_MAXTEXTURES.
Referenced by isSupportedByDriver().
| uint8 NL3D::CMaterial::getOpacity | ( | ) | const [inline] |
Definition at line 411 of file material.h.
References _Diffuse, and NLMISC::CRGBA::A.
Referenced by NL3D::UInstanceMaterial::getOpacity(), and NL3D::CMeshBlender::prepareRenderForGlobalAlpha().
| TShader NL3D::CMaterial::getShader | ( | ) | const [inline] |
get the current material shadertype.
Definition at line 282 of file material.h.
References _ShaderType.
Referenced by NL3D::CDriverGL::beginCloudMultiPass(), NL3D::CDriverGL::beginWaterMultiPass(), NL3D::CDriverGL::endCloudMultiPass(), NL3D::CDriverGL::endWaterMultiPass(), isSupportedByDriver(), NL3D::UInstanceMaterial::isUserColor(), NL3D::CShapeBank::processWaitingShapes(), NL3D::CMeshMRMSkinnedGeom::renderSkinGroupPrimitives(), NL3D::CMeshMRMGeom::renderSkinGroupPrimitives(), NL3D::CAsyncFileManager3D::CMeshLoad::run(), NL3D::CDriverGL::setupCloudPass(), NL3D::CMeshVPPerPixelLight::setupForMaterial(), NL3D::CDriverGL::setupMaterial(), NL3D::CDriverD3D::setupMaterial(), NL3D::CPSConstraintMesh::setupMaterialColor(), and NL3D::CDriverGL::setupWaterPass().
| float NL3D::CMaterial::getShininess | ( | ) | const [inline] |
Definition at line 413 of file material.h.
References _Shininess.
Referenced by NL3D::CRenderTrav::changeVPLightSetupMaterial(), NL3D::CMaterialBase::copyFromMaterial(), NL3D::UInstanceMaterial::getShininess(), NL3D::CMeshVPPerPixelLight::setupForMaterial(), NL3D::CDriverGL::setupMaterial(), NL3D::CDriverD3D::setupMaterial(), and NL3D::CDriverGL::setupPPLPass().
| CRGBA NL3D::CMaterial::getSpecular | ( | ) | const [inline] |
Definition at line 412 of file material.h.
References _Specular.
Referenced by NL3D::CRenderTrav::changeVPLightSetupMaterial(), NL3D::CMaterialBase::copyFromMaterial(), NL3D::UInstanceMaterial::getSpecular(), NL3D::CMeshGeom::render(), NL3D::CDriverGL::setupMaterial(), and NL3D::CDriverD3D::setupMaterial().
| TBlend NL3D::CMaterial::getSrcBlend | ( | void | ) | const [inline] |
Definition at line 309 of file material.h.
References _SrcBlend.
Referenced by NL3D::CPSMaterial::getBlendingMode(), NL3D::UMaterial::getSrcBlend(), NL3D::UInstanceMaterial::getSrcBlend(), NL3D::CDriverD3D::needsConstantForDiffuse(), NL3D::CDriverD3D::needsConstants(), NL3D::CMeshBlender::prepareRenderForGlobalAlpha(), NL3D::CMeshBlender::prepareRenderForGlobalAlphaCoarseMesh(), NL3D::CDriverGL::setupMaterial(), and NL3D::CDriverD3D::setupMaterial().
| bool NL3D::CMaterial::getStainedGlassWindow | ( | ) | [inline] |
Definition at line 516 of file material.h.
References _StainedGlassWindow.
| CMaterial::TTexAddressingMode NL3D::CMaterial::getTexAddressingMode | ( | uint8 | stage | ) |
Get the texture addressing mode for the given stage.
Definition at line 513 of file material.cpp.
References _Flags, _TexAddrMode, NL3D::IDRV_MAT_MAXTEXTURES, NL3D::IDRV_MAT_TEX_ADDR, and nlassert.
Definition at line 330 of file driver_material_inline.h.
References _ShaderType, _TexEnvs, NL3D::CMaterial::CTexEnv::ConstantColor, NL3D::IDRV_MAT_MAXTEXTURES, nlassert, and Normal.
Referenced by NL3D::UInstanceMaterial::getConstantColor(), and NL3D::CDriverD3D::setupMaterial().
Definition at line 337 of file driver_material_inline.h.
References _Flags, NL3D::IDRV_MAT_GEN_TEX_0, NL3D::IDRV_MAT_MAXTEXTURES, and nlassert.
Referenced by NL3D::CDriverGL::setTextureEnvFunction(), and NL3D::CDriverD3D::setupMaterial().
| TTexCoordGenMode NL3D::CMaterial::getTexCoordGenMode | ( | uint | stage | ) | const [inline] |
Definition at line 457 of file material.h.
References _TexCoordGenMode, NL3D::IDRV_MAT_TEX_GEN_MASK, and NL3D::IDRV_MAT_TEX_GEN_SHIFT.
Referenced by NL3D::CDriverGL::setTextureEnvFunction(), and NL3D::CDriverD3D::setupMaterial().
For push/pop only, get the packed version of the environnment mode.
Definition at line 315 of file driver_material_inline.h.
References _ShaderType, _TexEnvs, NL3D::CMaterial::CTexEnv::EnvPacked, NL3D::IDRV_MAT_MAXTEXTURES, nlassert, and Normal.
Referenced by NL3D::CDriverD3D::computeRelevantTexEnv(), NL3D::CDriverD3D::needsConstantForDiffuse(), NL3D::CDriverD3D::needsConstants(), NL3D::CLandscape::render(), NL3D::CDriverD3D::setupMaterial(), and NL3D::CPSConstraintMesh::setupMaterialColor().
| CMaterial::TTexOperator NL3D::CMaterial::getTexEnvOpAlpha | ( | uint | stage | ) | const [inline] |
Definition at line 265 of file driver_material_inline.h.
References _ShaderType, _TexEnvs, NL3D::CMaterial::CTexEnv::Env, NL3D::IDRV_MAT_MAXTEXTURES, nlassert, and Normal.
Referenced by isSupportedByDriver().
| CMaterial::TTexOperator NL3D::CMaterial::getTexEnvOpRGB | ( | uint | stage | ) | const [inline] |
Definition at line 221 of file driver_material_inline.h.
References _ShaderType, _TexEnvs, NL3D::CMaterial::CTexEnv::Env, NL3D::IDRV_MAT_MAXTEXTURES, nlassert, and Normal.
Referenced by NL3D::CDriverD3D::computeRelevantTexEnv(), and isSupportedByDriver().
Definition at line 44 of file driver_material_inline.h.
References _Textures, NL3D::IDRV_MAT_MAXTEXTURES, and nlassert.
Referenced by NL3D::CDriverGL::beginSpecularMultiPass(), NL3D::CCoarseMeshBuild::buildBitmap(), NL3D::CDriverD3D::computeRelevantTexEnv(), NL3D::CFontManager::computeString(), NL3D::CFontManager::computeStringInfo(), NL3D::CPSMaterial::forceModulateConstantColor(), NL3D::CPSMaterial::forceTexturedMaterialStages(), NL3D::UInstanceMaterial::getLastTextureStage(), NL3D::CZoneLighter::getTexture(), NL3D::UInstanceMaterial::getTextureFileName(), NL3D::UInstanceMaterial::getWrapS(), NL3D::UInstanceMaterial::getWrapT(), isSupportedByDriver(), NL3D::UInstanceMaterial::isTextureFile(), NL3D::CDriverD3D::needsConstantForDiffuse(), NL3D::CDriverD3D::needsConstants(), NL3D::CShapeBank::processWaitingShapes(), NL3D::CCoarseMeshBuild::remapCoordinates(), NL3D::CSegRemanence::render(), NL3D::CMeshMRMSkinnedGeom::renderSkinGroupPrimitives(), NL3D::CMeshMRMGeom::renderSkinGroupPrimitives(), NL3D::CAsyncFileManager3D::CMeshLoad::run(), NL3D::CMeshBaseInstance::selectTextureSet(), NL3D::CDriverGL::setTextureEnvFunction(), NL3D::UInstanceMaterial::setTextureFileName(), NL3D::CDriverGL::setupLightMapPass(), NL3D::CSegRemanenceShape::setupMaterial(), NL3D::CDriverGL::setupMaterial(), NL3D::CDriverD3D::setupMaterial(), NL3D::CDriverGL::setupPPLNoSpecPass(), NL3D::CDriverGL::setupPPLPass(), NL3D::CPSConstraintMesh::setupRenderPasses(), NL3D::CDriverGL::setupSpecularPass(), NL3D::CDriverGL::setupWaterPassARB(), NL3D::CDriverGL::setupWaterPassNV20(), NL3D::CDriverGL::setupWaterPassR200(), NL3D::UInstanceMaterial::setWrapS(), and NL3D::UInstanceMaterial::setWrapT().
| uint32 NL3D::CMaterial::getTouched | ( | void | ) | const [inline] |
Definition at line 734 of file material.h.
References _Touched.
Referenced by NL3D::CDriverGL::setupMaterial(), and NL3D::CDriverD3D::setupMaterial().
| CRGBA NL3D::CMaterial::getUserColor | ( | ) | const [inline] |
Definition at line 370 of file driver_material_inline.h.
References _ShaderType, _TexEnvs, NL3D::CMaterial::CTexEnv::ConstantColor, nlassert, and UserColor.
Referenced by NL3D::UInstanceMaterial::getUserColor().
| const NLMISC::CMatrix & NL3D::CMaterial::getUserTexMat | ( | uint | stage | ) | const [inline] |
Get a const ref.
on the texture matrix of the n-th stage. User texture matrix must be enabled for that stage, otherwise an assertion is raised.
Definition at line 418 of file driver_material_inline.h.
References _TexUserMat, isUserTexMatEnabled(), and nlassert.
Referenced by NL3D::UInstanceMaterial::getUserTexMat(), NL3D::CDriverD3D::setupMaterial(), and NL3D::CDriverGL::setupUserTextureMatrix().
| float NL3D::CMaterial::getZBias | ( | void | ) | const [inline] |
Definition at line 366 of file material.h.
References _ZBias.
Referenced by NL3D::CPSMaterial::getZBias(), NL3D::CLandscape::receiveShadowMap(), NL3D::CDriverGL::setupMaterial(), and NL3D::CDriverD3D::setupMaterial().
| ZFunc NL3D::CMaterial::getZFunc | ( | void | ) | const [inline] |
Definition at line 364 of file material.h.
References _ZFunction.
Referenced by NL3D::UMaterial::getZFunc(), NL3D::CPSMaterial::isZTestEnabled(), NL3D::CDriverGL::setupMaterial(), and NL3D::CDriverD3D::setupMaterial().
| bool NL3D::CMaterial::getZWrite | ( | void | ) | const [inline] |
Definition at line 365 of file material.h.
References _Flags, and NL3D::IDRV_MAT_ZWRITE.
Referenced by NL3D::CheckForOpaqueAndTransparentFacesInMesh(), NL3D::CPSConstraintMesh::doRenderPasses(), NL3D::CMeshBlender::prepareRenderForGlobalAlpha(), and NL3D::CPSConstraintMesh::setupRenderPasses().
| void NL3D::CMaterial::initLighted | ( | ) |
Init the material as default white lighted material.
normal shader, lighting .... Default to: normal shader, full black lighting, no texture, ZBias=0, ZFunc= lessequal, ZWrite==true, no blend. All other states are undefined (such as blend function, since blend is disabled).
Definition at line 77 of file material.cpp.
References initUnlit(), and setLighting().
| void NL3D::CMaterial::initUnlit | ( | ) |
Init the material as unlit.
normal shader, no lighting .... Default to: normal shader, no lighting, color to White(1,1,1,1), no texture, ZBias=0, ZFunc= lessequal, ZWrite==true, no blend. All other states are undefined (such as blend function, since blend is disabled).
Definition at line 61 of file material.cpp.
References NL3D::IDRV_MAT_MAXTEXTURES, lessequal, Normal, setAlphaTestThreshold(), setBlend(), setColor(), setLighting(), setShader(), setTexture(), setZBias(), setZFunc(), and setZWrite().
Referenced by NL3D::CCloudScape::CCloudScape(), NL3D::CLodCharacterManager::CLodCharacterManager(), NL3D::CShadowMapManager::CShadowMapManager(), NL3D::CVegetableManager::CVegetableManager(), NL3D::CCloud::disp(), NL3D::CInstanceGroup::displayDebugClusters(), NL3D::CVisualCollisionEntity::displayDebugGrid(), NL3D::CDRU::drawBitmap(), NL3D::CDRU::drawLine(), NL3D::CDRU::drawQuad(), NL3D::CDRU::drawTriangle(), NL3D::CNoise3d::init(), NL3D::CLandscape::init(), initLighted(), NL3D::CFlareModel::initStatics(), CEGUI::NeLTexture::loadFromMemory(), NL3D::CSegRemanence::render(), NL3D::CScene::renderOcclusionTestMeshs(), NL3D::SCloudTexture3D::SCloudTexture3D(), NL3D::SCloudTextureClamp::SCloudTextureClamp(), and NL3D::CWaterModel::traverseRender().
| bool NL3D::CMaterial::isLighted | ( | ) | const [inline] |
Definition at line 401 of file material.h.
References _Flags, and NL3D::IDRV_MAT_LIGHTING.
Referenced by NL3D::CheckForLightableFacesInMesh(), NL3D::UInstanceMaterial::isLighted(), NL3D::CDriverD3D::needsConstantForDiffuse(), NL3D::CDriverD3D::setupMaterial(), and NL3D::CPSConstraintMesh::setupMaterialColor().
| bool NL3D::CMaterial::isLightedVertexColor | ( | ) | const [inline] |
Return true if this material uses color material as diffuse when lighted, else return false if it uses color vertex.
Definition at line 404 of file material.h.
References _Flags, and NL3D::IDRV_MAT_LIGHTED_VERTEX_COLOR.
Referenced by NL3D::CDriverGL::setupMaterial(), and NL3D::CDriverD3D::setupMaterial().
test if material a driver supports rendering of that material
| forceBaseCaps | When true, the driver is considered to have the most basic required caps (2 stages hardwares, no pixelShader, support for constant color blend & multiply-add texture operator), so that any fancy material will fail the test. |
Definition at line 583 of file material.cpp.
References Bump, Caustics, Cloud, EMBM, NL3D::IDriver::getNbTextureStages(), getNumUsedTextureStages(), getShader(), getTexEnvOpAlpha(), getTexEnvOpRGB(), getTexture(), NL3D::IDRV_MAT_MAXTEXTURES, InterpolateConstant, NL3D::IDriver::isEMBMSupportedAtStage(), LightMap, Mad, min, nlassert, Normal, PerPixelLighting, PerPixelLightingNoSpec, Specular, NL3D::IDriver::supportBlendConstantColor(), NL3D::IDriver::supportEMBM(), NL3D::IDriver::supportMADOperator(), NL3D::IDriver::supportPerPixelLighting(), UserColor, and Water.
Referenced by NL3D::UInstance::supportMaterialRendering().
Definition at line 403 of file driver_material_inline.h.
References _Flags, NL3D::IDRV_MAT_MAXTEXTURES, NL3D::IDRV_MAT_USER_TEX_0_MAT, and nlassert.
Referenced by NL3D::CMaterialBase::copyFromMaterial(), decompUserTexMat(), NL3D::UInstanceMaterial::getUserTexMat(), getUserTexMat(), NL3D::UInstanceMaterial::isUserTexMatEnabled(), serial(), NL3D::CDriverD3D::setupMaterial(), NL3D::UInstanceMaterial::setUserTexMat(), and setUserTexMat().
Do not copy DrvInfos, copy all infos and set IDRV_TOUCHED_ALL.
Reimplemented from NLMISC::CRefCount.
Definition at line 85 of file material.cpp.
References _AlphaTestThreshold, _Ambient, _Color, _Diffuse, _DstBlend, _Emissive, _Flags, _LightMaps, _LightMapsMulx2, _ShaderType, _Shininess, _Specular, _SrcBlend, _TexAddrMode, _TexCoordGenMode, _TexEnvs, _Textures, _TexUserMat, _Touched, _ZBias, _ZFunction, NL3D::IDRV_MAT_MAXTEXTURES, and NL3D::IDRV_TOUCHED_ALL.
Referenced by CMaterial().
| void NL3D::CMaterial::selectTextureSet | ( | uint | index | ) |
Select one texture set for all the textures of this material.
This is useful only if textures of this material support selection of course (such as CTextureMultiFile)
Definition at line 556 of file material.cpp.
References _Textures, and NL3D::IDRV_MAT_MAXTEXTURES.
| void NL3D::CMaterial::serial | ( | NLMISC::IStream & | f | ) |
Definition at line 148 of file material.cpp.
References _AlphaTestThreshold, _Ambient, _Color, _Diffuse, _DstBlend, _Emissive, _Flags, _LightMaps, _LightMapsMulx2, _ShaderType, _Shininess, _Specular, _SrcBlend, _TexAddrMode, _TexCoordGenMode, _TexEnvs, _Textures, _TexUserMat, _Touched, _ZBias, _ZFunction, NLMISC::CRGBA::Black, NL3D::IDRV_MAT_DEFMAT, NL3D::IDRV_MAT_MAXTEXTURES, NL3D::IDRV_MAT_TEX_ADDR, NL3D::IDRV_MAT_USER_TEX_MAT_ALL, NL3D::IDRV_TOUCHED_ALL, NLMISC::IStream::isReading(), isUserTexMatEnabled(), NLMISC::n, nlassert, NL3D::CMaterial::CTexEnv::serial(), NLMISC::IStream::serial(), NLMISC::IStream::serialCont(), NLMISC::IStream::serialEnum(), NLMISC::CSmartPtr< T >::serialPolyPtr(), NLMISC::IStream::serialVersion(), setAmbient(), setDiffuse(), setEmissive(), setSpecular(), and NLMISC::CRGBA::White.
| void NL3D::CMaterial::setAlphaTest | ( | bool | active | ) | [inline] |
Definition at line 76 of file driver_material_inline.h.
References _Flags, _Touched, NL3D::IDRV_MAT_ALPHA_TEST, and NL3D::IDRV_TOUCHED_ALPHA_TEST.
Referenced by NL3D::CCloudScape::CCloudScape(), NL3D::CLodCharacterManager::CLodCharacterManager(), NL3D::CShadowMapManager::CShadowMapManager(), NL3D::CVegetableManager::CVegetableManager(), NL3D::UInstanceMaterial::setAlphaTest(), and NL3D::CPSMaterial::setBlendingMode().
| void NL3D::CMaterial::setAlphaTestThreshold | ( | float | thre | ) | [inline] |
change the threshold against alpha is tested.
Default is 0.5f.
| thre | threshold, should be in [0..1], not clamped. |
Definition at line 83 of file driver_material_inline.h.
References _AlphaTestThreshold, _Touched, and NL3D::IDRV_TOUCHED_ALPHA_TEST_THRE.
Referenced by NL3D::CCloudScape::CCloudScape(), NL3D::CShadowMapManager::CShadowMapManager(), initUnlit(), NL3D::CMeshBlender::prepareRenderForGlobalAlpha(), NL3D::CMeshBlender::prepareRenderForGlobalAlphaCoarseMesh(), NL3D::CVegetableManager::render(), NL3D::CMeshBlender::restoreRender(), NL3D::CMeshBlender::restoreRenderCoarseMesh(), and NL3D::UInstanceMaterial::setAlphaTestThreshold().
Set the Ambient part ot material. Useful only if setLighting(true) has been done.
Definition at line 156 of file driver_material_inline.h.
References _Ambient, _Touched, and NL3D::IDRV_TOUCHED_LIGHTING.
Referenced by serial(), and NL3D::UInstanceMaterial::setAmbient().
| void NL3D::CMaterial::setBlend | ( | bool | active | ) | [inline] |
Definition at line 62 of file driver_material_inline.h.
References _Flags, _Touched, NL3D::IDRV_MAT_BLEND, and NL3D::IDRV_TOUCHED_BLEND.
Referenced by NL3D::CCloudScape::CCloudScape(), NL3D::CPSMaterial::CPSMaterial(), NL3D::CShadowMapManager::CShadowMapManager(), NL3D::CCloud::disp(), NL3D::CCloud::dispBill(), NL3D::CPSUtil::displayArrow(), NL3D::CPSUtil::displayBBox(), NL3D::CInstanceGroup::displayDebugClusters(), NL3D::CPSLocatedBindable::displayIcon2d(), NL3D::CDRU::drawBitmap(), NL3D::CDRU::drawLine(), NL3D::CDRU::drawQuad(), NL3D::CDRU::drawTriangle(), NL3D::CNoise3d::init(), NL3D::CBloomEffect::init(), initUnlit(), NL3D::CMotionBlur::performMotionBlur(), NL3D::CMeshBlender::prepareRenderForGlobalAlpha(), NL3D::CMeshBlender::prepareRenderForGlobalAlphaCoarseMesh(), NL3D::CVegetableManager::render(), NL3D::CLandscape::render(), NL3D::CScene::renderOcclusionTestMeshs(), NL3D::CMeshBlender::restoreRender(), NL3D::CMeshBlender::restoreRenderCoarseMesh(), NL3D::SCloudTexture3D::SCloudTexture3D(), NL3D::SCloudTextureClamp::SCloudTextureClamp(), NL3D::UInstanceMaterial::setBlend(), NL3D::CPSMaterial::setBlendingMode(), NL3D::CWaterModel::setupMaterialNVertexShader(), NL3D::CWaterModel::setupSimpleRender(), NL3D::CPSGravity::show(), NL3D::CPSEmitter::showTool(), NL3D::CWaterModel::traverseRender(), and NL3D::CFlareModel::traverseRender().
Definition at line 89 of file driver_material_inline.h.
References _DstBlend, _SrcBlend, _Touched, and NL3D::IDRV_TOUCHED_BLENDFUNC.
Referenced by NL3D::CCloudScape::CCloudScape(), NL3D::CPSMaterial::CPSMaterial(), NL3D::CShadowMapManager::CShadowMapManager(), NL3D::CVegetableManager::CVegetableManager(), NL3D::CPSUtil::displayArrow(), NL3D::CPSUtil::displayBBox(), NL3D::CInstanceGroup::displayDebugClusters(), NL3D::CPSLocatedBindable::displayIcon2d(), NL3D::CNoise3d::init(), NL3D::CBloomEffect::init(), NL3D::CMotionBlur::performMotionBlur(), NL3D::CLandscape::render(), NL3D::SCloudTexture3D::SCloudTexture3D(), NL3D::SCloudTextureClamp::SCloudTextureClamp(), NL3D::UInstanceMaterial::setBlendFunc(), NL3D::CPSMaterial::setBlendingMode(), NL3D::CPSGravity::show(), NL3D::CPSEmitter::showTool(), and NL3D::CFlareModel::traverseRender().
| void NL3D::CMaterial::setColor | ( | NLMISC::CRGBA | rgba | ) | [inline] |
The Color is used only if lighting is disabled. Also, color is replaced by per vertex color (if any).
Definition at line 116 of file driver_material_inline.h.
References _Color, _Touched, and NL3D::IDRV_TOUCHED_COLOR.
Referenced by NL3D::CreateDummyMesh(), NL3D::CShadowMapManager::CShadowMapManager(), NL3D::CCloud::dispBill(), NL3D::CPSUtil::displayArrow(), NL3D::CPSUtil::displayBBox(), NL3D::CInstanceGroup::displayDebugClusters(), NL3D::CPSLocatedBindable::displayIcon2d(), NL3D::CPSRibbonLookAt::displayRibbons(), NL3D::CPSShockWave::draw(), NL3D::CPSDot::draw(), NL3D::CDRU::drawLine(), NL3D::CDRU::drawQuad(), NL3D::CDRU::drawTriangle(), NL3D::CShadowMapManager::fillBlackBorder(), NL3D::CNoise3d::flush(), NL3D::CCloud::genBill(), NL3D::CCloud::generate(), NL3D::CPSFanLight::init(), NL3D::CNoise3d::init(), initUnlit(), NL3D::CMotionBlur::performMotionBlur(), NL3D::CMeshBlender::prepareRenderForGlobalAlphaCoarseMesh(), NL3D::CVisualCollisionManager::receiveShadowMap(), NL3D::CComputedString::render2D(), NL3D::CComputedString::render3D(), NL3D::CScene::renderOcclusionTestMeshs(), NL3D::CShadowMapManager::renderProject(), NL3D::CCloud::reset(), NL3D::CMeshBlender::restoreRenderCoarseMesh(), NL3D::SCloudTexture3D::SCloudTexture3D(), NL3D::SCloudTextureClamp::SCloudTextureClamp(), NL3D::UInstanceMaterial::setColor(), NL3D::CPSTailDot::setupGlobalColor(), NL3D::CPSConstraintMesh::setupMaterialColor(), NL3D::CWaterModel::setupMaterialNVertexShader(), NL3D::CWaterModel::setupSimpleRender(), NL3D::CPSRibbon::setupTexturedGlobalColor(), NL3D::CPSRibbon::setupUntexturedGlobalColor(), NL3D::CPSGravity::show(), NL3D::CPSEmitter::showTool(), NL3D::CPSTailDot::step(), NL3D::CPSRibbonLookAt::step(), NL3D::CPSRibbon::step(), NL3D::CWaterModel::traverseRender(), NL3D::CFlareModel::traverseRender(), and NL3D::CPSQuad::updateMatBeforeRendering().
Set the Diffuse part ot material. Useful only if setLighting(true) has been done. NB: opacity is NOT copied from diffuse.A.
Definition at line 162 of file driver_material_inline.h.
References _Diffuse, _Touched, NLMISC::CRGBA::B, NLMISC::CRGBA::G, NL3D::IDRV_TOUCHED_LIGHTING, and NLMISC::CRGBA::R.
Referenced by serial(), NL3D::UInstanceMaterial::setDiffuse(), and NL3D::CPSConstraintMesh::setupMaterialColor().
| void NL3D::CMaterial::setDoubleSided | ( | bool | active | ) | [inline] |
Definition at line 69 of file driver_material_inline.h.
References _Flags, _Touched, NL3D::IDRV_MAT_DOUBLE_SIDED, and NL3D::IDRV_TOUCHED_DOUBLE_SIDED.
Referenced by NL3D::CCloudScape::CCloudScape(), NL3D::CLodCharacterManager::CLodCharacterManager(), NL3D::CPSRibbon::CPSRibbon(), NL3D::CShadowMapManager::CShadowMapManager(), NL3D::CCloud::disp(), NL3D::CCloud::dispBill(), NL3D::CPSUtil::displayArrow(), NL3D::CInstanceGroup::displayDebugClusters(), NL3D::CDeform2d::doDeform(), NL3D::CWaterEnvMap::doInit(), NL3D::CPSShockWave::init(), NL3D::CPSQuad::init(), NL3D::CPSFanLight::init(), NL3D::CBloomEffect::init(), NL3D::CMotionBlur::performMotionBlur(), NL3D::CVegetableManager::render(), NL3D::CSegRemanence::render(), NL3D::CWaterEnvMap::renderTestMesh(), NL3D::SCloudTexture3D::SCloudTexture3D(), NL3D::CDriverUser::setDisplay(), NL3D::CSegRemanenceShape::setupMaterial(), NL3D::CWaterModel::setupMaterialNVertexShader(), NL3D::CWaterModel::setupSimpleRender(), NL3D::CWaterModel::traverseRender(), NL3D::CFlareModel::traverseRender(), and NL3D::CPSRibbonLookAt::updateMatAndVbForColor().
| void NL3D::CMaterial::setDstBlend | ( | TBlend | val | ) | [inline] |
Definition at line 56 of file driver_material_inline.h.
References _DstBlend, _Touched, and NL3D::IDRV_TOUCHED_BLENDFUNC.
Referenced by NL3D::CDRU::drawLine(), NL3D::CDRU::drawQuad(), NL3D::CDRU::drawTriangle(), NL3D::CLandscape::init(), NL3D::CMeshBlender::prepareRenderForGlobalAlpha(), NL3D::CMeshBlender::prepareRenderForGlobalAlphaCoarseMesh(), NL3D::CScene::renderOcclusionTestMeshs(), NL3D::CMeshBlender::restoreRender(), NL3D::CMeshBlender::restoreRenderCoarseMesh(), NL3D::UInstanceMaterial::setDstBlend(), NL3D::CWaterModel::setupMaterialNVertexShader(), NL3D::CWaterModel::setupSimpleRender(), and NL3D::CWaterModel::traverseRender().
Set the emissive part ot material. Useful only if setLighting(true) has been done.
Definition at line 150 of file driver_material_inline.h.
References _Emissive, _Touched, and NL3D::IDRV_TOUCHED_LIGHTING.
Referenced by serial(), and NL3D::UInstanceMaterial::setEmissive().
| void NL3D::CMaterial::setLightedVertexColor | ( | bool | useLightedVertexColor | ) | [inline] |
Set the color material flag. Used when the material is lighted. True to use the diffuse color of the material when lighted, false to use the color vertex.
Definition at line 189 of file driver_material_inline.h.
References _Flags, _Touched, NL3D::IDRV_MAT_LIGHTED_VERTEX_COLOR, and NL3D::IDRV_TOUCHED_LIGHTING.
Referenced by NL3D::CPSConstraintMesh::setupRenderPasses().
| void NL3D::CMaterial::setLighting | ( | bool | active, | |
| NLMISC::CRGBA | emissive = CRGBA(0,0,0), |
|||
| NLMISC::CRGBA | ambient = CRGBA(0,0,0), |
|||
| NLMISC::CRGBA | diffuse = CRGBA(0,0,0), |
|||
| NLMISC::CRGBA | specular = CRGBA(0,0,0), |
|||
| float | shininess = 10 | |||
| ) | [inline] |
Batch setup lighting. Opacity is in diffuse.A.
Definition at line 125 of file driver_material_inline.h.
References _Ambient, _Diffuse, _Emissive, _Flags, _Shininess, _Specular, _Touched, NL3D::IDRV_MAT_LIGHTING, and NL3D::IDRV_TOUCHED_LIGHTING.
Referenced by NL3D::CreateDummyMesh(), NL3D::CPSUtil::displayArrow(), NL3D::CPSUtil::displayBBox(), NL3D::CPSLocatedBindable::displayIcon2d(), NL3D::CDeform2d::doDeform(), NL3D::CWaterEnvMap::doInit(), NL3D::CPSShockWave::init(), NL3D::CPSQuad::init(), NL3D::CPSFanLight::init(), NL3D::CPSDot::init(), initLighted(), initUnlit(), NL3D::CVisualCollisionManager::receiveShadowMap(), NL3D::CMeshGeom::render(), NL3D::CWaterEnvMap::renderTestMesh(), NL3D::UInstanceMaterial::setLighting(), NL3D::CSegRemanenceShape::setupMaterial(), NL3D::CWaterModel::setupMaterialNVertexShader(), NL3D::CWaterModel::setupSimpleRender(), NL3D::CPSGravity::show(), NL3D::CPSEmitter::showTool(), NL3D::CWaterModel::traverseRender(), and NL3D::CFlareModel::traverseRender().
This part is valid for LightMap shaders (nlassert).
Definition at line 405 of file material.cpp.
References _LightMaps, _ShaderType, _Touched, NL3D::IDRV_TOUCHED_LIGHTMAP, LightMap, and nlassert.
Set the lightmap intensity. (def : White).
Definition at line 426 of file material.cpp.
References _LightMaps, _ShaderType, _Touched, NL3D::IDRV_TOUCHED_LIGHTMAP, and LightMap.
| void NL3D::CMaterial::setLightMapMulx2 | ( | bool | val | ) | [inline] |
Set the multiply x 2 mode to burn colors (used with lightmaps 8 bits) (def: false).
Definition at line 496 of file material.h.
References _LightMapsMulx2.
Used for LightMap Compression (LMC). Set the LMC color terms. default to black/white (no compression).
Definition at line 439 of file material.cpp.
References _LightMaps, _ShaderType, _Touched, NL3D::IDRV_TOUCHED_LIGHTMAP, and LightMap.
| void NL3D::CMaterial::setOpacity | ( | uint8 | opa | ) | [inline] |
Set the Opacity part ot material. Useful only if setLighting(true) has been done.
Definition at line 171 of file driver_material_inline.h.
References _Diffuse, _Touched, NLMISC::CRGBA::A, and NL3D::IDRV_TOUCHED_LIGHTING.
Referenced by NL3D::CMeshBlender::prepareRenderForGlobalAlpha(), NL3D::CMeshBlender::restoreRender(), and NL3D::UInstanceMaterial::setOpacity().
| void NL3D::CMaterial::setShader | ( | TShader | val | ) |
Set the shader for this material.
All textures are reseted!!
Definition at line 297 of file material.cpp.
References _ShaderType, _Touched, Constant, Diffuse, NL3D::IDRV_MAT_MAXTEXTURES, NL3D::IDRV_TOUCHED_SHADER, InterpolateTexture, LightMap, Modulate, Normal, Previous, Replace, setTexture(), SrcAlpha, SrcColor, texEnvArg0Alpha(), texEnvArg0RGB(), texEnvArg1RGB(), texEnvOpAlpha(), texEnvOpRGB(), and UserColor.
Referenced by NL3D::CCloudScape::CCloudScape(), NL3D::CNoise3d::init(), initUnlit(), CEGUI::NeLTexture::loadFromMemory(), NL3D::SCloudTexture3D::SCloudTexture3D(), NL3D::SCloudTextureClamp::SCloudTextureClamp(), NL3D::CWaterModel::setupMaterialNVertexShader(), and NL3D::CWaterModel::setupSimpleRender().
| void NL3D::CMaterial::setShininess | ( | float | shininess | ) | [inline] |
Set the shininess part ot material. Useful only if setLighting(true) has been done.
Definition at line 183 of file driver_material_inline.h.
References _Shininess, _Touched, and NL3D::IDRV_TOUCHED_LIGHTING.
Referenced by NL3D::UInstanceMaterial::setShininess().
Set the specular part ot material. Useful only if setLighting(true) has been done.
Definition at line 177 of file driver_material_inline.h.
References _Specular, _Touched, and NL3D::IDRV_TOUCHED_LIGHTING.
Referenced by serial(), and NL3D::UInstanceMaterial::setSpecular().
| void NL3D::CMaterial::setSrcBlend | ( | TBlend | val | ) | [inline] |
Definition at line 50 of file driver_material_inline.h.
References _SrcBlend, _Touched, and NL3D::IDRV_TOUCHED_BLENDFUNC.
Referenced by NL3D::CDRU::drawLine(), NL3D::CDRU::drawQuad(), NL3D::CDRU::drawTriangle(), NL3D::CLandscape::init(), NL3D::CMeshBlender::prepareRenderForGlobalAlpha(), NL3D::CMeshBlender::prepareRenderForGlobalAlphaCoarseMesh(), NL3D::CScene::renderOcclusionTestMeshs(), NL3D::CMeshBlender::restoreRender(), NL3D::CMeshBlender::restoreRenderCoarseMesh(), NL3D::UInstanceMaterial::setSrcBlend(), NL3D::CWaterModel::setupMaterialNVertexShader(), NL3D::CWaterModel::setupSimpleRender(), and NL3D::CWaterModel::traverseRender().
| void NL3D::CMaterial::setStainedGlassWindow | ( | bool | val | ) | [inline] |
Definition at line 517 of file material.h.
References _StainedGlassWindow.
| void NL3D::CMaterial::setTexAddressingMode | ( | uint8 | stage, | |
| TTexAddressingMode | mode | |||
| ) |
Set a texture addressing mode for the given stage.
You should test if this mode is supported in the driver you plane to use. Texture addressing modes should have been enabled otherwise an assertion is raised
Definition at line 503 of file material.cpp.
References _Flags, _TexAddrMode, NL3D::IDRV_MAT_MAXTEXTURES, NL3D::IDRV_MAT_TEX_ADDR, nlassert, and TexAddrCount.
Referenced by NL3D::CPSMultiTexturedParticle::setupMultiTexEnv().
Definition at line 343 of file driver_material_inline.h.
References _Flags, _Touched, NL3D::IDRV_MAT_GEN_TEX_0, NL3D::IDRV_MAT_MAXTEXTURES, NL3D::IDRV_TOUCHED_TEXGEN, and nlassert.
Referenced by NL3D::CShadowMapManager::CShadowMapManager(), and NL3D::CWaterModel::setupSimpleRender().
| void NL3D::CMaterial::setTexCoordGenMode | ( | uint | stage, | |
| TTexCoordGenMode | mode | |||
| ) | [inline] |
Definition at line 426 of file driver_material_inline.h.
References _TexCoordGenMode, _Touched, NL3D::IDRV_MAT_MAXTEXTURES, NL3D::IDRV_MAT_TEX_GEN_MASK, NL3D::IDRV_MAT_TEX_GEN_SHIFT, and NL3D::IDRV_TOUCHED_TEXGEN.
Referenced by NL3D::CShadowMapManager::CShadowMapManager(), and NL3D::CWaterModel::setupSimpleRender().
For push/pop only, set the packed version of the environnment mode.
Definition at line 322 of file driver_material_inline.h.
References _ShaderType, _TexEnvs, _Touched, NL3D::CMaterial::CTexEnv::EnvPacked, NL3D::IDRV_MAT_MAXTEXTURES, NL3D::IDRV_TOUCHED_TEXENV, nlassert, and Normal.
Referenced by NL3D::CLandscape::render(), and NL3D::CPSConstraintMesh::setupMaterialColor().
set a texture for a special stage.
Different usage according to shader:
Definition at line 337 of file material.cpp.
References _ShaderType, _Textures, _Touched, NL3D::IDRV_MAT_MAXTEXTURES, NL3D::IDRV_TOUCHED_TEX, LightMap, nlassert, and UserColor.
Referenced by NL3D::CLodCharacterManager::CLodCharacterManager(), NL3D::CreateDummyMesh(), NL3D::CShadowMapManager::CShadowMapManager(), NL3D::CCloud::disp(), NL3D::CCloud::dispBill(), NL3D::CBloomEffect::doBlur(), NL3D::CDeform2d::doDeform(), NL3D::CDRU::drawBitmap(), NL3D::UInstanceMaterial::emptyTexture(), NL3D::CPSMaterial::forceModulateConstantColor(), NL3D::CPSMaterial::forceTexturedMaterialStages(), NL3D::CNoise3d::init(), NL3D::SCloudTextureClamp::init(), NL3D::SCloudTexture3D::init(), NL3D::CBloomEffect::init(), NL3D::CBloomEffect::initBloom(), initUnlit(), CEGUI::NeLTexture::loadFromMemory(), NL3D::CVegetableManager::loadTexture(), NL3D::CMotionBlur::performMotionBlur(), NL3D::CVegetableManager::render(), NL3D::CLandscape::render(), NL3D::CShadowMapManager::renderGenerate(), NL3D::CShadowMapManager::renderProject(), NL3D::CWaterEnvMap::renderTestMesh(), setShader(), NL3D::UInstanceMaterial::setTextureFileName(), NL3D::UInstanceMaterial::setTextureMem(), NL3D::CPSMultiTexturedParticle::setupMaterial(), NL3D::CPSFanLight::setupMaterial(), NL3D::CWaterModel::setupMaterialNVertexShader(), NL3D::CPSMultiTexturedParticle::setupMultiTexEnv(), NL3D::CWaterModel::setupSimpleRender(), NL3D::CDriverUser::stretchRect(), NL3D::CFlareModel::traverseRender(), NL3D::CWaterEnvMap::update(), NL3D::CShadowMapManager::updateBlurTexture(), NL3D::CPSRibbonLookAt::updateMatAndVbForColor(), NL3D::CPSShockWave::updateMatAndVbForTexture(), NL3D::CPSQuad::updateMatAndVbForTexture(), NL3D::CPSTailDot::updateMaterial(), NL3D::CPSRibbon::updateTexturedMaterial(), NL3D::CPSRibbon::updateUntexturedMaterial(), and NL3D::CBloomEffect::~CBloomEffect().
| void NL3D::CMaterial::setUserColor | ( | CRGBA | userColor | ) | [inline] |
This part is valid for Normal shaders (nlassert).
Definition at line 361 of file driver_material_inline.h.
References _ShaderType, _TexEnvs, _Touched, NL3D::CMaterial::CTexEnv::ConstantColor, NL3D::IDRV_TOUCHED_TEXENV, nlassert, and UserColor.
Referenced by NL3D::UInstanceMaterial::setUserColor().
| void NL3D::CMaterial::setUserTexMat | ( | uint | stage, | |
| const NLMISC::CMatrix & | m | |||
| ) | [inline] |
Set a new texture matrix for the given stage.
Definition at line 410 of file driver_material_inline.h.
References _TexUserMat, isUserTexMatEnabled(), and nlassert.
Referenced by NL3D::CShadowMapProjector::applyToMaterial(), NL3D::CSegRemanence::render(), NL3D::CPSConstraintMesh::setupRenderPasses(), NL3D::CWaterModel::setupSimpleRender(), NL3D::CPSRibbon::setupTextureMatrix(), NL3D::CPSShockWave::setupUFactor(), and NL3D::UInstanceMaterial::setUserTexMat().
| void NL3D::CMaterial::setZBias | ( | float | val | ) | [inline] |
The z bias is a z dispacement of the object to solve z precision problem.
The bias is gived in world coordinate units. Positive bias give a lower z priority, negative bias give a higher bias priority.
Definition at line 110 of file driver_material_inline.h.
References _Touched, _ZBias, and NL3D::IDRV_TOUCHED_ZBIAS.
Referenced by initUnlit(), NL3D::CLandscape::receiveShadowMap(), and NL3D::CPSMaterial::setZBias().
| void NL3D::CMaterial::setZFunc | ( | ZFunc | val | ) | [inline] |
Definition at line 97 of file driver_material_inline.h.
References _Touched, _ZFunction, and NL3D::IDRV_TOUCHED_ZFUNC.
Referenced by NL3D::CCloudScape::CCloudScape(), NL3D::CShadowMapManager::CShadowMapManager(), NL3D::CCloud::disp(), NL3D::CInstanceGroup::displayDebugClusters(), NL3D::CPSLocatedBindable::displayIcon2d(), NL3D::CDeform2d::doDeform(), NL3D::CWaterEnvMap::doInit(), NL3D::CDRU::drawBitmap(), NL3D::CDRU::drawLine(), NL3D::CDRU::drawQuad(), NL3D::CDRU::drawTriangle(), NL3D::CPSMaterial::enableZTest(), NL3D::CRenderStringBuffer::flush(), NL3D::CRenderStringBuffer::flushUnProjected(), NL3D::CPSShockWave::init(), NL3D::CPSFanLight::init(), NL3D::CPSDot::init(), NL3D::CNoise3d::init(), NL3D::CBloomEffect::init(), NL3D::CFlareModel::initStatics(), initUnlit(), NL3D::CMotionBlur::performMotionBlur(), NL3D::CComputedString::render2D(), NL3D::CComputedString::render3D(), NL3D::CWaterEnvMap::renderTestMesh(), NL3D::SCloudTexture3D::SCloudTexture3D(), NL3D::SCloudTextureClamp::SCloudTextureClamp(), NL3D::UInstanceMaterial::setZFunc(), NL3D::CLandscape::setZFunc(), NL3D::CPSEmitter::showTool(), and NL3D::CFlareModel::traverseRender().
| void NL3D::CMaterial::setZWrite | ( | bool | active | ) | [inline] |
Definition at line 103 of file driver_material_inline.h.
References _Flags, _Touched, NL3D::IDRV_MAT_ZWRITE, and NL3D::IDRV_TOUCHED_ZWRITE.
Referenced by NL3D::CCloudScape::CCloudScape(), NL3D::CPSMaterial::CPSMaterial(), NL3D::CShadowMapManager::CShadowMapManager(), NL3D::CCloud::disp(), NL3D::CPSUtil::displayArrow(), NL3D::CPSUtil::displayBBox(), NL3D::CInstanceGroup::displayDebugClusters(), NL3D::CPSLocatedBindable::displayIcon2d(), NL3D::CWaterEnvMap::doInit(), NL3D::CRenderStringBuffer::flush(), NL3D::CRenderStringBuffer::flushUnProjected(), NL3D::CNoise3d::init(), NL3D::CBloomEffect::init(), NL3D::CFlareModel::initStatics(), initUnlit(), NL3D::CMotionBlur::performMotionBlur(), NL3D::CMeshBlender::prepareRenderForGlobalAlpha(), NL3D::CMeshBlender::prepareRenderForGlobalAlphaCoarseMesh(), NL3D::CVegetableManager::render(), NL3D::CComputedString::render2D(), NL3D::CComputedString::render3D(), NL3D::CScene::renderOcclusionTestMeshs(), NL3D::CWaterEnvMap::renderTestMesh(), NL3D::CMeshBlender::restoreRender(), NL3D::CMeshBlender::restoreRenderCoarseMesh(), NL3D::SCloudTexture3D::SCloudTexture3D(), NL3D::SCloudTextureClamp::SCloudTextureClamp(), NL3D::CPSMaterial::setBlendingMode(), NL3D::CWaterModel::setupMaterialNVertexShader(), NL3D::CWaterModel::setupSimpleRender(), NL3D::UInstanceMaterial::setZWrite(), NL3D::CPSGravity::show(), NL3D::CPSEmitter::showTool(), and NL3D::CFlareModel::traverseRender().
| bool NL3D::CMaterial::texAddrEnabled | ( | ) | const |
test whether texture addressing mode are enabled
Definition at line 497 of file material.cpp.
References _Flags, and NL3D::IDRV_MAT_TEX_ADDR.
Setup the constant color for a stage. Used for the TTexSource:Constant.
Definition at line 305 of file driver_material_inline.h.
References _ShaderType, _TexEnvs, _Touched, NL3D::CMaterial::CTexEnv::ConstantColor, NL3D::IDRV_MAT_MAXTEXTURES, NL3D::IDRV_TOUCHED_TEXENV, nlassert, and Normal.
Referenced by NL3D::CBloomEffect::applyBlur(), NL3D::CShadowMapManager::CShadowMapManager(), NL3D::CWaterEnvMap::doInit(), NL3D::CPSDot::draw(), NL3D::CPSMaterial::forceModulateConstantColor(), NL3D::CBloomEffect::init(), NL3D::CLandscape::render(), NL3D::CWaterEnvMap::renderTestMesh(), NL3D::UInstanceMaterial::setConstantColor(), NL3D::CPSTailDot::setupGlobalColor(), NL3D::CPSFanLight::setupMaterial(), NL3D::CPSRibbon::setupTexturedGlobalColor(), NL3D::CPSRibbon::setupUntexturedGlobalColor(), and NL3D::CWaterEnvMap::update().
| void NL3D::CMaterial::texEnvArg0Alpha | ( | uint | stage, | |
| TTexSource | src, | |||
| TTexOperand | oper | |||
| ) | [inline] |
Definition at line 273 of file driver_material_inline.h.
References _ShaderType, _TexEnvs, _Touched, NL3D::CMaterial::CTexEnv::Env, NL3D::IDRV_MAT_MAXTEXTURES, NL3D::IDRV_TOUCHED_TEXENV, InvSrcAlpha, nlassert, Normal, and SrcAlpha.
Referenced by NL3D::CCloudScape::CCloudScape(), NL3D::CShadowMapManager::CShadowMapManager(), NL3D::CWaterEnvMap::doInit(), NL3D::CPSMaterial::forceModulateConstantColor(), NL3D::CLandscape::init(), NL3D::CMotionBlur::performMotionBlur(), NL3D::CVegetableManager::render(), NL3D::CLandscape::render(), NL3D::CWaterEnvMap::renderTestMesh(), NL3D::SCloudTexture3D::SCloudTexture3D(), NL3D::SCloudTextureClamp::SCloudTextureClamp(), setShader(), NL3D::CPSConstraintMesh::setupMaterialColor(), NL3D::SetupModulatedStage(), NL3D::CPSMultiTexturedParticle::setupMultiTexEnv(), and NL3D::CWaterModel::setupSimpleRender().
| void NL3D::CMaterial::texEnvArg0RGB | ( | uint | stage, | |
| TTexSource | src, | |||
| TTexOperand | oper | |||
| ) | [inline] |
Definition at line 229 of file driver_material_inline.h.
References _ShaderType, _TexEnvs, _Touched, NL3D::CMaterial::CTexEnv::Env, NL3D::IDRV_MAT_MAXTEXTURES, NL3D::IDRV_TOUCHED_TEXENV, nlassert, and Normal.
Referenced by NL3D::CCloudScape::CCloudScape(), NL3D::CShadowMapManager::CShadowMapManager(), NL3D::CCloud::disp(), NL3D::CWaterEnvMap::doInit(), NL3D::CPSMaterial::forceModulateConstantColor(), NL3D::CLandscape::init(), NL3D::CBloomEffect::init(), NL3D::CVegetableManager::render(), NL3D::CLandscape::render(), NL3D::CWaterEnvMap::renderTestMesh(), NL3D::SCloudTexture3D::SCloudTexture3D(), setShader(), NL3D::CPSConstraintMesh::setupMaterialColor(), NL3D::SetupModulatedStage(), NL3D::CPSMultiTexturedParticle::setupMultiTexEnv(), and NL3D::CWaterModel::setupSimpleRender().
| void NL3D::CMaterial::texEnvArg1Alpha | ( | uint | stage, | |
| TTexSource | src, | |||
| TTexOperand | oper | |||
| ) | [inline] |
Definition at line 283 of file driver_material_inline.h.
References _ShaderType, _TexEnvs, _Touched, NL3D::CMaterial::CTexEnv::Env, NL3D::IDRV_MAT_MAXTEXTURES, NL3D::IDRV_TOUCHED_TEXENV, InvSrcAlpha, nlassert, Normal, and SrcAlpha.
Referenced by NL3D::CCloudScape::CCloudScape(), NL3D::CShadowMapManager::CShadowMapManager(), NL3D::CPSMaterial::forceModulateConstantColor(), NL3D::CVegetableManager::render(), NL3D::CLandscape::render(), NL3D::SCloudTextureClamp::SCloudTextureClamp(), NL3D::CPSConstraintMesh::setupMaterialColor(), NL3D::SetupModulatedStage(), NL3D::CPSMultiTexturedParticle::setupMultiTexEnv(), and NL3D::CWaterModel::setupSimpleRender().
| void NL3D::CMaterial::texEnvArg1RGB | ( | uint | stage, | |
| TTexSource | src, | |||
| TTexOperand | oper | |||
| ) | [inline] |
Definition at line 238 of file driver_material_inline.h.
References _ShaderType, _TexEnvs, _Touched, NL3D::CMaterial::CTexEnv::Env, NL3D::IDRV_MAT_MAXTEXTURES, NL3D::IDRV_TOUCHED_TEXENV, nlassert, and Normal.
Referenced by NL3D::CCloudScape::CCloudScape(), NL3D::CShadowMapManager::CShadowMapManager(), NL3D::CPSMaterial::forceModulateConstantColor(), NL3D::CLandscape::init(), NL3D::CBloomEffect::init(), NL3D::CVegetableManager::render(), NL3D::CLandscape::render(), NL3D::SCloudTexture3D::SCloudTexture3D(), setShader(), NL3D::CPSConstraintMesh::setupMaterialColor(), NL3D::SetupModulatedStage(), NL3D::CPSMultiTexturedParticle::setupMultiTexEnv(), and NL3D::CWaterModel::setupSimpleRender().
| void NL3D::CMaterial::texEnvArg2Alpha | ( | uint | stage, | |
| TTexSource | src, | |||
| TTexOperand | oper | |||
| ) | [inline] |
Definition at line 293 of file driver_material_inline.h.
References _ShaderType, _TexEnvs, NL3D::CMaterial::CTexEnv::Env, NL3D::IDRV_MAT_MAXTEXTURES, InvSrcAlpha, nlassert, Normal, and SrcAlpha.
| void NL3D::CMaterial::texEnvArg2RGB | ( | uint | stage, | |
| TTexSource | src, | |||
| TTexOperand | oper | |||
| ) | [inline] |
Definition at line 247 of file driver_material_inline.h.
References _ShaderType, _TexEnvs, NL3D::CMaterial::CTexEnv::Env, NL3D::IDRV_MAT_MAXTEXTURES, nlassert, and Normal.
Referenced by NL3D::CBloomEffect::init().
| void NL3D::CMaterial::texEnvOpAlpha | ( | uint | stage, | |
| TTexOperator | ope | |||
| ) | [inline] |
Definition at line 256 of file driver_material_inline.h.
References _ShaderType, _TexEnvs, _Touched, NL3D::CMaterial::CTexEnv::Env, NL3D::IDRV_MAT_MAXTEXTURES, NL3D::IDRV_TOUCHED_TEXENV, nlassert, and Normal.
Referenced by NL3D::CCloudScape::CCloudScape(), NL3D::CShadowMapManager::CShadowMapManager(), NL3D::CWaterEnvMap::doInit(), NL3D::CPSMaterial::forceModulateConstantColor(), NL3D::CLandscape::init(), NL3D::CMotionBlur::performMotionBlur(), NL3D::CVegetableManager::render(), NL3D::CLandscape::render(), NL3D::CWaterEnvMap::renderTestMesh(), NL3D::SCloudTexture3D::SCloudTexture3D(), NL3D::SCloudTextureClamp::SCloudTextureClamp(), setShader(), NL3D::CPSConstraintMesh::setupMaterialColor(), NL3D::SetupModulatedStage(), NL3D::CPSMultiTexturedParticle::setupMultiTexEnv(), and NL3D::CWaterModel::setupSimpleRender().
| void NL3D::CMaterial::texEnvOpRGB | ( | uint | stage, | |
| TTexOperator | ope | |||
| ) | [inline] |
This part is valid for Normal shaders (nlassert).
It maps the EXT_texture_env_combine opengl extension. A stage is enabled if his texture is !=NULL. By default, all stages are setup to Modulate style: AlphaOp=RGBOp= Modulate, RGBArg0= TextureSrcColor, RGBArg1= PreviousSrcColor, AlphaArg0= TextureSrcAlpha, AlphaArg1= PreviousSrcAlpha. ConstantColor default to White(255,255,255,255).
For compatibility problems:
NB: for Alpha Aguments, only operands SrcAlpha and InvSrcAlpha are valid (nlassert..).
Definition at line 212 of file driver_material_inline.h.
References _ShaderType, _TexEnvs, _Touched, NL3D::CMaterial::CTexEnv::Env, NL3D::IDRV_MAT_MAXTEXTURES, NL3D::IDRV_TOUCHED_TEXENV, nlassert, and Normal.
Referenced by NL3D::CCloudScape::CCloudScape(), NL3D::CShadowMapManager::CShadowMapManager(), NL3D::CCloud::disp(), NL3D::CWaterEnvMap::doInit(), NL3D::CPSMaterial::forceModulateConstantColor(), NL3D::CLandscape::init(), NL3D::CBloomEffect::init(), NL3D::CMotionBlur::performMotionBlur(), NL3D::CVegetableManager::render(), NL3D::CLandscape::render(), NL3D::CWaterEnvMap::renderTestMesh(), NL3D::SCloudTexture3D::SCloudTexture3D(), setShader(), NL3D::CPSMultiTexturedParticle::setupMaterial(), NL3D::CPSConstraintMesh::setupMaterialColor(), NL3D::SetupModulatedStage(), NL3D::CPSMultiTexturedParticle::setupMultiTexEnv(), and NL3D::CWaterModel::setupSimpleRender().
Definition at line 34 of file driver_material_inline.h.
References _Textures, NL3D::IDRV_MAT_MAXTEXTURES, and nlassert.
Referenced by NL3D::CShapeBank::processWaitingShapes(), and NL3D::CAsyncFileManager3D::CMeshLoad::run().
float NL3D::CMaterial::_AlphaTestThreshold [private] |
Definition at line 692 of file material.h.
Referenced by CMaterial(), getAlphaTestThreshold(), operator=(), serial(), and setAlphaTestThreshold().
CRGBA NL3D::CMaterial::_Ambient [private] |
Definition at line 690 of file material.h.
Referenced by getAmbient(), operator=(), serial(), setAmbient(), and setLighting().
CRGBA NL3D::CMaterial::_Color [private] |
Definition at line 689 of file material.h.
Referenced by CMaterial(), getColor(), operator=(), serial(), and setColor().
CRGBA NL3D::CMaterial::_Diffuse [private] |
Definition at line 690 of file material.h.
Referenced by getDiffuse(), getOpacity(), operator=(), serial(), setDiffuse(), setLighting(), and setOpacity().
TBlend NL3D::CMaterial::_DstBlend [private] |
Definition at line 686 of file material.h.
Referenced by CMaterial(), getDstBlend(), operator=(), serial(), setBlendFunc(), and setDstBlend().
CRGBA NL3D::CMaterial::_Emissive [private] |
Definition at line 690 of file material.h.
Referenced by getEmissive(), operator=(), serial(), setEmissive(), and setLighting().
uint32 NL3D::CMaterial::_Flags [private] |
Definition at line 685 of file material.h.
Referenced by CMaterial(), enableTexAddrMode(), enableUserTexMat(), getAlphaTest(), getBlend(), getDoubleSided(), getFlags(), getLightedVertexColor(), getTexAddressingMode(), getTexCoordGen(), getZWrite(), isLighted(), isLightedVertexColor(), isUserTexMatEnabled(), operator=(), serial(), setAlphaTest(), setBlend(), setDoubleSided(), setLightedVertexColor(), setLighting(), setTexAddressingMode(), setTexCoordGen(), setZWrite(), and texAddrEnabled().
Definition at line 729 of file material.h.
Referenced by NL3D::CDriverGL::computeLightMapInfos(), flushTextures(), getLightMap(), operator=(), serial(), setLightMap(), setLightMapFactor(), setLMCColors(), NL3D::CDriverGL::setupLightMapPass(), NL3D::CDriverGL::setupMaterial(), and NL3D::CDriverD3D::setupMaterial().
Definition at line 730 of file material.h.
Referenced by CMaterial(), NL3D::CDriverGL::endLightMapMultiPass(), operator=(), serial(), setLightMapMulx2(), NL3D::CDriverGL::setupLightMapPass(), and NL3D::CDriverD3D::setupMaterial().
Definition at line 708 of file material.h.
Referenced by NL3D::CDriverGL::setupMaterial(), NL3D::CDriverD3D::setupMaterial(), and ~CMaterial().
TShader NL3D::CMaterial::_ShaderType [private] |
Definition at line 684 of file material.h.
Referenced by CMaterial(), flushTextures(), getLightMap(), getShader(), getTexConstantColor(), getTexEnvMode(), getTexEnvOpAlpha(), getTexEnvOpRGB(), getUserColor(), operator=(), serial(), setLightMap(), setLightMapFactor(), setLMCColors(), setShader(), setTexEnvMode(), setTexture(), setUserColor(), texConstantColor(), texEnvArg0Alpha(), texEnvArg0RGB(), texEnvArg1Alpha(), texEnvArg1RGB(), texEnvArg2Alpha(), texEnvArg2RGB(), texEnvOpAlpha(), and texEnvOpRGB().
float NL3D::CMaterial::_Shininess [private] |
Definition at line 691 of file material.h.
Referenced by getShininess(), operator=(), serial(), setLighting(), and setShininess().
CRGBA NL3D::CMaterial::_Specular [private] |
Definition at line 690 of file material.h.
Referenced by getSpecular(), operator=(), serial(), setLighting(), and setSpecular().
TBlend NL3D::CMaterial::_SrcBlend [private] |
Definition at line 686 of file material.h.
Referenced by CMaterial(), getSrcBlend(), operator=(), serial(), setBlendFunc(), and setSrcBlend().
bool NL3D::CMaterial::_StainedGlassWindow [private] |
Definition at line 694 of file material.h.
Referenced by CMaterial(), getStainedGlassWindow(), and setStainedGlassWindow().
Definition at line 706 of file material.h.
Referenced by enableTexAddrMode(), getTexAddressingMode(), operator=(), serial(), setTexAddressingMode(), and NL3D::CDriverGL::setupMaterial().
uint16 NL3D::CMaterial::_TexCoordGenMode [private] |
Definition at line 696 of file material.h.
Referenced by CMaterial(), getTexCoordGenMode(), operator=(), serial(), and setTexCoordGenMode().
Definition at line 707 of file material.h.
Referenced by getTexConstantColor(), getTexEnvMode(), getTexEnvOpAlpha(), getTexEnvOpRGB(), getUserColor(), operator=(), serial(), setTexEnvMode(), NL3D::CDriverGL::setTextureEnvFunction(), NL3D::CDriverD3D::setupMaterial(), setUserColor(), texConstantColor(), texEnvArg0Alpha(), texEnvArg0RGB(), texEnvArg1Alpha(), texEnvArg1RGB(), texEnvArg2Alpha(), texEnvArg2RGB(), texEnvOpAlpha(), and texEnvOpRGB().
Definition at line 705 of file material.h.
Referenced by flushTextures(), getNumUsedTextureStages(), getTexture(), operator=(), selectTextureSet(), serial(), setTexture(), NL3D::CDriverGL::setupMaterial(), NL3D::CDriverGL::setupWaterPassNV20(), and texturePresent().
std::auto_ptr<CUserTexMat> NL3D::CMaterial::_TexUserMat [private] |
Definition at line 701 of file material.h.
Referenced by decompUserTexMat(), enableUserTexMat(), getUserTexMat(), operator=(), serial(), and setUserTexMat().
uint32 NL3D::CMaterial::_Touched [private] |
Definition at line 693 of file material.h.
Referenced by clearTouched(), CMaterial(), getTouched(), operator=(), serial(), setAlphaTest(), setAlphaTestThreshold(), setAmbient(), setBlend(), setBlendFunc(), setColor(), setDiffuse(), setDoubleSided(), setDstBlend(), setEmissive(), setLightedVertexColor(), setLighting(), setLightMap(), setLightMapFactor(), setLMCColors(), setOpacity(), setShader(), setShininess(), setSpecular(), setSrcBlend(), setTexCoordGen(), setTexCoordGenMode(), setTexEnvMode(), setTexture(), setUserColor(), setZBias(), setZFunc(), setZWrite(), texConstantColor(), texEnvArg0Alpha(), texEnvArg0RGB(), texEnvArg1Alpha(), texEnvArg1RGB(), texEnvOpAlpha(), and texEnvOpRGB().
float NL3D::CMaterial::_ZBias [private] |
Definition at line 688 of file material.h.
Referenced by CMaterial(), getZBias(), operator=(), serial(), and setZBias().
ZFunc NL3D::CMaterial::_ZFunction [private] |
Definition at line 687 of file material.h.
Referenced by CMaterial(), getZFunc(), operator=(), serial(), and setZFunc().
1.6.1