- Timestamp:
- 09/03/08 01:57:45 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/globillum.cg
r2892 r2897 121 121 const uniform float4x4 oldModelViewProj, 122 122 uniform float maxDepth, 123 uniform float expFactor123 uniform float temporalCoherence 124 124 ) 125 125 { … … 167 167 const float depthDif = 1.0f - newDepth / oldDepth; 168 168 169 170 if ((tex.x >= 0.0f) && (tex.x < 1.0f) && 169 float oldWeight = clamp(oldSsao.z, 0, temporalCoherence); 170 float newWeight; 171 172 if ((temporalCoherence > 0.0f) && 173 (tex.x >= 0.0f) && (tex.x < 1.0f) && 171 174 (tex.y >= 0.0f) && (tex.y < 1.0f) && 172 175 (abs(depthDif) < 1e-3f)) 173 176 { 174 OUT.ssao_col.x = new_color.w * expFactor + oldSsao.x * (1.0f - expFactor); 175 OUT.illum_col = new_color * expFactor + oldIllum * (1.0f - expFactor); 177 newWeight = oldWeight + 1; 178 179 //OUT.illum_col = (float4)ao * expFactor + oldCol.x * (1.0f - expFactor); 180 OUT.ssao_col.x = (new_color.w + oldSsao.x * oldWeight) / newWeight; 181 OUT.illum_col = (new_color + oldIllum * oldWeight) / newWeight; 182 183 //OUT.ssao_col.x = new_color.w * expFactor + oldSsao.x * (1.0f - expFactor); 184 //OUT.illum_col = new_color * expFactor + oldIllum * (1.0f - expFactor); 176 185 } 177 186 else 178 187 { 188 newWeight = 0; 189 179 190 OUT.ssao_col.x = new_color.w; 180 191 OUT.illum_col = new_color; 181 192 } 182 193 194 OUT.ssao_col.z = newWeight; 183 195 OUT.ssao_col.w = currentDepth; 184 196
Note: See TracChangeset
for help on using the changeset viewer.