Changeset 3331 for GTP


Ignore:
Timestamp:
03/05/09 16:06:46 (15 years ago)
Author:
mattausch
Message:

performance testing

Location:
GTP/trunk/App/Demos/Vis/FriendlyCulling
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/default.env

    r3305 r3331  
    1313#filename=mypompeii 
    1414#bvhname=mypompeii 
    15 #filename=pompeii/pompeii_full 
     15filename=pompeii/pompeii_full 
    1616#filename=pompeii/pompeii_part 
    17 filename=city 
    18 bvhname=city 
     17#filename=city 
     18#bvhname=city 
    1919useLODs=1 
    2020# shadow map size 
     
    7777camPosition=483.398f 242.364f 186.078f 
    7878# pompeii view point 
    79 #camPosition=1300.0f -2500.0f 10.0f 
     79camPosition=1300.0f -2500.0f 10.0f 
    8080# pompeii problematic 
    8181#camPosition=627.003 -1725.33 25.2 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp

    r3327 r3331  
    662662        if (mShadingMethod != 0) 
    663663        { 
    664                 PrepareSsao(fbo); // downsample fbo buffers 
     664                //PrepareSsao(fbo); // downsample fbo buffers 
    665665        } 
    666666 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SceneEntity.cpp

    r3268 r3331  
    9595 
    9696        if (!mLODLevels.empty()) 
     97        { 
    9798                GetCurrentLODLevel(sit, sit_end); 
     99        } 
    98100        else 
    99101        { 
     
    104106 
    105107        for (; sit != sit_end; ++ sit) 
     108        { 
    106109                (*sit)->Render(state, this); 
     110        } 
    107111 
    108112        mTransform->Unload(state); 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaderenv.h

    r3329 r3331  
    66//-- ssao + gi parameters 
    77#define NUM_PRECOMPUTED_SAMPLES 4096 
    8 //#define NUM_SAMPLES 8 
     8 
     9#define NUM_SAMPLES 8 
    910//#define NUM_SAMPLES 16 
    1011//#define NUM_SAMPLES 24 
    11 #define NUM_SAMPLES 24 
     12//#define NUM_SAMPLES 24 
    1213 
    1314//#define MIN_SAMPLES 48 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg

    r3330 r3331  
    182182                         float3 normal, 
    183183                         float3 centerPosition, 
    184                          float scaleFactor, 
     184                         float radius, 
    185185                         float3 bl, 
    186186                         float3 br, 
     
    223223                 
    224224                // weight with projected coordinate to reach similar kernel size for near and far 
    225                 const float2 texcoord = IN.texCoord.xy + offset * scaleFactor; 
     225                const float2 texcoord = IN.texCoord.xy + offset * radius; 
    226226 
    227227                const float4 sampleColor = tex2Dlod(colors, float4(texcoord, .0f, .0f)); 
     
    235235 
    236236                const float minDist = 1e-6f; 
    237                 const float scaleFactor = 1e-3f; 
     237                const float delta = 1e-3f; 
    238238 
    239239                const float lengthToSample = length(dirSample); 
    240                 const float sampleWeight = 1.0f / (lengthToSample + scaleFactor); 
     240                const float sampleWeight = 1.0f / (lengthToSample + delta); 
    241241 
    242242                dirSample /= max(lengthToSample, minDist); // normalize 
     
    329329                        float3 normal, 
    330330                        float3 centerPosition, 
    331                         float scaleFactor, 
     331                        float radius, 
    332332                        float3 bl, 
    333333                        float3 br, 
     
    370370 
    371371                // weight with projected coordinate to reach similar kernel size for near and far 
    372                 const float2 texcoord = IN.texCoord.xy + offset * scaleFactor; 
     372                const float2 texcoord = IN.texCoord.xy + offset * radius; 
    373373 
    374374                const float4 sampleColor = tex2Dlod(colors, float4(texcoord, .0f, .0f)); 
     
    382382 
    383383                const float minDist = 1e-6f; 
    384                 const float scaleFactor = 1e-3f; 
     384                const float delta = 1e-3f; 
    385385 
    386386                const float lengthToSample = length(dirSample); 
    387                 const float sampleWeight = 1.0f / (lengthToSample + scaleFactor); 
     387                const float sampleWeight = 1.0f / (lengthToSample + delta); 
    388388 
    389389                dirSample /= max(length(dirSample), minDist); // normalize 
     
    399399 
    400400                ++ numSamples; 
    401  
     401#ifdef PERFORMANCE_TEST 
    402402                // check if the samples have been valid in the last frame 
    403403                // only mark sample as invalid if in the last / current frame 
     
    411411                // or if the angle is small enough 
    412412                // to have any influence in the current or last frame 
     413 
    413414#if 1 
    414415                const float partlyResetThres = 1.0f; 
     
    435436                } 
    436437#endif 
     438 
     439#endif // PERFORMANCE_TEST 
     440 
    437441        } 
    438442 
     
    488492        const float4 eyeSpacePos = float4(-viewDir * eyeSpaceDepth, 1.0f); 
    489493 
    490         float3 diffVec = tex2Dlod(attribsTex, float4(IN.texCoord, 0, 0)).xyz; 
    491          
    492  
    493494        //////////////// 
    494495        //-- calculcate the current projected posiion (also used for next frame) 
     
    497498        const float invw = 1.0f / projPos.w; 
    498499        projPos *= invw; 
    499         float scaleFactor = kernelRadius * invw; 
     500         
     501        //const float radiusMult = kernelRadius; 
     502        const float radiusMult = 3e-2; 
     503        //const float radiusMult = kernelRadius * invw; 
     504         
     505#ifdef PERFORMANCE_TEST  
     506 
     507        float3 diffVec = tex2Dlod(attribsTex, float4(IN.texCoord, 0, 0)).xyz; 
    500508 
    501509        const float sqrMoveSpeed = SqrLen(diffVec); 
     
    514522                                                                        diffVec 
    515523                                                                        ); 
    516  
     524         
    517525        const float oldSsao = temporalVals.x; 
    518526         
     
    520528        float oldIdx = temporalCoherence > 1 ? temporalVals.z : 0; 
    521529         
     530#else 
     531 
     532        const bool isMovingObject = false; 
     533        const float oldSsao = 0; 
     534         
     535        float oldWeight = 0; 
     536        float oldIdx = 0; 
     537         
     538#endif 
     539 
    522540        float3 ao; 
    523541 
     
    528546                { 
    529547                        ao = ssao(IN, colors, noiseTex, samples, normal, eyeSpacePos.xyz,  
    530                                       scaleFactor, bl, br, tl, tr, normalize(viewDir), 
     548                                      radiusMult, bl, br, tl, tr, normalize(viewDir), 
    531549                                          oldWeight, sampleIntensity, isMovingObject, oldIdx); 
    532550                } 
    533551                else 
    534552                { 
    535                         ao = ssao2(IN, colors, noiseTex, samples, normal, eyeSpacePos.xyz, scaleFactor,  
     553                        ao = ssao2(IN, colors, noiseTex, samples, normal, eyeSpacePos.xyz, radiusMult,  
    536554                                   bl, br, tl, tr, normalize(viewDir), oldWeight, sampleIntensity,  
    537555                                           isMovingObject, normals, oldIdx); 
     
    543561        } 
    544562 
    545          
     563#ifdef PERFORMANCE_TEST 
     564 
    546565        /////////// 
    547566        //-- check if we have to reset pixel because one of the sample points was invalid 
     
    592611        //OUT.illum_col.z = SqrLen(diffVec); 
    593612 
     613#else 
     614 
     615        OUT.illum_col.x = ao.x; 
     616        OUT.illum_col.w = eyeSpaceDepth; 
     617         
     618#endif 
     619 
    594620        return OUT; 
    595621} 
Note: See TracChangeset for help on using the changeset viewer.