#include <OMKEntityMaterialAction.h>
Inheritance diagram for OMK::Vis::MaterialSetShader:
Public Member Functions | |
MaterialSetShader (const std::string &fragment, const std::string &vertex, Ogre::GpuProgramParameters *fragmentPrm, Ogre::GpuProgramParameters *vertexPrm, bool light, const std::string &texture="null") | |
The contructor stores the arguments. | |
virtual | ~MaterialSetShader () |
Destructor. | |
Private Member Functions | |
virtual void | subEntityAction (SubEntityMaterial *subEntity) const |
The action calls the appropriate function with the arguments. | |
Private Attributes | |
Arguments | |
std::string | _fragment |
std::string | _vertex |
Ogre::GpuProgramParameters * | _fragmentPrm |
Ogre::GpuProgramParameters * | _vertexPrm |
bool | _light |
std::string | _texture |
Allow user to add fragment and shader on a new Pass
Definition at line 149 of file OMKEntityMaterialAction.h.
OMK::Vis::MaterialSetShader::MaterialSetShader | ( | const std::string & | fragment, | |
const std::string & | vertex, | |||
Ogre::GpuProgramParameters * | fragmentPrm, | |||
Ogre::GpuProgramParameters * | vertexPrm, | |||
bool | light, | |||
const std::string & | texture = "null" | |||
) | [inline] |
The contructor stores the arguments.
Definition at line 153 of file OMKEntityMaterialAction.h.
00159 : _fragment( fragment ), 00160 _vertex( vertex ), 00161 _fragmentPrm( fragmentPrm ), 00162 _vertexPrm( vertexPrm ), 00163 _light( light ), 00164 _texture( texture ) 00165 {}
virtual OMK::Vis::MaterialSetShader::~MaterialSetShader | ( | ) | [inline, virtual] |
void MaterialSetShader::subEntityAction | ( | SubEntityMaterial * | subEntity | ) | const [private, virtual] |
The action calls the appropriate function with the arguments.
Reimplemented from OMK::Vis::IMaterialAction.
Definition at line 127 of file OMKEntityMaterialAction.cpp.
References _fragment, _fragmentPrm, _light, _texture, _vertex, _vertexPrm, OMK::Vis::IMaterialAction::getFirstPassOfFirstTechnique(), and OMTRACEID.
00128 { 00129 Pass * pass = getFirstPassOfFirstTechnique( subEntity ) ; 00130 00131 pass->setLightingEnabled( _light ); 00132 00133 if ( "null" != _texture ) 00134 { 00135 pass->createTextureUnitState( _texture ); 00136 //TextureUnitState *texState = pass->createTextureUnitState( texture ) ; 00137 //texState->setTextureScroll( 0.f, 0.f ) ; 00138 //texState->setColourOperation( Ogre::LBO_MODULATE ) ; 00139 00140 //texState->setTextureAddressingMode(TextureUnitState::TAM_CLAMP); 00141 } 00142 if ( "null" != _fragment) 00143 { //fragment Program 00144 pass->setFragmentProgram( _fragment ); 00145 //copy params passed 00146 Ogre::GpuProgramParametersSharedPtr fragmentParams = pass->getFragmentProgramParameters() ; 00147 fragmentParams->copyConstantsFrom( *_fragmentPrm ) ; 00148 } 00149 if ( "null" != _vertex) 00150 { //vertex Program 00151 pass->setVertexProgram( _vertex ); 00152 //copy params passed 00153 Ogre::GpuProgramParametersSharedPtr vertexParams = pass->getVertexProgramParameters() ; 00154 vertexParams->copyConstantsFrom( *_vertexPrm ) ; 00155 } 00156 pass->_load() ; 00157 00158 OMTRACEID( "DEBUG_MAT", "Shader OK " 00159 << " fragment " << _fragment 00160 << " vertex " << _vertex ); 00161 }
std::string OMK::Vis::MaterialSetShader::_fragment [private] |
std::string OMK::Vis::MaterialSetShader::_vertex [private] |
Ogre::GpuProgramParameters* OMK::Vis::MaterialSetShader::_fragmentPrm [private] |
Ogre::GpuProgramParameters* OMK::Vis::MaterialSetShader::_vertexPrm [private] |
bool OMK::Vis::MaterialSetShader::_light [private] |
std::string OMK::Vis::MaterialSetShader::_texture [private] |
Documentation generated on Mon Jun 9 11:46:05 2008 |
Generated with doxygen by Dimitri van Heesch , 1997-2007 |