Ignore:
Timestamp:
01/02/09 17:29:48 (15 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

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

    r3235 r3242  
    302302mSavedFrameNumber(-1), 
    303303mSavedFrameSuffix(""), 
    304 mMaxDistance(1e6f) 
     304mMaxDistance(1e6f), 
     305mTempCohFactor(.0f), 
     306mUseToneMapping(false), 
     307mUseAntiAliasing(false), 
     308mUseDepthOfField(false) 
    305309{ 
    306310        /////////// 
     
    537541 
    538542void DeferredRenderer::Render(FrameBufferObject *fbo,  
    539                                                           float tempCohFactor, 
    540543                                                          DirectionalLight *light, 
    541                                                           bool useToneMapping, 
    542                                                           bool useAntiAliasing, 
    543544                                                          ShadowMap *shadowMap 
    544545                                                          ) 
     
    562563        { 
    563564        case SSAO: 
    564                 ComputeSsao(fbo, tempCohFactor); 
     565                ComputeSsao(fbo, mTempCohFactor); 
    565566                CombineSsao(fbo); 
    566567                break; 
    567568        case GI: 
    568                 ComputeGlobIllum(fbo, tempCohFactor); 
     569                ComputeGlobIllum(fbo, mTempCohFactor); 
    569570                CombineIllum(fbo); 
    570571                break; 
     
    574575        } 
    575576 
    576         /// do depth of field 
    577         DepthOfField(fbo); 
    578  
    579         if (useToneMapping) 
     577        /// depth of field 
     578        if (mUseDepthOfField) 
     579        { 
     580                DepthOfField(fbo); 
     581        } 
     582 
     583        if (mUseToneMapping) 
    580584        { 
    581585                float imageKey, whiteLum, middleGrey; 
     
    593597        // multisampling is difficult / costly with deferred shading 
    594598        // at least do some edge blurring  
    595         if (useAntiAliasing) AntiAliasing(fbo, light, displayAfterAA);  
     599        if (mUseAntiAliasing) AntiAliasing(fbo, light, displayAfterAA);  
    596600         
    597601        /// store the current frame 
     
    599603 
    600604        // if it hasn't been done yet => just output the latest buffer 
    601         if (!useAntiAliasing || !displayAfterAA) 
     605        if (!mUseAntiAliasing || !displayAfterAA) 
    602606                Output(fbo);  
    603607 
     
    12661270                                                                  ) 
    12671271{ 
    1268         // light source not visible 
     1272        // light source visible? 
    12691273        if (!mSunVisiblePixels) return; 
    12701274 
     
    14371441 
    14381442 
    1439 void DeferredRenderer::SetSortSamples(bool sortSamples)  
     1443/*void DeferredRenderer::SetSortSamples(bool sortSamples)  
    14401444{ 
    14411445        mSortSamples = sortSamples;  
    1442 } 
     1446}*/ 
    14431447 
    14441448 
     
    14521456{ 
    14531457        mMaxDistance = maxDist; 
     1458} 
     1459 
     1460 
     1461void DeferredRenderer::SetUseToneMapping(bool toneMapping) 
     1462{ 
     1463        mUseToneMapping = toneMapping; 
     1464} 
     1465         
     1466 
     1467void DeferredRenderer::SetUseAntiAliasing(bool antiAliasing) 
     1468{ 
     1469        mUseAntiAliasing = antiAliasing; 
     1470} 
     1471 
     1472 
     1473void DeferredRenderer::SetUseDepthOfField(bool dof) 
     1474{ 
     1475        mUseDepthOfField = dof; 
     1476} 
     1477 
     1478 
     1479void DeferredRenderer::SetTemporalCoherenceFactorForSsao(float factor) 
     1480{ 
     1481        mTempCohFactor = factor; 
    14541482} 
    14551483 
Note: See TracChangeset for help on using the changeset viewer.