Changeset 3205


Ignore:
Timestamp:
12/02/08 17:32:17 (15 years ago)
Author:
mattausch
Message:

as good as i cab do it right now but flickering when dynamic object enters + if dynamic object stops

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

Legend:

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

    r3204 r3205  
    305305        //-- the flip-flop fbos 
    306306 
    307         //const int dsw = w / 2; const int dsh = h / 2; 
    308         //const int dsw = 128; const int dsh = 96; 
    309         const int dsw = 16; const int dsh = 12; 
     307        const int dsw = w / 2; const int dsh = h / 2; 
    310308        //const int dsw = w; const int dsh = h; 
    311309 
     
    435433        string combineSsaoParams[] =  
    436434                {"colorsTex", "normalsTex", "ssaoTex", "filterOffs",  
    437                  "filterWeights", "modelViewProj", "bl", "br", "tl", "tr"}; 
    438         sCgCombineSsaoProgram->AddParameters(combineSsaoParams, 0, 10); 
     435                 "filterWeights", "modelViewProj", "bl", "br", "tl", "tr", "w", "h"}; 
     436        sCgCombineSsaoProgram->AddParameters(combineSsaoParams, 0, 12); 
    439437 
    440438        ////////////// 
     
    906904                sCgCombineSsaoProgram->SetValue3f(i, mCornersView[j].x, mCornersView[j].y, mCornersView[j].z); 
    907905 
     906        sCgCombineSsaoProgram->SetValue1f(i ++, mIllumFbo->GetColorBuffer(mIllumFboIndex)->GetWidth()); 
     907        sCgCombineSsaoProgram->SetValue1f(i ++, mIllumFbo->GetColorBuffer(mIllumFboIndex)->GetHeight()); 
     908 
    908909        DrawQuad(sCgCombineSsaoProgram); 
    909910         
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/combineSsao.cg

    r3204 r3205  
    165165                          uniform float3 br, 
    166166                          uniform float3 tl, 
    167                           uniform float3 tr 
     167                          uniform float3 tr, 
     168                          uniform float3 w, 
     169                          uniform float3 h 
    168170                          ) 
    169171{ 
     
    177179        // will be interpolated when upsampling and filter size does not match! 
    178180        float4 texelCenterConv; 
    179         //const float w = 512.0f; const float h = 384.0f; 
    180         //const float w = 128.0f; const float h = 96.0f; 
    181         const float w = 16.0f; const float h = 12.0f; 
    182181        const float xoffs = .5f / w; const float yoffs = .5f / h; 
    183182 
     
    186185        center.x = (floor(IN.texCoord.x * w - .5f) + 1.0f) / w; 
    187186        center.y = (floor(IN.texCoord.y * h - .5f) + 1.0f) / h; 
    188 //center=IN.texCoord; 
     187 
    189188        texelCenterConv.x = tex2Dlod(ssaoTex, float4(center + float2( xoffs,  yoffs), 0, 0)).y; 
    190189        texelCenterConv.y = tex2Dlod(ssaoTex, float4(center + float2( xoffs, -yoffs), 0, 0)).y; 
     
    225224 
    226225        //OUT.illum_col.xyz = float3(ao.x, ao.x, step(thres, convergence)); 
    227         OUT.illum_col.xyz = float3(0, convergence, 0); 
     226        //OUT.illum_col.xyz = float3(0, convergence, 0); 
    228227        //OUT.illum_col.xyz = float3(abs(center.x - IN.texCoord.x) * 16.0f, abs(center.y - IN.texCoord.y) * 12.0f, 0); 
    229228         
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg

    r3204 r3205  
    149149        { 
    150150                // pixel valid => retrieve the convergence weight 
    151                 w = 10.0f;//oldPixel.y; 
     151                w = oldPixel.y; 
    152152        } 
    153153        else 
     
    416416 
    417417        const float squaredLen = SqrLen(diffVec); 
    418 /*       
     418 
    419419        if (ao.y > 4.0f) oldWeight = 0; 
    420420        else if ((ao.y > 1.0f) && (squaredLen < DYNAMIC_OBJECTS_THRESHOLD)) 
    421421                oldWeight = min(oldWeight, 4.0f * NUM_SAMPLES); 
    422 */       
     422         
    423423        const float newWeight = ao.z; 
    424424 
    425425        // blend between old and new samples (and avoid division by zero) 
    426426        OUT.illum_col.x = (ao.x * newWeight + oldSsao * oldWeight) / max(1e-6f, (newWeight + oldWeight)); 
    427         OUT.illum_col.y = oldWeight;//clamp(newWeight + oldWeight, .0f, temporalCoherence); 
     427        OUT.illum_col.y = clamp(newWeight + oldWeight, .0f, temporalCoherence); 
    428428 
    429429        OUT.illum_col.z = SqrLen(diffVec); 
Note: See TracChangeset for help on using the changeset viewer.