Blender V2.61 - r43446
|
#include <KX_BlenderMaterial.h>
Public Member Functions | |
KX_BlenderMaterial () | |
void | Initialize (class KX_Scene *scene, BL_Material *mat, GameSettings *game) |
virtual | ~KX_BlenderMaterial () |
virtual TCachingInfo | GetCachingInfo (void) const |
virtual bool | Activate (RAS_IRasterizer *rasty, TCachingInfo &cachingInfo) const |
virtual void | ActivateMeshSlot (const RAS_MeshSlot &ms, RAS_IRasterizer *rasty) const |
void | ActivateMat (RAS_IRasterizer *rasty, TCachingInfo &cachingInfo) const |
void | ActivatShaders (RAS_IRasterizer *rasty, TCachingInfo &cachingInfo) const |
void | ActivateBlenderShaders (RAS_IRasterizer *rasty, TCachingInfo &cachingInfo) const |
Material * | GetBlenderMaterial () const |
MTFace * | GetMTFace (void) const |
unsigned int * | GetMCol (void) const |
BL_Texture * | getTex (unsigned int idx) |
Image * | getImage (unsigned int idx) |
unsigned int * | getBlendFunc () |
void | UpdateIPO (MT_Vector4 rgba, MT_Vector3 specrgb, MT_Scalar hard, MT_Scalar spec, MT_Scalar ref, MT_Scalar emit, MT_Scalar alpha) |
virtual void | Replace_IScene (SCA_IScene *val) |
virtual void | OnConstruction (int layer) |
Static Public Member Functions | |
static void | EndFrame () |
Definition at line 33 of file KX_BlenderMaterial.h.
KX_BlenderMaterial::KX_BlenderMaterial | ( | ) |
Definition at line 46 of file KX_BlenderMaterial.cpp.
KX_BlenderMaterial::~KX_BlenderMaterial | ( | ) | [virtual] |
Definition at line 110 of file KX_BlenderMaterial.cpp.
bool KX_BlenderMaterial::Activate | ( | RAS_IRasterizer * | rasty, |
TCachingInfo & | cachingInfo | ||
) | const [virtual] |
Activates the material in the rasterizer. On entry, the cachingInfo contains info about the last activated material. On exit, the cachingInfo should contain updated info about this material.
rasty | The rasterizer in which the material should be active. |
cachingInfo | The information about the material used to speed up rasterizing. |
Reimplemented from RAS_IPolyMaterial.
Definition at line 518 of file KX_BlenderMaterial.cpp.
References ActivateBlenderShaders(), ActivateMat(), ActivatShaders(), BL_Shader::getNumPass(), NULL, BL_BlenderShader::Ok(), BL_Shader::Ok(), and BL_Shader::SetProg().
void KX_BlenderMaterial::ActivateBlenderShaders | ( | RAS_IRasterizer * | rasty, |
TCachingInfo & | cachingInfo | ||
) | const |
Definition at line 424 of file KX_BlenderMaterial.cpp.
References GetCachingInfo(), RAS_IRasterizer::GetDrawingMode(), RAS_IRasterizer::KX_TEXTURED, RAS_IRasterizer::KX_WIREFRAME, NULL, BL_Material::ras_mode, BL_BlenderShader::SetAttribs(), RAS_IRasterizer::SetCullFace(), RAS_IRasterizer::SetLines(), BL_Shader::SetProg(), TWOSIDED, and WIRE.
Referenced by Activate().
void KX_BlenderMaterial::ActivateMat | ( | RAS_IRasterizer * | rasty, |
TCachingInfo & | cachingInfo | ||
) | const |
Definition at line 467 of file KX_BlenderMaterial.cpp.
References GetCachingInfo(), RAS_IRasterizer::GetDrawingMode(), RAS_IRasterizer::KX_TEXTURED, RAS_IRasterizer::KX_WIREFRAME, NULL, BL_Material::ras_mode, RAS_IRasterizer::SetCullFace(), RAS_IRasterizer::SetLines(), BL_BlenderShader::SetProg(), BL_Shader::SetProg(), TWOSIDED, and WIRE.
Referenced by Activate().
void KX_BlenderMaterial::ActivateMeshSlot | ( | const RAS_MeshSlot & | ms, |
RAS_IRasterizer * | rasty | ||
) | const [virtual] |
Definition at line 572 of file KX_BlenderMaterial.cpp.
References BL_Material::alphablend, ELEM3, GEMAT_ALPHA, GEMAT_ALPHA_SORT, GEMAT_SOLID, BL_BlenderShader::GetAlphaBlend(), RAS_IRasterizer::SetAlphaBlend(), BL_Shader::Update(), and BL_BlenderShader::Update().
void KX_BlenderMaterial::ActivatShaders | ( | RAS_IRasterizer * | rasty, |
TCachingInfo & | cachingInfo | ||
) | const |
Definition at line 374 of file KX_BlenderMaterial.cpp.
References GetCachingInfo(), RAS_IRasterizer::GetDrawingMode(), BL_Material::IsShared(), RAS_IRasterizer::KX_TEXTURED, RAS_IRasterizer::KX_WIREFRAME, NULL, BL_Material::ras_mode, RAS_IRasterizer::SetCullFace(), RAS_IRasterizer::SetLines(), BL_BlenderShader::SetProg(), TWOSIDED, and WIRE.
Referenced by Activate().
void KX_BlenderMaterial::EndFrame | ( | ) | [static] |
Definition at line 194 of file KX_BlenderMaterial.cpp.
References NULL, BL_BlenderShader::SetProg(), and BL_Shader::SetProg().
Referenced by KX_Scene::RenderBuckets().
Material * KX_BlenderMaterial::GetBlenderMaterial | ( | ) | const [virtual] |
Reimplemented from RAS_IPolyMaterial.
Definition at line 142 of file KX_BlenderMaterial.cpp.
References BL_Material::material.
Referenced by KX_BlenderSceneConverter::FreeBlendFile().
unsigned int* KX_BlenderMaterial::getBlendFunc | ( | ) | [inline] |
Definition at line 88 of file KX_BlenderMaterial.h.
virtual TCachingInfo KX_BlenderMaterial::GetCachingInfo | ( | void | ) | const [inline, virtual] |
Returns the caching information for this material, This can be used to speed up the rasterizing process.
Reimplemented from RAS_IPolyMaterial.
Definition at line 48 of file KX_BlenderMaterial.h.
Referenced by ActivateBlenderShaders(), ActivateMat(), and ActivatShaders().
Image* KX_BlenderMaterial::getImage | ( | unsigned int | idx | ) | [inline] |
Definition at line 85 of file KX_BlenderMaterial.h.
References BL_Material::img, MAXTEX, and NULL.
unsigned int * KX_BlenderMaterial::GetMCol | ( | void | ) | const |
Definition at line 125 of file KX_BlenderMaterial.cpp.
References BL_Material::rgb.
Referenced by KX_BlenderRenderTools::RenderText(), and GPC_RenderTools::RenderText().
MTFace * KX_BlenderMaterial::GetMTFace | ( | void | ) | const |
Definition at line 118 of file KX_BlenderMaterial.cpp.
References MT_assert, and BL_Material::tface.
Referenced by KX_BlenderRenderTools::RenderText(), and GPC_RenderTools::RenderText().
BL_Texture* KX_BlenderMaterial::getTex | ( | unsigned int | idx | ) | [inline] |
Definition at line 82 of file KX_BlenderMaterial.h.
void KX_BlenderMaterial::Initialize | ( | class KX_Scene * | scene, |
BL_Material * | mat, | ||
GameSettings * | game | ||
) |
Definition at line 60 of file KX_BlenderMaterial.cpp.
References ALPHA, BL_Material::alphablend, BL_Material::blend_mode, CAST_SHADOW, data, BL_Material::flag, BL_Texture::GetMaxUnits(), BL_Material::glslmat, i, BL_Material::IdMode, RAS_IPolyMaterial::m_flag, RAS_IPolyMaterial::m_multimode, BL_Material::materialindex, BL_Material::matname, max, BL_Material::num_enabled, ONETEX, RAS_BLENDERGLSL, RAS_BLENDERMAT, RAS_CASTSHADOW, BL_Material::ras_mode, RAS_MULTILIGHT, RAS_MULTITEX, TEX, BL_Material::texname, BL_Material::tile, BL_Material::tilexrep, BL_Material::tileyrep, USE_LIGHT, and ZSORT.
Referenced by BL_ConvertMesh().
void KX_BlenderMaterial::OnConstruction | ( | int | layer | ) | [virtual] |
Reimplemented from RAS_IPolyMaterial.
Definition at line 158 of file KX_BlenderMaterial.cpp.
References BL_Material::cubemap, BL_Material::flag, BL_Material::glslmat, i, BL_Material::img, BL_Mapping::mapping, BL_Material::mapping, BL_Material::matname, MIPMAP, BL_Material::num_enabled, spit, and USEENV.
virtual void KX_BlenderMaterial::Replace_IScene | ( | SCA_IScene * | val | ) | [inline, virtual] |
Reimplemented from RAS_IPolyMaterial.
Definition at line 98 of file KX_BlenderMaterial.h.
References BL_BlenderShader::SetScene(), and simple_enum_gen::val.
void KX_BlenderMaterial::UpdateIPO | ( | MT_Vector4 | rgba, |
MT_Vector3 | specrgb, | ||
MT_Scalar | hard, | ||
MT_Scalar | spec, | ||
MT_Scalar | ref, | ||
MT_Scalar | emit, | ||
MT_Scalar | alpha | ||
) |
Definition at line 757 of file KX_BlenderMaterial.cpp.
References BL_Material::alpha, BL_Material::emit, BL_Material::hard, BL_Material::matcolor, BL_Material::ref, BL_Material::spec_f, and BL_Material::speccolor.
Referenced by KX_GameObject::UpdateMaterialData().