Changeset 3364 for GTP


Ignore:
Timestamp:
04/29/09 14:05:01 (15 years ago)
Author:
mattausch
Message:

debug version visualizing the depth diff

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

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/MainApp.vcproj

    r3361 r3364  
    156156                                IgnoreAllDefaultLibraries="false" 
    157157                                IgnoreDefaultLibraryNames="LIBCMT" 
    158                                 GenerateDebugInformation="true" 
     158                                GenerateDebugInformation="false" 
    159159                                SubSystem="1" 
    160160                                LargeAddressAware="2" 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ResourceManager.cpp

    r3359 r3364  
    234234        for (int i = 0; i < numShapes; ++ i) 
    235235        { 
     236                if (i && (i % 1000 == 0)) cout << "loaded " << i << " shapes" << endl; 
     237 
    236238                Geometry *geom = LoadGeometry(str); 
    237239                Material *mat = LoadMaterial(str); 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/combineSsaoSep.cg

    r3363 r3364  
    235235        pixel OUT; 
    236236 
    237         float4 col = tex2Dlod(colorsTex, float4(IN.texCoord, 0, 0)); 
    238         float4 ao = tex2Dlod(ssaoTex, float4(IN.texCoord, 0, 0)); 
     237        float4 col = tex2Dlod(colorsTex, float4(IN.texCoord, .0f, .0f)); 
     238        float4 ao = tex2Dlod(ssaoTex, float4(IN.texCoord, .0f, .0f)); 
    239239 
    240240        const float depth = col.w; 
     
    252252        { 
    253253                // the filtered ssao value 
    254                 ao.x = FilterXY(IN.texCoord, ssaoTex, colorsTex, bl, br, tl, tr, xyStep, convergence, maxConvergence, spatialWeight); 
     254                ao.x = FilterXY(IN.texCoord, ssaoTex, colorsTex,  
     255                                     bl, br, tl, tr,  
     256                                                 xyStep, convergence, maxConvergence, spatialWeight); 
    255257        } 
    256258 
     
    274276        //OUT.illum_col.xyz = float3(ao.z * 1e-3f); 
    275277        //OUT.illum_col.xyz = float3(ao.y * 1e-3f); 
     278        OUT.illum_col.xyz = float3(ao.y); 
    276279        //OUT.illum_col.xyz = ao.xyz; 
    277280 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg

    r3362 r3364  
    3939        float4 outColor; 
    4040 
     41#if 0 
    4142        // hack: prevent to shade the sky 
    42 #if 0 
    4343        if (color.w > DEPTH_THRESHOLD) 
    4444        { 
     
    4747        else  
    4848        { 
    49                 if (useAO > 0.5f) 
     49                if (useAO > .5f) 
    5050                        outColor = (ambient * ao + diffuse) * color; 
    5151                else 
     
    250250 
    251251        // compute position from old frame for dynamic objects + translational portion 
    252         const float3 translatedPos = difVec - oldEyePos + worldPos.xyz; 
     252        const float3 translatedPos = -oldEyePos + worldPos.xyz + difVec; 
    253253        // don't use difVec here: want to detect if the actual pixel has changed => ssao changed 
    254254        //const float3 translatedPos = -oldEyePos + worldPos.xyz; 
     
    293293        // means that we only use slight temporal coherence over some frames 
    294294        // so that there is no noticeable drag 
    295         const float pixelCouldBeValid = 4.0f; 
     295        //const float pixelCouldBeValid = 4.0f; 
     296        const float pixelCouldBeValid = 100.0f; 
    296297        // this pixel information has to be discarded in order to not create artifacts 
    297298        const float pixelIsNotValid = 100.0f; 
     
    305306                isPixelValid = pixelIsNotValid; 
    306307        } 
    307         else if ( // check if changed from dynamic to not dynamic object 
     308        else if (// check if changed from dynamic to not dynamic object 
    308309                 ( 
    309310                         // (oldDynamic && !newDynamic) || (!oldDynamic && newDynamic) || 
     
    321322        } 
    322323         
     324        isPixelValid = depthDif; 
     325 
    323326        return float2(isPixelValid, abs(oldEyeSpaceDepth - projectedEyeSpaceDepth)); 
    324327} 
    325328 
    326329 
    327 /** This function is called during downsampling of the buffers 
    328         for ssao. 
     330/** This function is called during downsampling of the buffers for ssao. 
    329331*/ 
    330332pixel PrepareSsao(fragment IN, 
     
    349351        color.w /= length(IN.view); 
    350352 
    351         const float4 difVec = tex2Dlod(diffVals, float4(IN.texCoord, 0, 0)); 
     353        const float4 difVec = tex2Dlod(diffVals, float4(IN.texCoord, .0f, .0f)); 
    352354        // normalize normal once more because of bilinear interpolation 
    353355        const float3 normal = normalize(tex2Dlod(normalsTex, float4(IN.texCoord, 0, 0)).xyz); 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/depthOfField.cg

    r3235 r3364  
    2020 
    2121        const float dist = abs(zFocus - color.w); 
    22         const float blur = scale * m * focalLen * dist / (sceneRange * (1e-6f + abs(color.w + dist * step(0, zFocus - color.w)))); 
     22        const float blur = scale * m * focalLen *  
     23                dist / (sceneRange * (1e-6f + abs(color.w + dist * step(0, zFocus - color.w)))); 
    2324         
    2425        //float blur = saturate(blur * scale / maxCoC); 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg

    r3362 r3364  
    538538 
    539539                total_ao += max(cosAngle, .0f) * aoContrib; 
    540  
    541540                ++ numSamples; 
    542541 
     
    548547                // they possibly have any influence on the ao 
    549548 
    550                 if (cosAngle > 0) 
     549                if (1)//cosAngle > 0) 
    551550                { 
    552551                        float pixelValid = sampleColor.x; 
     
    555554                        { 
    556555                                const float3 sampleDiffVec = tex2Dlod(attribsTex, float4(texcoord, .0f, .0f)).xyz; 
    557                                 pixelValid = max(pixelValid, length(sampleDiffVec - diffVec) < 5e-3f ? .0f : 10.0f); 
     556                                //pixelValid = max(pixelValid, length(sampleDiffVec - diffVec) < 5e-3f ? .0f : 100.0f); 
     557                                //pixelValid = max(pixelValid, length(sampleDiffVec - diffVec) < 5e-3f ? .0f : 4.0f); 
    558558                                //pixelValid = length(sampleDiffVec - diffVec) < 1e-3f ? .0f : 10.0f; 
    559559                        } 
     
    755755                        //if (oldIdx >= factor * newWeight) oldIdx = 0; 
    756756                        oldWeight = min(oldWeight, factor * newWeight); 
    757                         oldWeight = oldIdx = .0f;  
     757                        //oldWeight = oldIdx = .0f;  
    758758                } 
    759759        } 
     
    771771        const float combinedWeight = clamp(newWeight + oldWeight, .0f, temporalCoherence); 
    772772 
    773         OUT.illum_col.y = combinedWeight; 
     773        OUT.illum_col.y = ao.y;//combinedWeight; 
    774774        OUT.illum_col.z = oldIdx + newWeight; // the new index 
    775775        OUT.illum_col.w = eyeSpaceDepth; 
Note: See TracChangeset for help on using the changeset viewer.