- Timestamp:
- 05/02/06 16:34:09 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Illum/Envmap/EnvMap.cpp
r843 r877 58 58 59 59 // 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)); 61 61 bCubeMapIsValid = false; 62 62 //ChooseMesh(whichMesh); … … 162 162 { 163 163 if (pp.Get( bAutoGenCubeMap )) // calculate cube maps for each frame 164 { 164 165 bCubeMapIsValid = false; 165 166 if ( !bShininessIsValid )167 // refresh cos texture168 {169 if ( pp.GetInt( iWhichMethod ) == DIFFUSE_SPECULAR )170 PreConvolve(pCubeTextureSmall, pCubeTexturePreConvolved);171 else if ( pp.GetInt( iWhichMethod ) == DIFFUSE_SPECULAR_LOCALIZED_COSTEX )172 GenerateCosTextureIfNotFound();173 166 } 174 167 … … 188 181 RenderCubeMap( pCubeTexture ); 189 182 RenderCubeMap( pCubeTexture ); // don't ask why 190 191 V( g_pEffect->SetFloat( "texel_size", 0 ) );192 ReduceCubeMapSize(pCubeTexture, pCubeTextureSmall);193 PreConvolve(pCubeTextureSmall, pCubeTexturePreConvolved);194 183 } 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 ) 196 190 { 197 ReduceCubeMapSize(pCubeTextureFromFile, pCubeTextureSmall); 198 PreConvolve(pCubeTextureSmall, pCubeTexturePreConvolved); 191 ReduceCubeMapSize( pp.Get( bCubeMapFromFile ) ? pCubeTextureFromFile : pCubeTexture, 192 pCubeTextureSmall); 193 194 bShininessIsValid = false; 199 195 } 200 196 … … 203 199 204 200 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; 205 212 } 206 213
Note: See TracChangeset
for help on using the changeset viewer.