Eidolon
Public Member Functions | Protected Attributes | Private Member Functions | Static Private Attributes | List of all members
OgreMaterial Class Reference

#include <OgreRenderTypes.h>

Inheritance diagram for OgreMaterial:
Inheritance graph
Collaboration diagram for OgreMaterial:
Collaboration graph

Public Member Functions

 OgreMaterial (Ogre::MaterialPtr mat, OgreRenderScene *scene)
 
virtual ~OgreMaterial ()
 
virtual Materialclone (const char *name) const
 Cloning must be done in the main thread. More...
 
virtual void copyTo (Material *m, bool copyTex=false, bool copySpec=false, bool copyProgs=false) const
 Copy this material's settings to `mat'. More...
 
virtual const char * getName () const
 
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 isCullBackfaces () const
 
virtual bool usesPointSprites () const
 
virtual const char * getTexture () const
 
virtual const char * getGPUProgram (ProgramType pt) const
 
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 usePointSprites (bool useSprites)
 
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 setTexture (const char *name)
 
virtual void useSpectrumTexture (bool use)
 
virtual void updateSpectrum ()
 
void commit ()
 commits the spectrum colors to the spectrum texture if used, called indirectly by updateSpectrum() More...
 
virtual void setGPUProgram (const std::string &name, ProgramType pt)
 
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)
 
- Public Member Functions inherited from Material
 Material ()
 
virtual ~Material ()
 
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 bool isClampTexAddress () 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 setTexture (const Texture *tex)
 
virtual void setGPUProgram (const GPUProgram *prog)
 
- Public Member Functions inherited from Spectrum
 Spectrum (const std::string &name="")
 
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)
 

Protected Attributes

OgreRenderScenescene
 The root scene which renders this object. More...
 
Ogre::MaterialPtr mat
 
Ogre::Pass * t0p0
 
Ogre::TextureUnitState * texunit
 
BlendMode bm
 
bool _useTexFiltering
 
bool _isClampTexAddress
 
std::string fragname
 
std::string geomname
 
std::string vertname
 
Ogre::TexturePtr spectex
 
Ogre::TextureUnitState * specunit
 
- Protected Attributes inherited from Spectrum
PositionQueue< colorspec
 
Vec3Curve alphacurve
 
std::string name
 

Private Member Functions

Ogre::HighLevelGpuProgramPtr getGPUProgByNumberedName (const std::string &name)
 
Ogre::GpuProgramParametersSharedPtr getGPUParameters (ProgramType pt)
 

Static Private Attributes

static const sval SPECWIDTH =100
 

Additional Inherited Members

- Public Attributes inherited from Material
float alpha
 
bool useAlpha
 

Constructor & Destructor Documentation

◆ OgreMaterial()

OgreMaterial ( Ogre::MaterialPtr  mat,
OgreRenderScene scene 
)
inline

◆ ~OgreMaterial()

~OgreMaterial ( )
virtual

Member Function Documentation

◆ clampTexAddress()

virtual void clampTexAddress ( bool  use)
inlinevirtual

Reimplemented from Material.

Here is the caller graph for this function:

◆ clone()

Material * clone ( const char *  name) const
virtual

Cloning must be done in the main thread.

Reimplemented from Material.

◆ commit()

void commit ( )

commits the spectrum colors to the spectrum texture if used, called indirectly by updateSpectrum()

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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 from Material.

Here is the call graph for this function:

◆ cullBackfaces()

virtual void cullBackfaces ( bool  cull)
inlinevirtual

Reimplemented from Material.

◆ getAmbient()

virtual color getAmbient ( ) const
inlinevirtual

Reimplemented from Material.

Here is the call graph for this function:

◆ getBlendMode()

virtual BlendMode getBlendMode ( ) const
inlinevirtual

Reimplemented from Material.

◆ getDiffuse()

virtual color getDiffuse ( ) const
inlinevirtual

Reimplemented from Material.

Here is the call graph for this function:

◆ getEmissive()

virtual color getEmissive ( ) const
inlinevirtual

Reimplemented from Material.

Here is the call graph for this function:

◆ getGPUParameters()

Ogre::GpuProgramParametersSharedPtr getGPUParameters ( ProgramType  pt)
inlineprivate

◆ getGPUProgByNumberedName()

Ogre::HighLevelGpuProgramPtr getGPUProgByNumberedName ( const std::string &  name)
inlineprivate

◆ getGPUProgram()

virtual const char* getGPUProgram ( ProgramType  pt) const
inlinevirtual

Reimplemented from Material.

◆ getName()

virtual const char* getName ( ) const
inlinevirtual

Reimplemented from Spectrum.

Here is the caller graph for this function:

◆ getPointSizeAbs()

virtual real getPointSizeAbs ( ) const
inlinevirtual

Reimplemented from Material.

◆ getPointSizeMax()

virtual real getPointSizeMax ( ) const
inlinevirtual

Reimplemented from Material.

◆ getPointSizeMin()

virtual real getPointSizeMin ( ) const
inlinevirtual

Reimplemented from Material.

◆ getShininess()

virtual real getShininess ( ) const
inlinevirtual

Reimplemented from Material.

◆ getSpecular()

virtual color getSpecular ( ) const
inlinevirtual

Reimplemented from Material.

Here is the call graph for this function:

◆ getTexture()

virtual const char* getTexture ( ) const
inlinevirtual

Reimplemented from Material.

Here is the caller graph for this function:

◆ isCullBackfaces()

virtual bool isCullBackfaces ( ) const
inlinevirtual

Reimplemented from Material.

◆ setAmbient()

virtual void setAmbient ( const color c)
inlinevirtual

Reimplemented from Material.

Here is the call graph for this function:

◆ setBlendMode()

virtual void setBlendMode ( BlendMode  bm)
inlinevirtual

Reimplemented from Material.

◆ 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 from Material.

Here is the call graph for this function:

◆ setEmissive()

virtual void setEmissive ( const color c)
inlinevirtual

Reimplemented from Material.

Here is the call graph for this function:

◆ setGPUParamColor()

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

Reimplemented from Material.

Here is the call graph for this function:

◆ setGPUParamInt()

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

Reimplemented from Material.

◆ setGPUParamReal()

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

Reimplemented from Material.

◆ setGPUParamVec3()

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

Reimplemented from Material.

Here is the call graph for this function:

◆ setGPUProgram()

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

Reimplemented from Material.

◆ 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 from Material.

◆ setPointSize()

virtual void setPointSize ( real  min,
real  max 
)
inlinevirtual

Set the minimum and maximum point size for attenuated points.

Reimplemented from Material.

◆ setPointSizeAbs()

virtual void setPointSizeAbs ( real  size)
inlinevirtual

Set the absolute point size.

Reimplemented from Material.

◆ setShininess()

virtual void setShininess ( real  c)
inlinevirtual

Set the amount of specular hightlighting to apply.

Reimplemented from Material.

◆ 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 from Material.

Here is the call graph for this function:

◆ setTexture()

void setTexture ( const char *  name)
virtual

Reimplemented from Material.

Here is the call graph for this function:

◆ updateSpectrum()

void updateSpectrum ( )
virtual

Reimplemented from Material.

◆ useDepthCheck()

virtual void useDepthCheck ( bool  use)
inlinevirtual

Reimplemented from Material.

◆ useDepthWrite()

virtual void useDepthWrite ( bool  use)
inlinevirtual

Reimplemented from Material.

◆ useFlatShading()

virtual void useFlatShading ( bool  use)
inlinevirtual

Reimplemented from Material.

◆ useLighting()

virtual void useLighting ( bool  use)
inlinevirtual

Reimplemented from Material.

◆ usePointSprites()

virtual void usePointSprites ( bool  useSprites)
inlinevirtual

Reimplemented from Material.

◆ usesDepthCheck()

virtual bool usesDepthCheck ( ) const
inlinevirtual

Reimplemented from Material.

◆ usesDepthWrite()

virtual bool usesDepthWrite ( ) const
inlinevirtual

Reimplemented from Material.

◆ usesFlatShading()

virtual bool usesFlatShading ( ) const
inlinevirtual

Reimplemented from Material.

◆ usesLighting()

virtual bool usesLighting ( ) const
inlinevirtual

Reimplemented from Material.

◆ useSpectrumTexture()

void useSpectrumTexture ( bool  use)
virtual

Reimplemented from Material.

Here is the call graph for this function:

◆ usesPointAttenuation()

virtual bool usesPointAttenuation ( ) const
inlinevirtual

Reimplemented from Material.

◆ usesPointSprites()

virtual bool usesPointSprites ( ) const
inlinevirtual

Reimplemented from Material.

◆ usesTexFiltering()

virtual bool usesTexFiltering ( ) const
inlinevirtual

Reimplemented from Material.

◆ usesVertexColor()

virtual bool usesVertexColor ( ) const
inlinevirtual

Reimplemented from Material.

◆ useTexFiltering()

virtual void useTexFiltering ( bool  use)
inlinevirtual

Reimplemented from Material.

Here is the caller graph for this function:

◆ useVertexColor()

virtual void useVertexColor ( bool  use)
inlinevirtual

Reimplemented from Material.

Member Data Documentation

◆ _isClampTexAddress

bool _isClampTexAddress
protected

◆ _useTexFiltering

bool _useTexFiltering
protected

◆ bm

BlendMode bm
protected

◆ fragname

std::string fragname
protected

◆ geomname

std::string geomname
protected

◆ mat

Ogre::MaterialPtr mat
protected

◆ scene

OgreRenderScene* scene
protected

The root scene which renders this object.

◆ spectex

Ogre::TexturePtr spectex
protected

◆ specunit

Ogre::TextureUnitState* specunit
protected

◆ SPECWIDTH

const sval SPECWIDTH =100
staticprivate

◆ t0p0

Ogre::Pass* t0p0
protected

◆ texunit

Ogre::TextureUnitState* texunit
protected

◆ vertname

std::string vertname
protected

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