Ignore:
Timestamp:
02/13/09 15:59:33 (15 years ago)
Author:
mattausch
Message:

debug version

File:
1 edited

Legend:

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

    r3306 r3310  
    114114} 
    115115 
     116 
     117/** In between step that only filters in one direction 
     118*/ 
     119pixel FilterSsaoHalfRes(fragment IN,  
     120                                                uniform sampler2D colorsTex, 
     121                                                uniform sampler2D ssaoTex, 
     122                                                uniform float3 bl, 
     123                                                uniform float3 br, 
     124                                                uniform float3 tl, 
     125                                                uniform float3 tr, 
     126                                                uniform float2 res 
     127                                                 ) 
     128{ 
     129        pixel OUT; 
     130 
     131        const float depth = tex2Dlod(colorsTex, float4(IN.texCoord, 0, 0)).w; 
     132 
     133        OUT.illum_col = tex2Dlod(ssaoTex, float4(IN.texCoord, 0, 0)); 
     134        // compute minimal convergence for savetly reasons, write it out 
     135        const float convergence = ComputeConvergenceHalfRes(ssaoTex, IN.texCoord, res * 0.5f); 
     136        OUT.illum_col.y = convergence; 
     137 
     138        const float2 xyStep = float2(1.0f / res.x, 0); 
     139 
     140        // filter reaches size 1 pixel when sample size reaches threshold  
     141        // afterwards we do not use the filter anymore 
     142 
     143        // filter up to a certain convergance value and leave out background (sky) by checking depth 
     144        if ((convergence < SSAO_CONVERGENCE_THRESHOLD) && (depth < DEPTH_THRESHOLD)) 
     145        { 
     146                // the filtered ssao value 
     147                //OUT.illum_col.x = FilterXY(IN.texCoord, ssaoTex, colorsTex, bl, br, tl, tr, xyStep, convergence); 
     148        } 
     149 
     150        return OUT; 
     151} 
     152 
     153 
    116154/** In between step that only filters in one direction 
    117155*/ 
     
    137175        // afterwards we do not use the filter anymore 
    138176 
    139         float2 xyStep = float2(1.0f / res.x, 0); 
     177        const float2 xyStep = float2(1.0f / res.x, 0); 
    140178 
    141179        // filter up to a certain convergance value and leave out background (sky) by checking depth 
     
    149187} 
    150188 
    151 /** In between step that only filters in one direction 
    152 */ 
    153 pixel FilterSsaoHalfRes(fragment IN,  
    154                                                 uniform sampler2D colorsTex, 
    155                                                 uniform sampler2D ssaoTex, 
    156                                                 uniform float3 bl, 
    157                                                 uniform float3 br, 
    158                                                 uniform float3 tl, 
    159                                                 uniform float3 tr, 
    160                                                 uniform float2 res 
    161                                                  ) 
    162 { 
    163         pixel OUT; 
    164  
    165         const float depth = tex2Dlod(colorsTex, float4(IN.texCoord, 0, 0)).w; 
    166  
    167         OUT.illum_col = tex2Dlod(ssaoTex, float4(IN.texCoord, 0, 0)); 
    168         // compute minimal convergence for savetly reasons, write it out 
    169         const float convergence = ComputeConvergenceHalfRes(ssaoTex, IN.texCoord, res * 0.5f); 
    170         OUT.illum_col.y = convergence; 
    171  
    172         const float2 xyStep = float2(1.0f / res.x, 0); 
    173  
    174         // filter reaches size 1 pixel when sample size reaches threshold  
    175         // afterwards we do not use the filter anymore 
    176  
    177         // filter up to a certain convergance value and leave out background (sky) by checking depth 
    178         if ((convergence < SSAO_CONVERGENCE_THRESHOLD) && (depth < DEPTH_THRESHOLD)) 
    179         { 
    180                 // the filtered ssao value 
    181                 OUT.illum_col.x = FilterXY(IN.texCoord, ssaoTex, colorsTex, bl, br, tl, tr, xyStep, convergence); 
    182         } 
    183  
    184         return OUT; 
    185 } 
    186189 
    187190/** Function combining image and indirect illumination buffer using a  
Note: See TracChangeset for help on using the changeset viewer.