- Timestamp:
- 09/01/08 08:58:38 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
r2890 r2891 4 4 // Screen Spaced Ambient Occlusion shader 5 5 // based on shader of Alexander Kusternig 6 7 6 8 7 … … 22 21 23 22 24 float2 reflect(float2 pt, float2 n)23 float2 myreflect(float2 pt, float2 n) 25 24 { 26 25 // distance to plane … … 57 56 for (int i = 0; i < NUM_SAMPLES; ++ i) 58 57 { 59 const float2 offset = samples[i]; 58 //const float2 offset = samples[i]; 59 const float3 offset = float3(samples[i], 0); 60 60 61 61 //////////////////// … … 63 63 64 64 //const float2 mynoise = tex2D(noiseTexture, IN.texCoord.xy * noiseMultiplier).xy * 2.0f - 1.0f; 65 float2 mynoise = tex2D(noiseTexture, IN.texCoord.xy * noiseMultiplier).xy; 65 //float2 mynoise = tex2D(noiseTexture, IN.texCoord.xy * noiseMultiplier).xy; 66 float3 mynoise = float3(tex2D(noiseTexture, IN.texCoord.xy * noiseMultiplier).xy,0); 66 67 67 68 const float2 offsetTransformed = reflect(offset, mynoise); … … 123 124 // expand normal 124 125 float3 normal = normalize(norm.xyz); 126 125 127 /// the current view direction 126 //float3 viewDir = normalize(IN.view * 2.0f - float3(1.0f)); 127 float3 viewDir = normalize(IN.view); 128 float3 viewDir;// = normalize(IN.view); 128 129 129 130 // the current world position … … 182 183 float4 ao = tex2D(ssaoTex, IN.texCoord.xy); 183 184 184 //OUT.illum_col = col * ao.x;185 OUT.illum_col = ao;185 OUT.illum_col = col * ao.x; 186 //OUT.illum_col = ao; 186 187 187 188 OUT.illum_col.w = ao.w;
Note: See TracChangeset
for help on using the changeset viewer.