- Timestamp:
- 02/16/09 17:08:51 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/combineSsaoSep.cg
r3311 r3313 114 114 } 115 115 116 /** In between step that only filters in one direction 117 */ 118 pixel FilterSsaoFullRes(fragment IN, 119 uniform sampler2D colorsTex, 120 uniform sampler2D ssaoTex, 121 uniform float3 bl, 122 uniform float3 br, 123 uniform float3 tl, 124 uniform float3 tr, 125 uniform float2 res 126 ) 127 { 128 pixel OUT; 129 130 const float depth = tex2Dlod(colorsTex, float4(IN.texCoord, 0, 0)).w; 131 132 OUT.illum_col = tex2Dlod(ssaoTex, float4(IN.texCoord, 0, 0)); 133 // just take unfiltered convergence in current pixel 134 const float convergence = OUT.illum_col.y; 135 136 // filter reaches size 1 pixel when sample size reaches threshold 137 // afterwards we do not use the filter anymore 138 139 float2 xyStep = float2(1.0f / res.x, 0); 140 141 // filter up to a certain convergance value and leave out background (sky) by checking depth 142 if ((convergence < SSAO_CONVERGENCE_THRESHOLD) && (depth < DEPTH_THRESHOLD)) 143 { 144 // the filtered ssao value 145 OUT.illum_col.x = FilterXY(IN.texCoord, ssaoTex, colorsTex, bl, br, tl, tr, xyStep, convergence); 146 } 147 148 return OUT; 149 } 116 150 117 151 /** In between step that only filters in one direction … … 151 185 } 152 186 153 154 /** In between step that only filters in one direction155 */156 pixel FilterSsaoFullRes(fragment IN,157 uniform sampler2D colorsTex,158 uniform sampler2D ssaoTex,159 uniform float3 bl,160 uniform float3 br,161 uniform float3 tl,162 uniform float3 tr,163 uniform float2 res164 )165 {166 pixel OUT;167 168 const float depth = tex2Dlod(colorsTex, float4(IN.texCoord, 0, 0)).w;169 170 OUT.illum_col = tex2Dlod(ssaoTex, float4(IN.texCoord, 0, 0));171 // just take unfiltered convergence in current pixel172 const float convergence = OUT.illum_col.y;173 174 // filter reaches size 1 pixel when sample size reaches threshold175 // afterwards we do not use the filter anymore176 177 const float2 xyStep = float2(1.0f / res.x, 0);178 179 // filter up to a certain convergance value and leave out background (sky) by checking depth180 if ((convergence < SSAO_CONVERGENCE_THRESHOLD) && (depth < DEPTH_THRESHOLD))181 {182 // the filtered ssao value183 OUT.illum_col.x = FilterXY(IN.texCoord, ssaoTex, colorsTex, bl, br, tl, tr, xyStep, convergence);184 }185 186 return OUT;187 }188 189 190 187 /** Function combining image and indirect illumination buffer using a 191 188 depth and convergence aware discontinuity filter.
Note: See TracChangeset
for help on using the changeset viewer.