Ignore:
Timestamp:
12/07/08 23:26:00 (16 years ago)
Author:
mattausch
Message:

made ssao parameters more flexible
started to implement lense flare

File:
1 edited

Legend:

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

    r3203 r3212  
    147147float turbitity = 5.0f; 
    148148 
     149// ssao parameters 
     150float ssaoKernelRadius = 1e-8f; 
     151float ssaoSampleIntensity = 0.2f; 
     152float ssaoTempCohFactor = 255.0; 
     153bool sortSamples = true; 
     154 
    149155int shadowSize = 2048; 
     156 
    150157/// the hud font 
    151158glfont::GLFont myfont; 
    152159 
    153160// rendertexture 
    154 static int texWidth = 1024; 
    155 static int texHeight = 768; 
     161int texWidth = 1024; 
     162int texHeight = 768; 
    156163 
    157164int renderedObjects = 0; 
     
    211218 
    212219PerfTimer frameTimer, algTimer; 
    213 /// the performance window 
     220/// the performance graph window 
    214221PerformanceGraph *perfGraph = NULL; 
    215222 
    216 float ssaoTempCohFactor = 255.0; 
    217 bool sortSamples = true; 
    218223int sCurrentMrtSet = 0; 
    219224 
     
    384389                env.GetIntParam(string("renderMethod"), renderMethod); 
    385390 
     391                env.GetFloatParam(string("ssaoKernelRadius"), ssaoKernelRadius); 
     392                env.GetFloatParam(string("ssaoSampleIntensity"), ssaoSampleIntensity); 
     393 
    386394                //env.GetStringParam(string("modelPath"), model_path); 
    387395                //env.GetIntParam(string("numSssaoSamples"), numSsaoSamples); 
     396 
     397                texWidth = winWidth; 
     398                texHeight = winHeight; 
    388399 
    389400                cout << "assumedVisibleFrames: " << assumedVisibleFrames << endl;  
     
    398409                cout << "useLODs: " << useLODs << endl; 
    399410                cout << "camPosition: " << camPos << endl; 
    400                 cout << "temporal coherence: " << ssaoTempCohFactor << endl; 
    401411                cout << "shadow size: " << shadowSize << endl; 
    402412                cout << "render method: " << renderMethod << endl; 
     
    404414                cout << "use advanced shading: " << useAdvancedShading << endl; 
    405415                cout << "turbitity: " << turbitity << endl; 
     416                cout << "temporal coherence: " << ssaoTempCohFactor << endl; 
     417                cout << "sample intensity: " << ssaoSampleIntensity << endl; 
     418                cout << "kernel radius: " << ssaoKernelRadius << endl; 
    406419 
    407420                //cout << "model path: " << model_path << endl; 
     
    11511164                deferredShader->SetShadingMethod(shadingMethod); 
    11521165                deferredShader->SetSamplingMethod(samplingMethod); 
     1166                deferredShader->SetKernelRadius(ssaoKernelRadius); 
     1167                deferredShader->SetSampleIntensity(ssaoSampleIntensity); 
    11531168                deferredShader->SetUseTemporalCoherence(useTemporalCoherence); 
    11541169                deferredShader->SetSortSamples(sortSamples); 
     
    12031218        { 
    12041219        case 27: 
     1220                // write out current position on exit 
    12051221                Debug << "camPosition=" << camera->GetPosition().x << " " << camera->GetPosition().y << " " << camera->GetPosition().z << endl; 
    12061222                Debug << "camDirection=" << camera->GetDirection().x << " " << camera->GetDirection().y << " " << camera->GetDirection().z << endl; 
     
    12471263                break; 
    12481264        case '3': 
    1249                 if (trianglesPerVirtualLeaf >= 100) 
    1250                         trianglesPerVirtualLeaf -= 100; 
     1265                if (trianglesPerVirtualLeaf >= 100) trianglesPerVirtualLeaf -= 100; 
    12511266                bvh->SetVirtualLeaves(trianglesPerVirtualLeaf); 
    12521267                break; 
     
    12691284        case '8': 
    12701285                ssaoTempCohFactor *= 2.0f; 
    1271                 //if (ssaoTempCohFactor > 1.0f) ssaoExpFactor = 1.0f; 
     1286                break; 
     1287        case '9': 
     1288                ssaoKernelRadius *= 0.8f; 
     1289                break; 
     1290        case '0': 
     1291                ssaoKernelRadius *= 1.2f; 
     1292                break; 
     1293        case 'n': 
     1294                ssaoSampleIntensity *= 0.9f; 
     1295                break; 
     1296        case 'N': 
     1297                ssaoSampleIntensity *= 1.1f; 
    12721298                break; 
    12731299        case 'l': 
     
    13441370                useAntiAliasing = !useAntiAliasing; 
    13451371                break; 
    1346         case '9': 
     1372        /*case '?': 
    13471373                sortSamples = !sortSamples; 
    13481374                break; 
     1375        */ 
    13491376        default: 
    13501377                return; 
     
    20032030         
    20042031        preetham->RenderSkyDome(-light->GetDirection(), camera, &renderState, !useToneMapping); 
    2005         /// once again reset the renderState 
     2032 
     2033        /// once again reset the renderState just to make sure 
    20062034        renderState.Reset(); 
    20072035} 
Note: See TracChangeset for help on using the changeset viewer.