Changeset 2863 for GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders
- Timestamp:
- 08/24/08 12:48:59 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg
r2861 r2863 7 7 8 8 // rule of thumb: approx 1 / NUM_SAMPLES 9 #define SAMPLE_INTENSITY 0.210 //#define SAMPLE_INTENSITY 0.125f9 //#define SAMPLE_INTENSITY 0.2 10 #define SAMPLE_INTENSITY 0.125f 11 11 12 12 #define AREA_SIZE 9e-1f 13 #define VIEW_CORRECTION_SCALE 0.3f 13 //#define VIEW_CORRECTION_SCALE 0.3f 14 #define VIEW_CORRECTION_SCALE 1.0f 14 15 #define DISTANCE_SCALE 1e-6f 15 16 … … 51 52 52 53 54 /** The ssao shader returning the an intensity value between 0 and 1 55 */ 53 56 float ssao(fragment IN, 54 57 uniform sampler2D positions, … … 101 104 (SAMPLE_INTENSITY * DISTANCE_SCALE) / (DISTANCE_SCALE + length_to_sample * length_to_sample); 102 105 103 // if normal perpenticular to view dir, only half of the samples count106 // if surface normal perpenticular to view dir, the samples count less => compensate for this 104 107 float view_correction = 1.0f + VIEW_CORRECTION_SCALE * (1.0f - dot(currentViewDir, currentNormal)); 105 108 … … 108 111 109 112 return (1.0f - total_ao); 113 //return float4(dot(currentViewDir, currentNormal)); 110 114 } 111 115 … … 226 230 // expand normal 227 231 normal = normalize(normal * 2.0f - 1.0f); 232 /// the current view direction 228 233 float3 viewDir = normalize(IN.view * 2.0f - float3(1.0f)); 229 234 … … 235 240 float ao = ssao(IN, positions, noiseTexture, samples, normal.xyz, viewDir, noiseMultiplier, centerPosition); 236 241 float4 attenuated_color = ao * col; 242 //float4 attenuated_color = ao; 237 243 238 244 //float4 new_col = globIllum(IN, colors, positions, noiseTexture, samples, normal.xyz, viewDir, noiseMultiplier, centerPosition); 239 //float ao = new_col.w;240 245 //float4 attenuated_color = ao * col + new_col; 241 246 … … 266 271 } 267 272 273 //OUT.color.xyz = viewDir; 274 //OUT.color = attenuated_color; 275 268 276 OUT.color.w = tex2D(colors, IN.texCoord.xy).w; 269 277
Note: See TracChangeset
for help on using the changeset viewer.