- Timestamp:
- 10/19/08 01:33:16 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/RenderQueue.cpp
r2848 r3042 51 51 bool RenderQueue::FitsInBucket(Shape *shape, size_t idx) const 52 52 { 53 Material *mat = shape->GetMaterial();53 Technique *tech = shape->GetMaterial()->GetDefaultTechnique(); 54 54 55 55 // test if entity belongs to this bucket 56 56 // note: rather slows down the application for some reason!! 57 if ( mat->IsAlphaTestEnabled() != mBuckets[idx]->mAlphaTestEnabled)57 if (tech->IsAlphaTestEnabled() != mBuckets[idx]->mAlphaTestEnabled) 58 58 return false; 59 59 60 if ( mat->IsCullFaceEnabled() != mBuckets[idx]->mCullFaceEnabled)60 if (tech->IsCullFaceEnabled() != mBuckets[idx]->mCullFaceEnabled) 61 61 return false; 62 62 63 const bool hasTexture = ( mat->GetTexture() != NULL);63 const bool hasTexture = (tech->GetTexture() != NULL); 64 64 65 65 if (hasTexture != mBuckets[idx]->mHasTexture) … … 68 68 if (hasTexture) 69 69 { 70 if ( mat->GetTexture()->GetWidth() != mBuckets[idx]->mTexWidth)70 if (tech->GetTexture()->GetWidth() != mBuckets[idx]->mTexWidth) 71 71 return false; 72 72 73 if ( mat->GetTexture()->GetHeight() != mBuckets[idx]->mTexHeight)73 if (tech->GetTexture()->GetHeight() != mBuckets[idx]->mTexHeight) 74 74 return false; 75 75 } … … 119 119 bucket->mMinDistance = -1; 120 120 121 Material *mat = shape->GetMaterial();122 123 bucket->mAlphaTestEnabled = mat->IsAlphaTestEnabled();124 bucket->mCullFaceEnabled = mat->IsCullFaceEnabled();125 126 const bool hasTexture = ( mat->GetTexture() != NULL);121 Technique *tech = shape->GetMaterial()->GetDefaultTechnique(); 122 123 bucket->mAlphaTestEnabled = tech->IsAlphaTestEnabled(); 124 bucket->mCullFaceEnabled = tech->IsCullFaceEnabled(); 125 126 const bool hasTexture = (tech->GetTexture() != NULL); 127 127 128 128 bucket->mHasTexture = hasTexture; 129 129 130 bucket->mTexWidth = hasTexture ? mat->GetTexture()->GetWidth() : 0;131 bucket->mTexHeight = hasTexture ? mat->GetTexture()->GetHeight() : 0;130 bucket->mTexWidth = hasTexture ? tech->GetTexture()->GetWidth() : 0; 131 bucket->mTexHeight = hasTexture ? tech->GetTexture()->GetHeight() : 0; 132 132 133 133 mBuckets.push_back(bucket); … … 204 204 Shape *shape = *sit; 205 205 206 Material *mat = shape->GetMaterial();207 int tsize = mat->GetTexture() ? mat->GetTexture()->GetByteSize() : 0;206 Technique *tech = shape->GetMaterial()->GetDefaultTechnique(); 207 int tsize = tech->GetTexture() ? tech->GetTexture()->GetByteSize() : 0; 208 208 209 209 float dist = SqrMagnitude(shape->GetBoundingBox().Center() - mCamera->GetPosition()); 210 210 211 Debug << "e: " << shape << " a: " << mat->IsAlphaTestEnabled() << " s: " << tsize << " d: " << dist << " " << endl;211 Debug << "e: " << shape << " a: " << tech->IsAlphaTestEnabled() << " s: " << tsize << " d: " << dist << " " << endl; 212 212 } 213 213 }
Note: See TracChangeset
for help on using the changeset viewer.