Ignore:
Timestamp:
10/20/08 23:37:48 (16 years ago)
Author:
mattausch
Message:

included new material properties (vp, fp) into render queue

Location:
GTP/trunk/App/Demos/Vis/FriendlyCulling/src
Files:
3 edited

Legend:

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

    r3042 r3051  
    5555        // test if entity belongs to this bucket 
    5656        // note: rather slows down the application for some reason!! 
    57         if (tech->IsAlphaTestEnabled() != mBuckets[idx]->mAlphaTestEnabled) 
    58                 return false; 
    59  
    60         if (tech->IsCullFaceEnabled() != mBuckets[idx]->mCullFaceEnabled) 
    61                 return false; 
     57        if (tech->IsAlphaTestEnabled() != mBuckets[idx]->mAlphaTestEnabled) return false; 
     58        if (tech->IsCullFaceEnabled() != mBuckets[idx]->mCullFaceEnabled) return false; 
     59        if (tech->IsColorWriteEnabled() != mBuckets[idx]->mColorWriteEnabled) return false; 
     60        if (tech->IsLightingEnabled() != mBuckets[idx]->mLightingEnabled) return false; 
     61        if (tech->IsDepthWriteEnabled() != mBuckets[idx]->mDepthWriteEnabled) return false; 
    6262 
    6363        const bool hasTexture = (tech->GetTexture() != NULL); 
     
    6868        if (hasTexture) 
    6969        { 
    70                 if (tech->GetTexture()->GetWidth() != mBuckets[idx]->mTexWidth) 
    71                         return false; 
    72  
    73                 if (tech->GetTexture()->GetHeight() != mBuckets[idx]->mTexHeight) 
    74                         return false; 
    75         } 
     70                if (tech->GetTexture()->GetWidth() != mBuckets[idx]->mTexWidth) return false; 
     71                if (tech->GetTexture()->GetHeight() != mBuckets[idx]->mTexHeight) return false; 
     72                if (tech->GetTexture()->GetFormat() != mBuckets[idx]->mTexFormat) return false; 
     73        } 
     74 
     75        if ((tech->GetFragmentProgram() != NULL) && mBuckets[idx]->mHasFragmentProgram) return false; 
     76        if ((tech->GetVertexProgram() != NULL) && mBuckets[idx]->mHasVertexProgram) return false; 
     77 
    7678 
    7779        return true; 
     
    124126                        bucket->mCullFaceEnabled = tech->IsCullFaceEnabled(); 
    125127 
    126                         const bool hasTexture = (tech->GetTexture() != NULL); 
    127  
    128                         bucket->mHasTexture = hasTexture;  
    129  
    130                         bucket->mTexWidth = hasTexture ? tech->GetTexture()->GetWidth() : 0; 
    131                         bucket->mTexHeight = hasTexture ? tech->GetTexture()->GetHeight() : 0; 
     128                        bucket->mColorWriteEnabled = tech->IsColorWriteEnabled(); 
     129                        bucket->mLightingEnabled = tech->IsLightingEnabled(); 
     130                        bucket->mDepthWriteEnabled = tech->IsDepthWriteEnabled(); 
     131 
     132 
     133                        Texture *tex = tech->GetTexture(); 
     134 
     135                        if (tex != NULL) 
     136                        { 
     137                                bucket->mHasTexture = true;  
     138 
     139                                bucket->mTexWidth = tex->GetWidth(); 
     140                                bucket->mTexHeight = tex->GetHeight(); 
     141 
     142                                bucket->mTexFormat = tex->GetFormat();  
     143                        } 
     144                        else 
     145                        { 
     146                                bucket->mHasTexture = false;  
     147 
     148                                bucket->mTexWidth = 0; 
     149                                bucket->mTexHeight = 0; 
     150                                bucket->mTexFormat = 0; 
     151                        } 
     152 
     153                        bucket->mHasVertexProgram = tech->GetVertexProgram() != NULL; 
     154                        bucket->mHasFragmentProgram = tech->GetFragmentProgram() != NULL; 
    132155 
    133156                        mBuckets.push_back(bucket); 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/RenderQueue.h

    r2848 r3051  
    1717struct RenderQueueBucket 
    1818{ 
    19         /** should test for all texture format parameters,  
    20             but we as use the same format for all textures they differ only in size 
    21         */ 
     19        //////// 
     20        //-- the attributes used to sort the materials 
     21        /// texture parameters 
    2222        int mTexHeight; 
    2323        int mTexWidth; 
     24        int mTexFormat; 
    2425 
    2526        bool mHasTexture; 
     27 
     28        bool mColorWriteEnabled; 
     29        bool mDepthWriteEnabled; 
     30        bool mLightingEnabled; 
     31 
    2632        bool mAlphaTestEnabled; 
    2733        bool mCullFaceEnabled; 
     34 
     35        bool mHasVertexProgram; 
     36        bool mHasFragmentProgram; 
    2837 
    2938        /// minimal distance to the camera 
    3039        float mMinDistance; 
    3140 
     41        /// the shapes that belong to a bucket 
    3242        ShapeContainer mShapes; 
    3343}; 
     
    3646/** This class implements a render queue that sorts renderable geometry in order 
    3747        to minimize state changes while approximately keeping front-to-back order 
    38         The implementation roughly follows the suggested implemenation on Tom Forsyth's article 
    39         on render state changes. It requires sorting only on bucket level and therefore has very 
    40         low overhead 
     48        The implementation roughly follows the suggested implementation in  
     49        Tom Forsyth's article on render state changes. It requires sorting only on  
     50        bucket level and therefore has very     low overhead. 
    4151*/ 
    4252class RenderQueue 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp

    r3050 r3051  
    10121012        // this would conveniently solves some issues (e.g, skys without shadows) 
    10131013 
    1014         //RenderSky(); 
     1014        RenderSky(); 
    10151015 
    10161016 
Note: See TracChangeset for help on using the changeset viewer.