Ignore:
Timestamp:
10/12/08 15:43:22 (16 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders
Files:
4 edited

Legend:

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

    r2976 r3026  
    1212}; 
    1313 
    14 // the barrier for detecting a discontinuity 
    15 uniform float4 e_barrier = float4(5e-5, 5e-5, 0, 0); // x = normal, y = depth 
    16 // the weights for normal / depth discontinuity 
    17 uniform float4 e_weights = float4(0.5f, 0.5f, 1.0f, 1.0f); // x = normal, y = depth 
    18 //uniform float4 e_weights = float4(1.0f, 1.0f, 1.0f, 1.0f); // x = normal, y = depth 
     14// the barrier for detecting a discontinuity (x = normal, y = depth) 
     15uniform float4 e_barrier = float4(5e-5, 5e-5, 0, 0);  
     16// the weights for normal / depth discontinuity (x = normal, y = depth) 
     17uniform float4 e_weights = float4(0.5f, 0.5f, 1.0f, 1.0f);  
     18//uniform float4 e_weights = float4(1.0f, 1.0f, 1.0f, 1.0f); 
    1919uniform float4 e_kernel = float4(0.5f, 1.0f, 1.0f, 1.0f);  
    2020 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg

    r3025 r3026  
    6161pixel main(fragment IN,  
    6262                   uniform sampler2D colors, 
    63                    uniform sampler2D positions, 
    6463                   uniform sampler2D normals, 
    6564                   uniform float3 lightDir 
     
    151150                                  uniform float4x4 shadowMatrix, 
    152151                                  uniform float sampleWidth, 
    153                                   uniform sampler2D noiseTexture, 
     152                                  uniform sampler2D noise, 
    154153                                  uniform float2 samples[NUM_PCF_TABS], 
    155154                                  uniform float weights[NUM_PCF_TABS], 
     
    199198                lightSpacePos /= lightSpacePos.w; 
    200199 
    201                 float shadowTerm = CalcShadowTerm(IN, shadowMap, sampleWidth, lightSpacePos.xy, lightSpacePos.z, samples, weights, noiseTexture); 
    202                 //float shadowTerm = CalcShadowTerm(IN, shadowMap, sampleWidth, lightSpacePos.xy, lightSpacePos.z, samples, noiseTexture); 
     200                float shadowTerm = CalcShadowTerm(IN, shadowMap, sampleWidth, lightSpacePos.xy, lightSpacePos.z, samples, weights, noise); 
     201                //float shadowTerm = CalcShadowTerm(IN, shadowMap, sampleWidth, lightSpacePos.xy, lightSpacePos.z, samples, noise); 
    203202 
    204203                diffuse *= shadowTerm; 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/globillum.cg

    r3019 r3026  
    6161                                   uniform float3 currentNormal, 
    6262                                   uniform float3 centerPosition, 
    63                                    float w, 
     63                                   float scaleFactor, 
    6464                                   uniform float3 bl, 
    6565                                   uniform float3 br, 
     
    9696#endif 
    9797                // weight with projected coordinate to reach similar kernel size for near and far 
    98                 float2 texcoord = IN.texCoord.xy + offsetTransformed * w; 
     98                float2 texcoord = IN.texCoord.xy + offsetTransformed * scaleFactor; 
    9999 
    100100                //if ((texcoord.x <= 1.0f) && (texcoord.x >= 0.0f) && (texcoord.y <= 1.0f) && (texcoord.y >= 0.0f)) ++ numSamples; 
     
    151151                   uniform sampler2D colors, 
    152152                   uniform sampler2D normals, 
    153                    uniform sampler2D noiseTexture, 
     153                   uniform sampler2D noise, 
    154154                   uniform float2 samples[NUM_SAMPLES], 
    155155                   uniform sampler2D oldSsaoTex, 
     
    191191        //-- compute color bleeding + ao 
    192192 
    193         GiStruct gi = globIllum(IN, colors, noiseTexture, samples, normal, eyeSpacePos, w, bl, br, tl, tr, normalize(IN.view)); 
     193        GiStruct gi = globIllum(IN, colors, noise, samples, normal, eyeSpacePos, w, bl, br, tl, tr, normalize(IN.view)); 
    194194         
    195195 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg

    r3019 r3026  
    137137                   uniform sampler2D colors, 
    138138                   uniform sampler2D normals, 
    139                    uniform sampler2D noiseTexture, 
     139                   uniform sampler2D noise, 
    140140                   uniform float2 samples[NUM_SAMPLES], 
    141141                   uniform sampler2D oldTex, 
     
    161161        const float3 centerPosition = eyePos + eyeSpacePos; 
    162162 
    163         float4 realPos = float4(centerPosition, 1.0f); 
     163        const float4 realPos = float4(centerPosition, 1.0f); 
    164164 
    165165 
     
    174174        const float currentDepth = currentPos.z * 1e-3f; 
    175175 
    176         const float2 ao = ssao(IN, colors, noiseTexture, samples, normal, eyeSpacePos, w, bl, br, tl, tr, normalize(viewDir)); 
     176        const float2 ao = ssao(IN, colors, noise, samples, normal, eyeSpacePos, w, bl, br, tl, tr, normalize(viewDir)); 
    177177 
    178178 
     
    202202 
    203203        //const float oldNumSamples = oldCol.y; 
    204         const float oldWeight = clamp(oldCol.y, 0, temporalCoherence); 
     204        const float oldWeight = 50;//clamp(oldCol.y, 0, temporalCoherence); 
    205205 
    206206        float newWeight; 
     
    209209        //const float newNumSamples = ao.y; 
    210210 
    211         if (//(temporalCoherence > 0) && 
     211        if ((temporalCoherence > 0) && 
    212212                (tex.x >= 0.0f) && (tex.x < 1.0f) &&  
    213213                (tex.y >= 0.0f) && (tex.y < 1.0f) &&  
     
    228228        } 
    229229 
    230         //OUT.illum_col.y=depthDif; 
    231230        OUT.illum_col.y = newWeight; 
    232231        OUT.illum_col.z = currentDepth; 
     
    269268        float3 ao = tex2Dlod(ssaoTex, float4(IN.texCoord, 0, 0)); 
    270269 
    271         if (ao.y < 2000.0f) 
    272                 ao.x = Filter(IN.texCoord, ssaoTex, filterOffs, filterWeights); 
     270        //if (ao.y < 2000.0f)  
     271        //      ao.x = Filter(IN.texCoord, ssaoTex, filterOffs, filterWeights); 
    273272 
    274273        OUT.illum_col = col * ao.x; 
Note: See TracChangeset for help on using the changeset viewer.