Ignore:
Timestamp:
11/06/08 13:31:58 (16 years ago)
Author:
mattausch
Message:

updated shader programs

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

Legend:

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

    r3099 r3104  
    231231        const float currentDepth = currentPos.z * precisionScale; 
    232232 
    233         const float2 ao = ssao(IN, colors, noise, samples, normal,  
     233        const float2 ao = ssao(IN, colors, noiseTex, samples, normal,  
    234234                                   eyeSpacePos, w, bl, br, tl, tr, normalize(viewDir)); 
    235235 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/globillum.cg

    r3103 r3104  
    254254 
    255255pixel combine(fragment IN,  
    256                           uniform sampler2D colors, 
     256                          uniform sampler2D colorsTex, 
    257257                          uniform sampler2D ssaoTex, 
    258258                          uniform sampler2D illumTex 
     
    261261        pixel OUT; 
    262262 
    263         float4 col = tex2Dlod(colors, float4(IN.texCoord, 0, 0)); 
     263        float4 col = tex2Dlod(colorsTex, float4(IN.texCoord, 0, 0)); 
    264264        float ao = tex2Dlod(ssaoTex, float4(IN.texCoord, 0, 0)).x; 
    265265 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg

    r3103 r3104  
    354354        return OUT; 
    355355} 
     356 
     357float Filter(float2 texCoord,  
     358                         uniform sampler2D ssaoTex, 
     359                         uniform float2 filterOffs[NUM_SSAO_FILTERSAMPLES], 
     360                         uniform float filterWeights[NUM_SSAO_FILTERSAMPLES]) 
     361{ 
     362        float average = .0f; 
     363        float w = .0f; 
     364 
     365        for (int i = 0; i < NUM_SSAO_FILTERSAMPLES; ++ i) 
     366        { 
     367                average += filterWeights[i] * tex2Dlod(ssaoTex, float4(texCoord + filterOffs[i], 0, 0)).x; 
     368                w += filterWeights[i]; 
     369        } 
     370 
     371        average *= 1.0f / (float)w; 
     372 
     373        return average; 
     374} 
     375 
     376 
     377pixel combine(fragment IN,  
     378                          uniform sampler2D colorsTex, 
     379                          uniform sampler2D ssaoTex, 
     380                          uniform float2 filterOffs[NUM_SSAO_FILTERSAMPLES], 
     381                          uniform float filterWeights[NUM_SSAO_FILTERSAMPLES] 
     382                          ) 
     383{ 
     384        pixel OUT; 
     385 
     386        float4 col = tex2Dlod(colorsTex, float4(IN.texCoord, 0, 0)); 
     387        float4 ao = tex2Dlod(ssaoTex, float4(IN.texCoord, 0, 0)); 
     388 
     389        //if (ao.y < 10.0f) ao.x = Filter(IN.texCoord, ssaoTex, filterOffs, filterWeights); 
     390 
     391        //OUT.illum_col = col * ao.x; 
     392        //OUT.illum_col = float4(ao.y, ao.y, ao.y, col.w); 
     393        //OUT.illum_col = float4(ao.x, ao.x, ao.x, col.w); 
     394        OUT.illum_col.xyz = float3(1.0f - ao.x, 1.0f - ao.y * 1e-2f, 1); 
     395        //OUT.illum_col.xyz = float3(1.0f - ao.x, ao.y, 0); 
     396        OUT.illum_col.w = col.w; 
     397 
     398        return OUT; 
     399} 
Note: See TracChangeset for help on using the changeset viewer.