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/BL_Material.cpp | |
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/BL_Material.cpp')
-rw-r--r-- | source/gameengine/Ketsji/BL_Material.cpp | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/source/gameengine/Ketsji/BL_Material.cpp b/source/gameengine/Ketsji/BL_Material.cpp index 0954aa0f7ab..461a8c51a52 100644 --- a/source/gameengine/Ketsji/BL_Material.cpp +++ b/source/gameengine/Ketsji/BL_Material.cpp @@ -20,15 +20,6 @@ MTex* getImageFromMaterial(Material *mat, int index) return m?m:0; } -int getNumTexChannels( Material *mat ) -{ - int count = -1; - if (!mat) return -1; - - for (count =0; (count < 10) && mat->mtex[count] != 0; count++) {} - return count; -} - BL_Material::BL_Material() { Initialize(); @@ -36,7 +27,10 @@ BL_Material::BL_Material() void BL_Material::Initialize() { - m_mcol = 0xFFFFFFFFL; + rgb[0] = 0; + rgb[1] = 0; + rgb[2] = 0; + rgb[3] = 0; IdMode = 0; ras_mode = 0; glslmat = 0; @@ -64,7 +58,7 @@ void BL_Material::Initialize() int i; - for (i=0; i<MAXTEX; i++) // :( + for (i = 0; i < MAXTEX; i++) // :( { mapping[i].mapping = 0; mapping[i].offsets[0] = 0.f; @@ -90,15 +84,6 @@ void BL_Material::Initialize() } } -void BL_Material::SetUVLayerName(const STR_String& name) -{ - uvName = name; -} -void BL_Material::SetUVLayerName2(const STR_String& name) -{ - uv2Name = name; -} - void BL_Material::SetSharedMaterial(bool v) { if ((v && num_users == -1) || num_users > 1 ) |