Changeset 3104 for GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders
- Timestamp:
- 11/06/08 13:31:58 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg
r3099 r3104 231 231 const float currentDepth = currentPos.z * precisionScale; 232 232 233 const float2 ao = ssao(IN, colors, noise , samples, normal,233 const float2 ao = ssao(IN, colors, noiseTex, samples, normal, 234 234 eyeSpacePos, w, bl, br, tl, tr, normalize(viewDir)); 235 235 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/globillum.cg
r3103 r3104 254 254 255 255 pixel combine(fragment IN, 256 uniform sampler2D colors ,256 uniform sampler2D colorsTex, 257 257 uniform sampler2D ssaoTex, 258 258 uniform sampler2D illumTex … … 261 261 pixel OUT; 262 262 263 float4 col = tex2Dlod(colors , float4(IN.texCoord, 0, 0));263 float4 col = tex2Dlod(colorsTex, float4(IN.texCoord, 0, 0)); 264 264 float ao = tex2Dlod(ssaoTex, float4(IN.texCoord, 0, 0)).x; 265 265 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
r3103 r3104 354 354 return OUT; 355 355 } 356 357 float Filter(float2 texCoord, 358 uniform sampler2D ssaoTex, 359 uniform float2 filterOffs[NUM_SSAO_FILTERSAMPLES], 360 uniform float filterWeights[NUM_SSAO_FILTERSAMPLES]) 361 { 362 float average = .0f; 363 float w = .0f; 364 365 for (int i = 0; i < NUM_SSAO_FILTERSAMPLES; ++ i) 366 { 367 average += filterWeights[i] * tex2Dlod(ssaoTex, float4(texCoord + filterOffs[i], 0, 0)).x; 368 w += filterWeights[i]; 369 } 370 371 average *= 1.0f / (float)w; 372 373 return average; 374 } 375 376 377 pixel combine(fragment IN, 378 uniform sampler2D colorsTex, 379 uniform sampler2D ssaoTex, 380 uniform float2 filterOffs[NUM_SSAO_FILTERSAMPLES], 381 uniform float filterWeights[NUM_SSAO_FILTERSAMPLES] 382 ) 383 { 384 pixel OUT; 385 386 float4 col = tex2Dlod(colorsTex, float4(IN.texCoord, 0, 0)); 387 float4 ao = tex2Dlod(ssaoTex, float4(IN.texCoord, 0, 0)); 388 389 //if (ao.y < 10.0f) ao.x = Filter(IN.texCoord, ssaoTex, filterOffs, filterWeights); 390 391 //OUT.illum_col = col * ao.x; 392 //OUT.illum_col = float4(ao.y, ao.y, ao.y, col.w); 393 //OUT.illum_col = float4(ao.x, ao.x, ao.x, col.w); 394 OUT.illum_col.xyz = float3(1.0f - ao.x, 1.0f - ao.y * 1e-2f, 1); 395 //OUT.illum_col.xyz = float3(1.0f - ao.x, ao.y, 0); 396 OUT.illum_col.w = col.w; 397 398 return OUT; 399 }
Note: See TracChangeset
for help on using the changeset viewer.