Changeset 877


Ignore:
Timestamp:
05/02/06 16:34:09 (18 years ago)
Author:
szirmay
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Illum/Envmap/EnvMap.cpp

    r843 r877  
    5858 
    5959        // central mesh 
    60         mesh = new Mesh(MESH1, TEX0, 0.8, D3DXVECTOR3(0,0,0)); 
     60        mesh = new Mesh(MESH1, TEX0, 1, D3DXVECTOR3(0,0,0)); 
    6161        bCubeMapIsValid = false; 
    6262        //ChooseMesh(whichMesh); 
     
    162162{ 
    163163        if (pp.Get( bAutoGenCubeMap ))          // calculate cube maps for each frame 
     164        { 
    164165                bCubeMapIsValid = false; 
    165  
    166         if ( !bShininessIsValid )        
    167         // refresh cos texture 
    168         { 
    169                 if ( pp.GetInt( iWhichMethod ) == DIFFUSE_SPECULAR ) 
    170                         PreConvolve(pCubeTextureSmall, pCubeTexturePreConvolved); 
    171                 else if ( pp.GetInt( iWhichMethod ) == DIFFUSE_SPECULAR_LOCALIZED_COSTEX ) 
    172                         GenerateCosTextureIfNotFound(); 
    173166        } 
    174167 
     
    188181                        RenderCubeMap( pCubeTexture ); 
    189182                        RenderCubeMap( pCubeTexture );  // don't ask why 
    190  
    191                         V( g_pEffect->SetFloat( "texel_size",  0 ) ); 
    192                         ReduceCubeMapSize(pCubeTexture, pCubeTextureSmall); 
    193                         PreConvolve(pCubeTextureSmall, pCubeTexturePreConvolved); 
    194183                } 
    195                 else 
     184 
     185                //V( g_pEffect->SetFloat( "texel_size",  0 ) ); 
     186 
     187                if ( pp.GetInt( iWhichMethod ) == DIFFUSE_SPECULAR  
     188                  || pp.GetInt( iWhichMethod ) == DIFFUSE_SPECULAR_LOCALIZED 
     189                  || pp.GetInt( iWhichMethod ) == DIFFUSE_SPECULAR_LOCALIZED_COSTEX ) 
    196190                { 
    197                         ReduceCubeMapSize(pCubeTextureFromFile, pCubeTextureSmall); 
    198                         PreConvolve(pCubeTextureSmall, pCubeTexturePreConvolved); 
     191                        ReduceCubeMapSize( pp.Get( bCubeMapFromFile ) ? pCubeTextureFromFile : pCubeTexture, 
     192                                pCubeTextureSmall); 
     193 
     194                        bShininessIsValid = false; 
    199195                } 
    200196 
     
    203199 
    204200                bCubeMapIsValid = true;  
     201        } 
     202 
     203        if ( !bShininessIsValid )        
     204        // refresh cos texture 
     205        { 
     206                if ( pp.GetInt( iWhichMethod ) == DIFFUSE_SPECULAR || pp.GetInt( iWhichMethod ) == DIFFUSE_SPECULAR_LOCALIZED ) 
     207                        PreConvolve(pCubeTextureSmall, pCubeTexturePreConvolved); 
     208                else if ( pp.GetInt( iWhichMethod ) == DIFFUSE_SPECULAR_LOCALIZED_COSTEX ) 
     209                        GenerateCosTextureIfNotFound(); 
     210 
     211                bShininessIsValid = true; 
    205212        } 
    206213 
Note: See TracChangeset for help on using the changeset viewer.