- Timestamp:
- 11/05/08 13:41:42 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaderenv.h
r3095 r3099 42 42 #define MAX_LOD_LEVEL 10 43 43 44 #define MIN_DEPTH_DIFF 5e-2f 44 #define MIN_DEPTH_DIFF 1e-3f 45 //#define MIN_DEPTH_DIFF 5e-1f 45 46 #define PRECISION_SCALE 1e-1f 46 47 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg
r3098 r3099 71 71 float4 col = shade(IN, color, normal, lightDir); 72 72 73 //OUT.color = col; 74 OUT.color.xyz = normal * 0.5f + 0.5f; 75 73 OUT.color = col; 74 //OUT.color.xyz = normal * 0.5f + 0.5f; 76 75 // store scaled view vector so wie don't have to normalize for e.g., ssao 77 76 OUT.color.w = color.w / length(IN.view); … … 197 196 // compute shading 198 197 OUT.color = useShading ? (ambient + diffuse) * color : color; 199 200 198 // store scaled view vector from now on so wie don't have to normalize later (e.g., for ssao) 201 199 OUT.color.w = color.w / lenView; -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
r3098 r3099 147 147 //else trafo = inverseModelTrafo * oldModelViewProj; 148 148 149 float 4 dummyPt = worldPos - float4(oldEyePos, 0);149 float3 dummyPt = worldPos.xyz - oldEyePos; 150 150 151 151 // reproject into old frame and calculate texture position of sample in old frame 152 float4 backProjPos = mul(oldModelViewProj, dummyPt);152 float4 backProjPos = mul(oldModelViewProj, float4(dummyPt, 1.0f)); 153 153 backProjPos /= backProjPos.w; 154 154 // fit from unit cube into 0 .. 1 … … 164 164 //const float3 viewVec = normalize(Interpol(oldTexCoords, oldbl, oldbr, oldtl, oldtr)); 165 165 const float3 viewVec = Interpol(oldTexCoords, oldbl, oldbr, oldtl, oldtr); 166 const float3 oldWorldPos = oldEyePos - oldEyeSpaceDepth * viewVec;166 //const float3 oldWorldPos = oldEyePos - oldEyeSpaceDepth * viewVec; 167 167 //const float3 oldWorldPos = - viewVec * eyeSpaceDepth; 168 168 //const float3 dummy14 = Interpol(texcoord0, bl, br, tl, tr); 169 169 170 170 // the euclidian world space distance 171 const float depthDif = length(oldWorldPos - worldPos.xyz);171 //const float depthDif = length(oldWorldPos - worldPos.xyz); 172 172 //const float depthDif = length(dummy14 - viewVec); 173 //const float depthDif = length(oldEyeSpaceDepth - eyeSpaceDepth); 173 //const float projectedEyeSpaceDepth = length(worldPos + oldEyePos); 174 const float invlen = 1.0f / length(viewVec); 175 const float projectedEyeSpaceDepth = length(dummyPt) * invlen; 176 177 const float depthDif = abs(oldEyeSpaceDepth - projectedEyeSpaceDepth); 174 178 //const float depthDif = length(oldEyePos); 175 179
Note: See TracChangeset
for help on using the changeset viewer.