Eidolon
Public Member Functions | Public Attributes | List of all members
Material Class Reference

#include <RenderTypes.h>

Inheritance diagram for Material:
Inheritance graph
Collaboration diagram for Material:
Collaboration graph

Public Member Functions

 Material ()
 
virtual ~Material ()
 
virtual Materialclone (const char *name) const
 Make a copy of this material with the given name. More...
 
virtual void copyTo (Material *mat, bool copyTex=false, bool copySpec=false, bool copyProgs=false) const
 Copy this material's settings to `mat'. More...
 
virtual real getAlpha () const
 Get the alpha (transparency) value, 1.0 is opaque and 0.0 is invisible, -1.0 if alpha shouldn't be used. More...
 
virtual color getDefaultColor () const
 
virtual void setAlpha (real alpha)
 Set the internal alpha value, resetting the diffuse and specular values expected a subtype to set the alpha components for these. More...
 
virtual bool usesInternalAlpha () const
 Returns true if the internal alpha value is to be applied to colors, otherwise the alpha components of colors are used as inputed. More...
 
virtual void useInternalAlpha (bool val)
 Set whether to use the internal alpha value or use those specified in the diffuse and specular color values. More...
 
virtual color getAmbient () const
 
virtual color getDiffuse () const
 
virtual color getSpecular () const
 
virtual color getEmissive () const
 
virtual real getShininess () const
 
virtual real getPointSizeMin () const
 
virtual real getPointSizeMax () const
 
virtual real getPointSizeAbs () const
 
virtual bool usesPointAttenuation () const
 
virtual BlendMode getBlendMode () const
 
virtual bool usesVertexColor () const
 
virtual bool usesLighting () const
 
virtual bool usesFlatShading () const
 
virtual bool usesDepthCheck () const
 
virtual bool usesDepthWrite () const
 
virtual bool usesTexFiltering () const
 
virtual bool isClampTexAddress () const
 
virtual bool isCullBackfaces () const
 
virtual bool usesPointSprites () const
 
virtual const char * getTexture () const
 
virtual const char * getGPUProgram (ProgramType pt) const
 
virtual int getGPUParamInt (ProgramType pt, const std::string &name)
 
virtual real getGPUParamReal (ProgramType pt, const std::string &name)
 
virtual vec3 getGPUParamVec3 (ProgramType pt, const std::string &name)
 
virtual color getGPUParamColor (ProgramType pt, const std::string &name)
 
virtual bool isTransparentColor () const
 Returns true if the intenal alpha value is used, if it's <1.0, if vertex colors are not used, and if no textur is assigned. More...
 
virtual void setAmbient (const color &c)
 
virtual void setDiffuse (const color &c)
 Sets the diffuse color, if usesInternalAlpha() returns true the alpha value will be set the internal value. More...
 
virtual void setSpecular (const color &c)
 Sets the specular color, if usesInternalAlpha() returns true the alpha value will be set the internal value. More...
 
virtual void setEmissive (const color &c)
 
virtual void setShininess (real c)
 Set the amount of specular hightlighting to apply. More...
 
virtual void setPointSize (real min, real max)
 Set the minimum and maximum point size for attenuated points. More...
 
virtual void setPointSizeAbs (real size)
 Set the absolute point size. More...
 
virtual void setPointAttenuation (bool enabled, real constant=0.0f, real linear=1.0f, real quad=0.0f)
 Sets point attenuation, the given real values are constants the attenuation equation. More...
 
virtual void setBlendMode (BlendMode bm)
 
virtual void useVertexColor (bool use)
 
virtual void useLighting (bool use)
 
virtual void useFlatShading (bool use)
 
virtual void useDepthCheck (bool use)
 
virtual void useDepthWrite (bool use)
 
virtual void useTexFiltering (bool use)
 
virtual void clampTexAddress (bool use)
 
virtual void cullBackfaces (bool cull)
 
virtual void usePointSprites (bool useSprites)
 
virtual void setTexture (const char *name)
 
virtual void setTexture (const Texture *tex)
 
virtual void useSpectrumTexture (bool use)
 
virtual void setGPUProgram (const std::string &name, ProgramType pt)
 
virtual void setGPUProgram (const GPUProgram *prog)
 
virtual bool setGPUParamInt (ProgramType pt, const std::string &name, int val)
 
virtual bool setGPUParamReal (ProgramType pt, const std::string &name, real val)
 
virtual bool setGPUParamVec3 (ProgramType pt, const std::string &name, vec3 val)
 
virtual bool setGPUParamColor (ProgramType pt, const std::string &name, color val)
 
virtual void updateSpectrum ()
 
- Public Member Functions inherited from Spectrum
 Spectrum (const std::string &name="")
 
virtual const char * getName () const
 
virtual void clearSpectrum ()
 
virtual void copySpectrumFrom (const Spectrum *s)
 
virtual void addSpectrumValue (real pos, color value)
 Add a color value to the spectrum at the given position then resort the spectrum. More...
 
virtual real getSpectrumPos (indexval index) const throw (IndexException)
 Get the position of the spectrum value at the given index in the list. More...
 
virtual color getSpectrumValue (indexval index) const throw (IndexException)
 Get the color of the spectrum value at the given index in the list. More...
 
virtual indexval getSpectrumIndex (real pos, color value) const
 Get the index of the spectrum value with the given position and color, returns numSpectrumValues() if not found. More...
 
virtual void setSpectrumValue (sval index, real pos, color value) throw (IndexException)
 Set the spectrum value at the given list index. More...
 
virtual sval numSpectrumValues () const
 Get the number of spectrum values. More...
 
virtual void removeSpectrumValue (indexval index) throw (IndexException)
 Remove the spectrum value at the given index. More...
 
virtual sval numAlphaCtrls () const
 
virtual vec3 getAlphaCtrl (indexval index) const throw (IndexException)
 
virtual void addAlphaCtrl (vec3 v)
 
virtual void removeAlphaCtrl (indexval index) throw (IndexException)
 
virtual void setAlphaCtrl (vec3 v, indexval index) throw (IndexException)
 
virtual void setAlphaCurve (const Vec3Matrix *pts)
 
virtual void setLinearAlpha (bool b)
 
virtual bool isLinearAlpha () const
 
virtual color interpolateColor (real pos) const
 
virtual void fillColorMatrix (ColorMatrix *col, const RealMatrix *mat, bool useValAsAlpha=false) throw (IndexException)
 

Public Attributes

float alpha
 
bool useAlpha
 

Additional Inherited Members

- Protected Attributes inherited from Spectrum
PositionQueue< colorspec
 
Vec3Curve alphacurve
 
std::string name
 

Detailed Description

Materials encapsulate the lighting and color properties applied to renderable objects. This covers diffuse, specular, ambient, and emissive light, point size for point objects, blending mode, and options on using vertex color, scene lighting, alpha blending, and others. It also stores a spectrum of colors defined as color values positioned along the unit interval. Spectrums are used to interpolate a color form a given unit value, this used for data coloration where field values are converted into these unit values.

Constructor & Destructor Documentation

◆ Material()

Material ( )
inline

◆ ~Material()

virtual ~Material ( )
inlinevirtual

Member Function Documentation

◆ clampTexAddress()

virtual void clampTexAddress ( bool  use)
inlinevirtual

Reimplemented in OgreMaterial.

Here is the caller graph for this function:

◆ clone()

virtual Material* clone ( const char *  name) const
inlinevirtual

Make a copy of this material with the given name.

Reimplemented in OgreMaterial.

◆ copyTo()

virtual void copyTo ( Material mat,
bool  copyTex = false,
bool  copySpec = false,
bool  copyProgs = false 
) const
inlinevirtual

Copy this material's settings to `mat'.

Reimplemented in OgreMaterial.

◆ cullBackfaces()

virtual void cullBackfaces ( bool  cull)
inlinevirtual

Reimplemented in OgreMaterial.

Here is the caller graph for this function:

◆ getAlpha()

virtual real getAlpha ( ) const
inlinevirtual

Get the alpha (transparency) value, 1.0 is opaque and 0.0 is invisible, -1.0 if alpha shouldn't be used.

Reimplemented from Spectrum.

◆ getAmbient()

virtual color getAmbient ( ) const
inlinevirtual

Reimplemented in OgreMaterial.

◆ getBlendMode()

virtual BlendMode getBlendMode ( ) const
inlinevirtual

Reimplemented in OgreMaterial.

◆ getDefaultColor()

virtual color getDefaultColor ( ) const
inlinevirtual

Reimplemented from Spectrum.

◆ getDiffuse()

virtual color getDiffuse ( ) const
inlinevirtual

Reimplemented in OgreMaterial.

◆ getEmissive()

virtual color getEmissive ( ) const
inlinevirtual

Reimplemented in OgreMaterial.

◆ getGPUParamColor()

virtual color getGPUParamColor ( ProgramType  pt,
const std::string &  name 
)
inlinevirtual

◆ getGPUParamInt()

virtual int getGPUParamInt ( ProgramType  pt,
const std::string &  name 
)
inlinevirtual

◆ getGPUParamReal()

virtual real getGPUParamReal ( ProgramType  pt,
const std::string &  name 
)
inlinevirtual

◆ getGPUParamVec3()

virtual vec3 getGPUParamVec3 ( ProgramType  pt,
const std::string &  name 
)
inlinevirtual

◆ getGPUProgram()

virtual const char* getGPUProgram ( ProgramType  pt) const
inlinevirtual

Reimplemented in OgreMaterial.

◆ getPointSizeAbs()

virtual real getPointSizeAbs ( ) const
inlinevirtual

Reimplemented in OgreMaterial.

◆ getPointSizeMax()

virtual real getPointSizeMax ( ) const
inlinevirtual

Reimplemented in OgreMaterial.

◆ getPointSizeMin()

virtual real getPointSizeMin ( ) const
inlinevirtual

Reimplemented in OgreMaterial.

◆ getShininess()

virtual real getShininess ( ) const
inlinevirtual

Reimplemented in OgreMaterial.

◆ getSpecular()

virtual color getSpecular ( ) const
inlinevirtual

Reimplemented in OgreMaterial.

◆ getTexture()

virtual const char* getTexture ( ) const
inlinevirtual

Reimplemented in OgreMaterial.

Here is the caller graph for this function:

◆ isClampTexAddress()

virtual bool isClampTexAddress ( ) const
inlinevirtual

◆ isCullBackfaces()

virtual bool isCullBackfaces ( ) const
inlinevirtual

Reimplemented in OgreMaterial.

◆ isTransparentColor()

virtual bool isTransparentColor ( ) const
inlinevirtual

Returns true if the intenal alpha value is used, if it's <1.0, if vertex colors are not used, and if no textur is assigned.

◆ setAlpha()

virtual void setAlpha ( real  alpha)
inlinevirtual

Set the internal alpha value, resetting the diffuse and specular values expected a subtype to set the alpha components for these.

Here is the caller graph for this function:

◆ setAmbient()

virtual void setAmbient ( const color c)
inlinevirtual

Reimplemented in OgreMaterial.

Here is the caller graph for this function:

◆ setBlendMode()

virtual void setBlendMode ( BlendMode  bm)
inlinevirtual

Reimplemented in OgreMaterial.

Here is the caller graph for this function:

◆ setDiffuse()

virtual void setDiffuse ( const color c)
inlinevirtual

Sets the diffuse color, if usesInternalAlpha() returns true the alpha value will be set the internal value.

Reimplemented in OgreMaterial.

Here is the caller graph for this function:

◆ setEmissive()

virtual void setEmissive ( const color c)
inlinevirtual

Reimplemented in OgreMaterial.

Here is the caller graph for this function:

◆ setGPUParamColor()

virtual bool setGPUParamColor ( ProgramType  pt,
const std::string &  name,
color  val 
)
inlinevirtual

Reimplemented in OgreMaterial.

◆ setGPUParamInt()

virtual bool setGPUParamInt ( ProgramType  pt,
const std::string &  name,
int  val 
)
inlinevirtual

Reimplemented in OgreMaterial.

◆ setGPUParamReal()

virtual bool setGPUParamReal ( ProgramType  pt,
const std::string &  name,
real  val 
)
inlinevirtual

Reimplemented in OgreMaterial.

◆ setGPUParamVec3()

virtual bool setGPUParamVec3 ( ProgramType  pt,
const std::string &  name,
vec3  val 
)
inlinevirtual

Reimplemented in OgreMaterial.

◆ setGPUProgram() [1/2]

virtual void setGPUProgram ( const std::string &  name,
ProgramType  pt 
)
inlinevirtual

Reimplemented in OgreMaterial.

Here is the caller graph for this function:

◆ setGPUProgram() [2/2]

virtual void setGPUProgram ( const GPUProgram prog)
inlinevirtual
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setPointAttenuation()

virtual void setPointAttenuation ( bool  enabled,
real  constant = 0.0f,
real  linear = 1.0f,
real  quad = 0.0f 
)
inlinevirtual

Sets point attenuation, the given real values are constants the attenuation equation.

Reimplemented in OgreMaterial.

Here is the caller graph for this function:

◆ setPointSize()

virtual void setPointSize ( real  min,
real  max 
)
inlinevirtual

Set the minimum and maximum point size for attenuated points.

Reimplemented in OgreMaterial.

Here is the caller graph for this function:

◆ setPointSizeAbs()

virtual void setPointSizeAbs ( real  size)
inlinevirtual

Set the absolute point size.

Reimplemented in OgreMaterial.

Here is the caller graph for this function:

◆ setShininess()

virtual void setShininess ( real  c)
inlinevirtual

Set the amount of specular hightlighting to apply.

Reimplemented in OgreMaterial.

Here is the caller graph for this function:

◆ setSpecular()

virtual void setSpecular ( const color c)
inlinevirtual

Sets the specular color, if usesInternalAlpha() returns true the alpha value will be set the internal value.

Reimplemented in OgreMaterial.

Here is the caller graph for this function:

◆ setTexture() [1/2]

virtual void setTexture ( const char *  name)
inlinevirtual

Reimplemented in OgreMaterial.

Here is the caller graph for this function:

◆ setTexture() [2/2]

virtual void setTexture ( const Texture tex)
inlinevirtual
Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateSpectrum()

virtual void updateSpectrum ( )
inlinevirtual

Reimplemented from Spectrum.

Reimplemented in OgreMaterial.

◆ useDepthCheck()

virtual void useDepthCheck ( bool  use)
inlinevirtual

Reimplemented in OgreMaterial.

Here is the caller graph for this function:

◆ useDepthWrite()

virtual void useDepthWrite ( bool  use)
inlinevirtual

Reimplemented in OgreMaterial.

Here is the caller graph for this function:

◆ useFlatShading()

virtual void useFlatShading ( bool  use)
inlinevirtual

Reimplemented in OgreMaterial.

Here is the caller graph for this function:

◆ useInternalAlpha()

virtual void useInternalAlpha ( bool  val)
inlinevirtual

Set whether to use the internal alpha value or use those specified in the diffuse and specular color values.

Here is the caller graph for this function:

◆ useLighting()

virtual void useLighting ( bool  use)
inlinevirtual

Reimplemented in OgreMaterial.

Here is the caller graph for this function:

◆ usePointSprites()

virtual void usePointSprites ( bool  useSprites)
inlinevirtual

Reimplemented in OgreMaterial.

Here is the caller graph for this function:

◆ usesDepthCheck()

virtual bool usesDepthCheck ( ) const
inlinevirtual

Reimplemented in OgreMaterial.

◆ usesDepthWrite()

virtual bool usesDepthWrite ( ) const
inlinevirtual

Reimplemented in OgreMaterial.

◆ usesFlatShading()

virtual bool usesFlatShading ( ) const
inlinevirtual

Reimplemented in OgreMaterial.

◆ usesInternalAlpha()

virtual bool usesInternalAlpha ( ) const
inlinevirtual

Returns true if the internal alpha value is to be applied to colors, otherwise the alpha components of colors are used as inputed.

◆ usesLighting()

virtual bool usesLighting ( ) const
inlinevirtual

Reimplemented in OgreMaterial.

◆ useSpectrumTexture()

virtual void useSpectrumTexture ( bool  use)
inlinevirtual

Reimplemented in OgreMaterial.

◆ usesPointAttenuation()

virtual bool usesPointAttenuation ( ) const
inlinevirtual

Reimplemented in OgreMaterial.

◆ usesPointSprites()

virtual bool usesPointSprites ( ) const
inlinevirtual

Reimplemented in OgreMaterial.

◆ usesTexFiltering()

virtual bool usesTexFiltering ( ) const
inlinevirtual

Reimplemented in OgreMaterial.

◆ usesVertexColor()

virtual bool usesVertexColor ( ) const
inlinevirtual

Reimplemented in OgreMaterial.

◆ useTexFiltering()

virtual void useTexFiltering ( bool  use)
inlinevirtual

Reimplemented in OgreMaterial.

Here is the caller graph for this function:

◆ useVertexColor()

virtual void useVertexColor ( bool  use)
inlinevirtual

Reimplemented in OgreMaterial.

Here is the caller graph for this function:

Member Data Documentation

◆ alpha

float alpha

◆ useAlpha

bool useAlpha

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