this contains material of a particle, this doesn't initiliaze anything, this just give the abylity to change the blending mode More...
#include <ps_particle_basic.h>
Inherited by NL3D::CPSDot, NL3D::CPSFanLight, NL3D::CPSQuad, NL3D::CPSRibbon, NL3D::CPSRibbonLookAt, NL3D::CPSShockWave, and NL3D::CPSTailDot.
Public Types | |
| enum | TBlendingMode { add, modulate, alphaBlend, alphaTest } |
this enum summarize the useful modes for blending to the framebuffer More... | |
Public Member Functions | |
| CPSMaterial () | |
| ctor : the default is additive blending | |
| void | serialMaterial (NLMISC::IStream &f) throw (NLMISC::EStream) |
| serialization (not named 'serial' because it will be used via multiple-inheritance) | |
| void | setBlendingMode (CPSMaterial::TBlendingMode mode) |
| set the blending mode. The default is ass | |
| CPSMaterial::TBlendingMode | getBlendingMode (void) const |
| return the blending mode currently used | |
| void | forceModulateConstantColor (bool force, const NLMISC::CRGBA &col=NLMISC::CRGBA::White) |
| Force the material to have one texture that is modulated by diffuse, and a constant color and its diffuse color. | |
| void | forceTexturedMaterialStages (uint numStages) |
| This setup n stage of a material with at least texture. | |
| void | enableZTest (bool enabled) |
| =================================================================================== | |
| bool | isZTestEnabled () const |
| =================================================================================== | |
| void | setZBias (float value) |
| float | getZBias () const |
Protected Attributes | |
| CMaterial | _Mat |
this contains material of a particle, this doesn't initiliaze anything, this just give the abylity to change the blending mode
Definition at line 806 of file ps_particle_basic.h.
this enum summarize the useful modes for blending to the framebuffer
Definition at line 813 of file ps_particle_basic.h.
| NL3D::CPSMaterial::CPSMaterial | ( | ) |
ctor : the default is additive blending
===================================================================================
Definition at line 513 of file ps_particle_basic.cpp.
References _Mat, NL_PS_FUNC, NL3D::CMaterial::one, NL3D::CMaterial::setBlend(), NL3D::CMaterial::setBlendFunc(), and NL3D::CMaterial::setZWrite().
| void NL3D::CPSMaterial::enableZTest | ( | bool | enabled | ) |
===================================================================================
Definition at line 555 of file ps_particle_basic.cpp.
References _Mat, NL3D::CMaterial::always, NL3D::CMaterial::less, NL_PS_FUNC, and NL3D::CMaterial::setZFunc().
| void NL3D::CPSMaterial::forceModulateConstantColor | ( | bool | force, | |
| const NLMISC::CRGBA & | col = NLMISC::CRGBA::White | |||
| ) |
Force the material to have one texture that is modulated by diffuse, and a constant color and its diffuse color.
===================================================================================
This is not compatible with multitextureing, however.
| force | true to force constant color modulation |
TODO : caching..
Definition at line 624 of file ps_particle_basic.cpp.
References _Mat, NL3D::CMaterial::Constant, forceTexturedMaterialStages(), NL3D::CMaterial::getTexture(), NL3D::CMaterial::Modulate, NL_PS_FUNC, NL3D::CMaterial::Previous, NL3D::CMaterial::setTexture(), NL3D::CMaterial::SrcAlpha, NL3D::CMaterial::SrcColor, NL3D::CMaterial::texConstantColor(), NL3D::CMaterial::texEnvArg0Alpha(), NL3D::CMaterial::texEnvArg0RGB(), NL3D::CMaterial::texEnvArg1Alpha(), NL3D::CMaterial::texEnvArg1RGB(), NL3D::CMaterial::texEnvOpAlpha(), and NL3D::CMaterial::texEnvOpRGB().
Referenced by NL3D::CPSRibbonLookAt::displayRibbons(), NL3D::CPSShockWave::draw(), and NL3D::CPSQuad::updateMatBeforeRendering().
| void NL3D::CPSMaterial::forceTexturedMaterialStages | ( | uint | numStages | ) |
This setup n stage of a material with at least texture.
===================================================================================
Definition at line 650 of file ps_particle_basic.cpp.
References _Mat, NL3D::CTextureMem::Create1x1WhiteTex(), NL3D::CMaterial::getTexture(), NL3D::IDRV_MAT_MAXTEXTURES, NL_PS_FUNC, and NL3D::CMaterial::setTexture().
Referenced by NL3D::CPSDot::draw(), forceModulateConstantColor(), NL3D::CPSFanLight::setupMaterial(), NL3D::CPSTailDot::updateMaterial(), NL3D::CPSRibbon::updateTexturedMaterial(), and NL3D::CPSRibbon::updateUntexturedMaterial().
| CPSMaterial::TBlendingMode NL3D::CPSMaterial::getBlendingMode | ( | void | ) | const |
return the blending mode currently used
===================================================================================
Definition at line 601 of file ps_particle_basic.cpp.
References _Mat, add, alphaBlend, alphaTest, NL3D::CMaterial::getBlend(), NL3D::CMaterial::getDstBlend(), NL3D::CMaterial::getSrcBlend(), NL3D::CMaterial::invsrcalpha, modulate, NL_PS_FUNC, nlassert, NL3D::CMaterial::one, NL3D::CMaterial::srcalpha, NL3D::CMaterial::srccolor, and NL3D::CMaterial::zero.
Referenced by NL3D::CPSTailDot::hasTransparentFaces(), NL3D::CPSShockWave::hasTransparentFaces(), NL3D::CPSRibbonLookAt::hasTransparentFaces(), NL3D::CPSRibbon::hasTransparentFaces(), NL3D::CPSQuad::hasTransparentFaces(), NL3D::CPSFanLight::hasTransparentFaces(), and NL3D::CPSDot::hasTransparentFaces().
| float NL3D::CPSMaterial::getZBias | ( | void | ) | const [inline] |
Reimplemented in NL3D::CPSDot, NL3D::CPSFanLight, NL3D::CPSQuad, NL3D::CPSRibbon, NL3D::CPSRibbonLookAt, NL3D::CPSShockWave, and NL3D::CPSTailDot.
Definition at line 846 of file ps_particle_basic.h.
References _Mat, and NL3D::CMaterial::getZBias().
| bool NL3D::CPSMaterial::isZTestEnabled | ( | ) | const |
===================================================================================
Definition at line 562 of file ps_particle_basic.cpp.
References _Mat, NL3D::CMaterial::always, NL3D::CMaterial::getZFunc(), and NL_PS_FUNC.
| void NL3D::CPSMaterial::serialMaterial | ( | NLMISC::IStream & | f | ) | throw (NLMISC::EStream) |
serialization (not named 'serial' because it will be used via multiple-inheritance)
===================================================================================
Definition at line 522 of file ps_particle_basic.cpp.
References NL_PS_FUNC.
Referenced by NL3D::CPSTailDot::serial(), and NL3D::CPSRibbon::serial().
| void NL3D::CPSMaterial::setBlendingMode | ( | CPSMaterial::TBlendingMode | mode | ) |
set the blending mode. The default is ass
===================================================================================
Definition at line 569 of file ps_particle_basic.cpp.
References _Mat, add, alphaBlend, alphaTest, NL3D::CMaterial::invsrcalpha, modulate, NL_PS_FUNC, NL3D::CMaterial::one, NL3D::CMaterial::setAlphaTest(), NL3D::CMaterial::setBlend(), NL3D::CMaterial::setBlendFunc(), NL3D::CMaterial::setZWrite(), NL3D::CMaterial::srcalpha, NL3D::CMaterial::srccolor, and NL3D::CMaterial::zero.
| void NL3D::CPSMaterial::setZBias | ( | float | value | ) | [inline] |
Reimplemented in NL3D::CPSDot, NL3D::CPSFanLight, NL3D::CPSQuad, NL3D::CPSRibbon, NL3D::CPSRibbonLookAt, NL3D::CPSShockWave, and NL3D::CPSTailDot.
Definition at line 845 of file ps_particle_basic.h.
References _Mat, and NL3D::CMaterial::setZBias().
CMaterial NL3D::CPSMaterial::_Mat [protected] |
Definition at line 851 of file ps_particle_basic.h.
Referenced by CPSMaterial(), NL3D::CPSRibbon::CPSRibbon(), NL3D::CPSTailDot::displayRibbons(), NL3D::CPSRibbonLookAt::displayRibbons(), NL3D::CPSRibbon::displayRibbons(), NL3D::CPSShockWave::draw(), NL3D::CPSDot::draw(), NL3D::CPSFaceHelper::drawFaces(), NL3D::CPSFanLightHelper::drawFanLight(), NL3D::CPSFaceLookAtHelper::drawLookAt(), NL3D::CPSFaceLookAtHelper::drawLookAtAlignOnMotion(), NL3D::CPSShockWaveHelper::drawShockWave(), enableZTest(), forceModulateConstantColor(), forceTexturedMaterialStages(), getBlendingMode(), getZBias(), NL3D::CPSShockWave::init(), NL3D::CPSQuad::init(), NL3D::CPSFanLight::init(), NL3D::CPSDot::init(), isZTestEnabled(), setBlendingMode(), NL3D::CPSTailDot::setupGlobalColor(), NL3D::CPSFanLight::setupMaterial(), NL3D::CPSRibbon::setupTexturedGlobalColor(), NL3D::CPSRibbon::setupTextureMatrix(), NL3D::CPSShockWave::setupUFactor(), NL3D::CPSRibbon::setupUntexturedGlobalColor(), setZBias(), NL3D::CPSTailDot::step(), NL3D::CPSRibbonLookAt::step(), NL3D::CPSRibbon::step(), NL3D::CPSRibbonLookAt::updateMatAndVbForColor(), NL3D::CPSShockWave::updateMatAndVbForTexture(), NL3D::CPSQuad::updateMatAndVbForTexture(), NL3D::CPSQuad::updateMatBeforeRendering(), NL3D::CPSTailDot::updateMaterial(), NL3D::CPSRibbon::updateTexturedMaterial(), and NL3D::CPSRibbon::updateUntexturedMaterial().
1.6.1