Changeset 2897 for GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders
- Timestamp:
- 09/03/08 01:57:45 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders
- Files:
-
- 2 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 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
r2893 r2897 114 114 const uniform float4x4 oldModelViewProj, 115 115 uniform float maxDepth, 116 uniform float expFactor116 uniform float temporalCoherence 117 117 ) 118 118 { … … 157 157 const float depthDif = 1.0f - newDepth / oldDepth; 158 158 159 160 if ((tex.x >= 0.0f) && (tex.x < 1.0f) && 159 float oldWeight = clamp(oldCol.z, 0, temporalCoherence); 160 float newWeight; 161 162 if ((temporalCoherence > 0) && 163 (tex.x >= 0.0f) && (tex.x < 1.0f) && 161 164 (tex.y >= 0.0f) && (tex.y < 1.0f) && 162 (abs(depthDif) < 1e- 3f))165 (abs(depthDif) < 1e-4f)) 163 166 { 164 OUT.illum_col = (float4)ao * expFactor + oldCol.x * (1.0f - expFactor); 167 newWeight = oldWeight + 1; 168 169 //OUT.illum_col = (float4)ao * expFactor + oldCol.x * (1.0f - expFactor); 170 OUT.illum_col = (float4)(ao + oldCol.x * oldWeight) / newWeight; 165 171 } 166 172 else 167 173 { 168 174 OUT.illum_col = (float4)ao; 175 newWeight = 0; 169 176 } 170 177 171 //OUT.illum_col.xyz = viewDir; 178 179 OUT.illum_col.z = newWeight; 172 180 OUT.illum_col.w = currentDepth; 173 181 … … 188 196 //OUT.illum_col = ao; 189 197 198 //OUT.illum_col.z = ao.z; 190 199 OUT.illum_col.w = ao.w; 191 200
Note: See TracChangeset
for help on using the changeset viewer.