Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2008-09-14 04:32:18 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2008-09-14 04:32:18 +0400
commit704fef314a6a4ed17ad93cb32f1821c337ddb7d5 (patch)
tree2eb7219c466acd0c77ae21d9231543ba1508d8b3 /source/gameengine/Rasterizer/RAS_BucketManager.cpp
parent06be41648ffe7be565fe5a1e117e3611384c667f (diff)
Various game engine fixes:
* Fix issue with add transparency mode with blender materials. * Possible fix at frontface flip in the game engine. * Fix color buffering clearing for multiple viewports, it used to clear as if there was one. * Fix for zoom level in user defined viewports, it was based on the full window before, now it is based on the viewport itself. * For user defined viewports, always use Expose instead of Letterbox with bars, the latter doesn't make sense then.
Diffstat (limited to 'source/gameengine/Rasterizer/RAS_BucketManager.cpp')
-rw-r--r--source/gameengine/Rasterizer/RAS_BucketManager.cpp21
1 files changed, 6 insertions, 15 deletions
diff --git a/source/gameengine/Rasterizer/RAS_BucketManager.cpp b/source/gameengine/Rasterizer/RAS_BucketManager.cpp
index 9fb21a3c17b..f7938bb62e6 100644
--- a/source/gameengine/Rasterizer/RAS_BucketManager.cpp
+++ b/source/gameengine/Rasterizer/RAS_BucketManager.cpp
@@ -130,9 +130,6 @@ void RAS_BucketManager::OrderBuckets(const MT_Transform& cameratrans, BucketList
sort(slots.begin(), slots.end(), fronttoback());
}
-//static int TOTASLOT = 0;
-//static int TOTSLOT = 0;
-
void RAS_BucketManager::RenderAlphaBuckets(
const MT_Transform& cameratrans, RAS_IRasterizer* rasty, RAS_IRenderTools* rendertools)
{
@@ -149,10 +146,8 @@ void RAS_BucketManager::RenderAlphaBuckets(
for(sit=slots.begin(); sit!=slots.end(); ++sit) {
rendertools->SetClientObject(rasty, sit->m_ms->m_clientObj);
- while(sit->m_bucket->ActivateMaterial(cameratrans, rasty, rendertools)) {
+ while(sit->m_bucket->ActivateMaterial(cameratrans, rasty, rendertools))
sit->m_bucket->RenderMeshSlot(cameratrans, rasty, rendertools, *(sit->m_ms));
- //TOTASLOT++;
- }
}
rasty->SetDepthMask(RAS_IRasterizer::KX_DEPTHMASK_ENABLED);
@@ -173,13 +168,14 @@ void RAS_BucketManager::RenderSolidBuckets(
rendertools->SetClientObject(rasty, mit->m_clientObj);
- while ((*bit)->ActivateMaterial(cameratrans, rasty, rendertools)) {
+ while ((*bit)->ActivateMaterial(cameratrans, rasty, rendertools))
(*bit)->RenderMeshSlot(cameratrans, rasty, rendertools, *mit);
- //TOTSLOT++;
- }
}
}
+ /* this code draws meshes order front-to-back instead to reduce overdraw.
+ * it turned out slower due to much material state switching, a more clever
+ * algorithm might do better. */
#if 0
vector<sortedmeshslot> slots;
vector<sortedmeshslot>::iterator sit;
@@ -198,17 +194,12 @@ void RAS_BucketManager::RenderSolidBuckets(
void RAS_BucketManager::Renderbuckets(
const MT_Transform& cameratrans, RAS_IRasterizer* rasty, RAS_IRenderTools* rendertools)
{
- // beginning each frame, clear (texture/material) caching information
+ /* beginning each frame, clear (texture/material) caching information */
rasty->ClearCachingInfo();
- //TOTASLOT = 0;
- //TOTSLOT = 0;
-
RenderSolidBuckets(cameratrans, rasty, rendertools);
RenderAlphaBuckets(cameratrans, rasty, rendertools);
- //printf("total slots = %d = %d + %d\n", TOTSLOT + TOTASLOT, TOTSLOT, TOTASLOT);
-
rendertools->SetClientObject(rasty, NULL);
}