Ignore:
Timestamp:
10/19/08 01:33:16 (16 years ago)
Author:
mattausch
Message:

added technique

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/RenderQueue.cpp

    r2848 r3042  
    5151bool RenderQueue::FitsInBucket(Shape *shape, size_t idx) const 
    5252{ 
    53         Material *mat = shape->GetMaterial(); 
     53        Technique *tech = shape->GetMaterial()->GetDefaultTechnique(); 
    5454 
    5555        // test if entity belongs to this bucket 
    5656        // note: rather slows down the application for some reason!! 
    57         if (mat->IsAlphaTestEnabled() != mBuckets[idx]->mAlphaTestEnabled) 
     57        if (tech->IsAlphaTestEnabled() != mBuckets[idx]->mAlphaTestEnabled) 
    5858                return false; 
    5959 
    60         if (mat->IsCullFaceEnabled() != mBuckets[idx]->mCullFaceEnabled) 
     60        if (tech->IsCullFaceEnabled() != mBuckets[idx]->mCullFaceEnabled) 
    6161                return false; 
    6262 
    63         const bool hasTexture = (mat->GetTexture() != NULL); 
     63        const bool hasTexture = (tech->GetTexture() != NULL); 
    6464 
    6565        if (hasTexture != mBuckets[idx]->mHasTexture) 
     
    6868        if (hasTexture) 
    6969        { 
    70                 if (mat->GetTexture()->GetWidth() != mBuckets[idx]->mTexWidth) 
     70                if (tech->GetTexture()->GetWidth() != mBuckets[idx]->mTexWidth) 
    7171                        return false; 
    7272 
    73                 if (mat->GetTexture()->GetHeight() != mBuckets[idx]->mTexHeight) 
     73                if (tech->GetTexture()->GetHeight() != mBuckets[idx]->mTexHeight) 
    7474                        return false; 
    7575        } 
     
    119119                        bucket->mMinDistance = -1; 
    120120 
    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); 
    127127 
    128128                        bucket->mHasTexture = hasTexture;  
    129129 
    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; 
    132132 
    133133                        mBuckets.push_back(bucket); 
     
    204204                        Shape *shape = *sit; 
    205205                         
    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; 
    208208                         
    209209                        float dist = SqrMagnitude(shape->GetBoundingBox().Center() - mCamera->GetPosition()); 
    210210                         
    211                         Debug << "e: " << shape << " a: " << mat->IsAlphaTestEnabled() << " s: " << tsize << " d: " << dist << " " << endl; 
     211                        Debug << "e: " << shape << " a: " << tech->IsAlphaTestEnabled() << " s: " << tsize << " d: " << dist << " " << endl; 
    212212                } 
    213213        } 
Note: See TracChangeset for help on using the changeset viewer.