- Timestamp:
- 02/17/09 19:21:52 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/combineSsaoSep.cg
r3314 r3316 58 58 float3 br, 59 59 float3 tl, 60 float3 tr) 60 float3 tr, 61 float maxConvergence) 61 62 { 62 63 float2 aoSample = tex2Dlod(ssaoTex, sampleTexCoord); … … 72 73 float spatialFactor = 1.0f / max(len, 1e-3f); 73 74 74 float convergenceFactor = aoSample.y + 1.0f; 75 float convergenceFactor = min(aoSample.y + 1.0f, maxConvergence); 76 convergenceFactor *= convergenceFactor; 75 77 76 78 // combine the weights 77 //float w = convergenceFactor * convergenceFactor * spatialFactor;78 79 float w = convergenceFactor * spatialFactor; 79 80 //float w = spatialFactor; … … 96 97 float3 tr, 97 98 float2 xyStep, 98 float convergence) 99 float convergence, 100 float maxConvergence 101 ) 99 102 { 100 103 float2 result = float2(0.0f, 0.0f); … … 109 112 { 110 113 float4 sampleTexCoord = float4(texCoord + i * xyStep * scale, .0f, .0f); 111 result += FilterSample(sampleTexCoord, ssaoTex, colorsTex, centerPos, bl, br, tl, tr );114 result += FilterSample(sampleTexCoord, ssaoTex, colorsTex, centerPos, bl, br, tl, tr, maxConvergence); 112 115 } 113 116 … … 148 151 { 149 152 // the filtered ssao value 150 OUT.illum_col.x = FilterXY(IN.texCoord, ssaoTex, colorsTex, bl, br, tl, tr, xyStep, convergence );153 OUT.illum_col.x = FilterXY(IN.texCoord, ssaoTex, colorsTex, bl, br, tl, tr, xyStep, convergence, maxConvergence); 151 154 } 152 155 … … 163 166 uniform float3 tl, 164 167 uniform float3 tr, 165 uniform float2 res 168 uniform float2 res, 169 uniform float maxConvergence 166 170 ) 167 171 { … … 183 187 { 184 188 // the filtered ssao value 185 OUT.illum_col.x = FilterXY(IN.texCoord, ssaoTex, colorsTex, bl, br, tl, tr, xyStep, convergence );189 OUT.illum_col.x = FilterXY(IN.texCoord, ssaoTex, colorsTex, bl, br, tl, tr, xyStep, convergence, maxConvergence); 186 190 } 187 191 … … 200 204 uniform float3 tl, 201 205 uniform float3 tr, 202 uniform float2 res 206 uniform float2 res, 207 uniform float maxConvergence 203 208 ) 204 209 { … … 221 226 { 222 227 // the filtered ssao value 223 ao.x = FilterXY(IN.texCoord, ssaoTex, colorsTex, bl, br, tl, tr, xyStep, convergence );228 ao.x = FilterXY(IN.texCoord, ssaoTex, colorsTex, bl, br, tl, tr, xyStep, convergence, maxConvergence); 224 229 } 225 230
Note: See TracChangeset
for help on using the changeset viewer.