Changeset 3092


Ignore:
Timestamp:
11/03/08 17:28:15 (16 years ago)
Author:
mattausch
Message:

error much better

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

Legend:

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

    r3090 r3092  
    269269        //-- the flip-flop fbos 
    270270 
    271         mIllumFbo = new FrameBufferObject(w / 2, h / 2, FrameBufferObject::DEPTH_NONE); 
     271//      mIllumFbo = new FrameBufferObject(w / 2, h / 2, FrameBufferObject::DEPTH_NONE); 
     272        mIllumFbo = new FrameBufferObject(w, h, FrameBufferObject::DEPTH_NONE); 
    272273        mFBOs.push_back(mIllumFbo); 
    273274 
     
    278279        } 
    279280 
    280         mDownSampleFbo = new FrameBufferObject(w / 2, h / 2, FrameBufferObject::DEPTH_NONE); 
     281        //mDownSampleFbo = new FrameBufferObject(w / 2, h / 2, FrameBufferObject::DEPTH_NONE); 
     282        mDownSampleFbo = new FrameBufferObject(w, h, FrameBufferObject::DEPTH_NONE); 
    281283        mDownSampleFbo->AddColorBuffer(ColorBufferObject::RGBA_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_LINEAR); 
    282284        // downsample buffer for the normal texture 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaderenv.h

    r3089 r3092  
    4242#define MAX_LOD_LEVEL 10 
    4343 
    44 #define MIN_DEPTH_DIFF 1e-2f 
    45 #define PRECISION_SCALE 1e-2f 
     44#define MIN_DEPTH_DIFF 1e-3f 
     45#define PRECISION_SCALE 1e-1f 
    4646 
    4747// burnout 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/antialiasing.cg

    r3026 r3092  
    2626                        ): COLOR 
    2727{ 
    28         //return tex2D(colors, IN.c.xy); 
     28        return tex2D(colors, IN.c.xy); 
    2929 
    3030        // normal discontinuity filter 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg

    r3089 r3092  
    145145                                  uniform float4x4 shadowMatrix, 
    146146                                  uniform float sampleWidth, 
    147                                   uniform sampler2D noise, 
     147                                  uniform sampler2D noiseTex, 
    148148                                  uniform float2 samples[NUM_PCF_TABS], 
    149149                                  uniform float weights[NUM_PCF_TABS], 
     
    189189                lightSpacePos /= lightSpacePos.w; 
    190190 
    191                 float shadowTerm = CalcShadowTerm(IN, shadowMap, sampleWidth, lightSpacePos.xy, lightSpacePos.z, samples, weights, noise); 
    192                 //float shadowTerm = CalcShadowTerm(IN, shadowMap, sampleWidth, lightSpacePos.xy, lightSpacePos.z, samples, noise); 
     191                float shadowTerm = CalcShadowTerm(IN, shadowMap, sampleWidth, lightSpacePos.xy, lightSpacePos.z, samples, weights, noiseTex); 
     192                //float shadowTerm = CalcShadowTerm(IN, shadowMap, sampleWidth, lightSpacePos.xy, lightSpacePos.z, samples, noiseTex); 
    193193 
    194194                diffuse *= shadowTerm; 
     
    235235        const float currentDepth = currentPos.z * precisionScale; 
    236236 
    237         const float2 ao = ssao(IN, colors, noise, samples, normal, eyeSpacePos, w, bl, br, tl, tr, normalize(viewDir)); 
     237        const float2 ao = ssao(IN, colors, noise, samples, normal,  
     238                                   eyeSpacePos, w, bl, br, tl, tr, normalize(viewDir)); 
    238239 
    239240 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/mrt.cg

    r3089 r3092  
    4242 
    4343 
    44 //#pragma position_invariant vtx 
     44#pragma position_invariant vtx 
    4545 
    4646vtxout vtx(vtxin IN) 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg

    r3091 r3092  
    6060        return samplePos; 
    6161} 
    62  
    63 #pragma position_invariant temporalSmoothing 
    6462 
    6563 
     
    137135                                                 uniform float3 oldbr, 
    138136                                                 uniform float3 oldtl, 
    139                                                  uniform float3 oldtr, 
    140                                                  const uniform float4x4 inverseModelTrafo, 
    141                                                  float id 
     137                                                 uniform float3 oldtr 
     138                                                 //,const uniform float4x4 inverseModelTrafo 
     139                                                 //, float id 
    142140                                                 ) 
    143141{ 
     
    147145        //-- compute reprojection for temporal smoothing 
    148146 
    149         float4x4 trafo; 
    150  
     147        //float4x4 trafo; 
    151148        // dynamic object 
    152         if (id > 20) 
    153                 trafo = oldModelViewProj; 
    154         else 
    155                 trafo = inverseModelTrafo * oldModelViewProj; 
     149        //if (id > 20) trafo = oldModelViewProj; 
     150        //else trafo = inverseModelTrafo * oldModelViewProj; 
    156151 
    157152        // reproject into old frame and calculate projected depth 
     
    174169 
    175170        const float depthDif = length(oldSamplePos - worldPos.xyz); 
    176          
     171        //const float dummy5 = abs(oldEyeSpaceDepth - eyeSpaceDepth); 
     172        const float dummy5 = length(oldTexCoords - texcoord0) * 1e5f; 
     173        //const float dummy5 = depthDif; 
     174 
    177175        float notValid = 0.5f; 
    178176 
     
    225223        illum_col.y = newWeight; 
    226224        illum_col.w = eyeSpaceDepth; 
    227          
     225        illum_col.y = dummy5; 
     226 
    228227        return illum_col; 
    229228} 
     
    394393 
    395394        float4 col = tex2Dlod(colors, float4(IN.texCoord, 0, 0)); 
    396         float3 ao = tex2Dlod(ssaoTex, float4(IN.texCoord, 0, 0)); 
    397  
    398         if (ao.y < 10.0f) ao.x = Filter(IN.texCoord, ssaoTex, filterOffs, filterWeights); 
    399  
    400         OUT.illum_col = col * ao.x; 
    401         //OUT.illum_col = float4(ao.x, ao.x, ao.x, col.w); 
     395        float4 ao = tex2Dlod(ssaoTex, float4(IN.texCoord, 0, 0)); 
     396 
     397        //if (ao.y < 10.0f) ao.x = Filter(IN.texCoord, ssaoTex, filterOffs, filterWeights); 
     398 
     399        //OUT.illum_col = col * ao.x; 
     400        OUT.illum_col = float4(ao.y, ao.y, ao.y, col.w); 
    402401        //OUT.illum_col.xyz = float3(1.0f - ao.x, 1.0f - ao.y * 1e-2f, 1); 
    403402        //OUT.illum_col.xyz = float3(1.0f - ao.x, ao.y, 0); 
Note: See TracChangeset for help on using the changeset viewer.