Changeset 3141 for GTP


Ignore:
Timestamp:
11/18/08 18:23:30 (16 years ago)
Author:
mattausch
Message:

good parameters, transition between filter and no filter not visible (working)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/combineSsao.cg

    r3140 r3141  
    152152        float4 ao = tex2Dlod(ssaoTex, float4(IN.texCoord, 0, 0)); 
    153153 
    154         //if ((ao.y < 60.0f) && (col.w < 1e10f)) 
    155         if (col.w < 1e10f) 
     154        if ((ao.y < 70.0f) && (col.w < 1e10f)) 
     155        //if (col.w < 1e10f) 
    156156        { 
    157                 const float xoffs = 20.0f / 1024.0f; 
    158                 const float yoffs = 20.0f / 768.0f; 
    159  
    160                 /*float3 b2 = tex2Dlod(offsetTex, float4(IN.texCoord + float2(xoffs, 0), 0, 0)).xyz; 
    161                 float3 b3 = tex2Dlod(offsetTex, float4(IN.texCoord + float2(0, yoffs), 0, 0)).xyz; 
    162                 float3 b4 = tex2Dlod(offsetTex, float4(IN.texCoord + float2(-xoffs, 0), 0, 0)).xyz; 
    163                 float3 b5 = tex2Dlod(offsetTex, float4(IN.texCoord + float2(0, -yoffs), 0, 0)).xyz; 
    164  
    165                 float border = step(0.001f,  b2 
    166                 //float3 id = tex2Dlod(attribsTex, float4(IN.texCoord, 0, 0)).xyz; 
    167 */ 
    168                  
    169                 /*float3 x2 = tex2Dlod(ssaoTex, float4(IN.texCoord + float2(xoffs, 0), 0, 0)).xyz; 
    170                 float3 x3 = tex2Dlod(ssaoTex, float4(IN.texCoord + float2(0, yoffs), 0, 0)).xyz; 
    171                 float3 x4 = tex2Dlod(ssaoTex, float4(IN.texCoord + float2(-xoffs, 0), 0, 0)).xyz; 
    172                 float3 x5 = tex2Dlod(ssaoTex, float4(IN.texCoord + float2(0, -yoffs), 0, 0)).xyz; 
    173  
    174                 //ao.x = (ao.x + x2 + x3 + x4 + x5) * 0.2f; 
    175                 if (ao.y < 1.5f) 
    176                 ao.x = (x2 + x3 + x4 + x5) * 0.25f; 
    177  
    178 */ 
    179                 const static float scaleFactor = 1.0f; 
    180                 //const static float scaleFactor = 10.0f; 
    181                 const static float adaptFactor = 50000.0f; 
     157                const float scaleFactor = 1.0f; 
     158                const float adaptFactor = 10.0f; 
    182159 
    183160                //ao.x = Filter(IN.texCoord, ssaoTex, filterOffs, filterWeights); 
     
    186163                //ao.x = DiscontinuityFilter(IN.texCoord, ao, ssaoTex, normalsTex, filterOffs, filterWeights, adaptFactor * scaleFactor  / (adaptFactor + ao.y), 0); 
    187164 
    188                 //if (ao.y < 50.5f) ao.x = DiscontinuityFilter(IN.texCoord, ao, col, ssaoTex, normalsTex, colorsTex, filterOffs, filterWeights, adaptFactor * scaleFactor * ao.z  / (adaptFactor + ao.y), bl, br, tl, tr); 
    189                 if (ao.y < 50.5f) ao.x = DiscontinuityFilter(IN.texCoord, ao, col, ssaoTex, normalsTex, colorsTex, filterOffs, filterWeights, ao.z, bl, br, tl, tr); 
     165                const float scale =     adaptFactor * scaleFactor * ao.z  / (adaptFactor + ao.y); 
     166 
     167                ao.x = DiscontinuityFilter(IN.texCoord, ao, col, ssaoTex, normalsTex, colorsTex, filterOffs, filterWeights, scale, bl, br, tl, tr); 
     168                //if (ao.y < 50.5f) ao.x = DiscontinuityFilter(IN.texCoord, ao, col, ssaoTex, normalsTex, colorsTex, filterOffs, filterWeights, ao.z, bl, br, tl, tr); 
    190169                //ao.x = DiscontinuityFilter(IN.texCoord, ao, ssaoTex, normalsTex, filterOffs, filterWeights, 1, 0); 
    191170        } 
Note: See TracChangeset for help on using the changeset viewer.