NL3D::CPSMaterial Class Reference

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.

List of all members.

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

Detailed Description

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.


Member Enumeration Documentation

this enum summarize the useful modes for blending to the framebuffer

Enumerator:
add 
modulate 
alphaBlend 
alphaTest 

Definition at line 813 of file ps_particle_basic.h.


Constructor & Destructor Documentation

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().


Member Function Documentation

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.

Parameters:
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.

===================================================================================

  • If a texture was present for a given stage it still is
  • If a texture wasn't present, it create a dummy white texture there
  • Above numStages, textures are disabled. It can be used to do extra math with stages that have no textures (required by the driver)

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
float NL3D::CPSMaterial::getZBias ( void   )  const [inline]
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  ) 
void NL3D::CPSMaterial::setZBias ( float  value  )  [inline]

Member Data Documentation


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

Generated on Thu Jan 7 08:30:09 2010 for NeL by  doxygen 1.6.1