Changeset 2987 for GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders
- Timestamp:
- 10/01/08 17:39:41 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
r2986 r2987 53 53 54 54 return r; 55 } 56 57 float3 Interpol(float2 w, float3 bl, float3 br, float3 tl, float3 tr) 58 { 59 //float3 x1 = lerp(oldColor.w, logLumScaled, 0.1f); 60 float3 x1 = bl * (1.0f - w.x) + br * w.x; 61 float3 x2 = tl * (1.0f - w.x) + tr * w.x; 62 63 float3 v = x1 * (1.0f - w.y) + x2 * w.y; 64 65 return v; 55 66 } 56 67 … … 70 81 uniform float3 br, 71 82 uniform float3 tl, 72 uniform float3 tr 83 uniform float3 tr, 84 uniform float maxDepth 73 85 ) 74 86 { … … 105 117 float eyeSpaceDepth = tex2Dlod(colors, float4(texcoord, 0, SSAO_MIPMAP_LEVEL)).w; 106 118 107 float rotx = offsetTransformed.x * -x_angle; 108 float roty = offsetTransformed.y * -y_angle; 109 110 float3 rotView_x = RotateY(viewDir, x_angle); 111 float3 rotView = RotateX(rotView_x, y_angle); 112 113 float3 sample_position = eyePos - rotView * eyeSpaceDepth; 119 float newOffs = 0.5f + offsetTransformed * 0.5f; 120 121 float3 rotView = normalize(Interpol(newOffs, bl, br, tl, tr)); 122 float3 sample_position = (eyePos - rotView * eyeSpaceDepth) / maxDepth; 114 123 //float3 sample_position = tex2Dlod(positions, float4(texcoord, 0, SSAO_MIPMAP_LEVEL)).xyz; 115 124 … … 177 186 float3 viewDir = normalize(IN.view); 178 187 179 /*const float eyeSpaceDepth = tex2D(colors, IN.texCoord.xy).w;188 /* const float eyeSpaceDepth = tex2D(colors, IN.texCoord.xy).w; 180 189 181 190 float3 sample_position = eyePos - viewDir * eyeSpaceDepth; 182 191 183 OUT.illum_col.xyz = centerPosition.xyz -sample_position;192 OUT.illum_col.xyz = centerPosition.xyz * maxDepth - sample_position; 184 193 OUT.illum_col.w = currentDepth; 185 return OUT; */186 194 return OUT; 195 */ 187 196 //const float2 ao = ssao(IN, positions, noiseTexture, samples, normal, centerPosition, w, viewDir, eyePos); 188 197 const float2 ao = ssao(IN, colors, noiseTexture, samples, normal, centerPosition, w, viewDir, eyePos, positions, 189 uniform float3 bl, 190 uniform float3 br, 191 uniform float3 tl, 192 uniform float3 tr); 198 bl, br, tl, tr, maxDepth); 193 199 194 200
Note: See TracChangeset
for help on using the changeset viewer.