diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2012-12-19 00:56:25 +0400 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2012-12-19 00:56:25 +0400 |
commit | ef0473994b6b21aa49bbfab26a483d90d0fef004 (patch) | |
tree | 18d9dd7d2fbe6eddaf58f66b6b301c694cb43a50 /source/gameengine/Ketsji/KX_BlenderMaterial.h | |
parent | 6b2af22d37dc1a039104f2ca0b3b4b56aca7d41c (diff) |
BGE: Some as of yet unmerged work I did in the Swiss branch. These changes include:
* Cleaning up the conversion code to avoid a per-face material conversion. Materials are now stored in buckets and only converted if a new material is found. This replaces some of Campbell's earlier work on the subject. His work wasn't as thorough, but it was much safer for a release.
* Shaders are only compiled for LibLoaded materials once. Before they could be compiled twice, which could really slow things down.
* Refactoring the rasterizer code to use a strategy design pattern to handle different geometry rendering methods such as immediate mode, vertex arrays and vertex buffer objects. VBOs are added, but they will be disabled in a following commit since they are still slower than vertex arrays with display lists. However, VBOs are still useful for mobile, so it's good to keep them around.
* Better multi-uv support. The BGE should now be able to handle more than two UV layers, which should help it better match the viewport.
Diffstat (limited to 'source/gameengine/Ketsji/KX_BlenderMaterial.h')
-rw-r--r-- | source/gameengine/Ketsji/KX_BlenderMaterial.h | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.h b/source/gameengine/Ketsji/KX_BlenderMaterial.h index 7bc9c7c3863..c34a49e1bde 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.h +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.h @@ -39,7 +39,8 @@ public: void Initialize( class KX_Scene* scene, BL_Material* mat, - GameSettings* game + GameSettings* game, + int lightlayer ); virtual ~KX_BlenderMaterial(); @@ -76,8 +77,6 @@ public: TCachingInfo& cachingInfo )const; - /* mMaterial is private, but need this for conversion */ - bool IsMaterial(const BL_Material *bl_mat) const; Material* GetBlenderMaterial() const; MTFace* GetMTFace(void) const; unsigned int* GetMCol(void) const; @@ -97,14 +96,7 @@ public: MT_Scalar ref, MT_Scalar emit, MT_Scalar alpha ); - virtual void Replace_IScene(SCA_IScene *val) - { - mScene= static_cast<KX_Scene *>(val); - if (mBlenderShader) - { - mBlenderShader->SetScene(mScene); - } - }; + virtual void Replace_IScene(SCA_IScene *val); #ifdef WITH_PYTHON // -------------------------------- @@ -125,7 +117,7 @@ public: // -------------------------------- // pre calculate to avoid pops/lag at startup - virtual void OnConstruction(int layer); + virtual void OnConstruction(); static void EndFrame(); @@ -139,10 +131,11 @@ private: unsigned int mBlendFunc[2]; bool mModified; bool mConstructed; // if false, don't clean on exit + int mLightLayer; void InitTextures(); - void SetBlenderGLSLShader(int layer); + void SetBlenderGLSLShader(); void ActivatGLMaterials( RAS_IRasterizer* rasty )const; void ActivateTexGen( RAS_IRasterizer *ras ) const; |