Ignore:
Timestamp:
09/01/08 08:58:38 (16 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg

    r2890 r2891  
    44// Screen Spaced Ambient Occlusion shader 
    55// based on shader of Alexander Kusternig 
    6  
    76 
    87 
     
    2221 
    2322 
    24 float2 reflect(float2 pt, float2 n) 
     23float2 myreflect(float2 pt, float2 n) 
    2524{ 
    2625        // distance to plane 
     
    5756        for (int i = 0; i < NUM_SAMPLES; ++ i)  
    5857        { 
    59                 const float2 offset = samples[i]; 
     58                //const float2 offset = samples[i]; 
     59                const float3 offset = float3(samples[i], 0); 
    6060 
    6161                //////////////////// 
     
    6363 
    6464                //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); 
    6667 
    6768                const float2 offsetTransformed = reflect(offset, mynoise); 
     
    123124        // expand normal 
    124125        float3 normal = normalize(norm.xyz); 
     126         
    125127        /// 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); 
    128129 
    129130        // the current world position 
     
    182183        float4 ao = tex2D(ssaoTex, IN.texCoord.xy); 
    183184 
    184         //OUT.illum_col = col * ao.x; 
    185         OUT.illum_col = ao; 
     185        OUT.illum_col = col * ao.x; 
     186        //OUT.illum_col = ao; 
    186187 
    187188        OUT.illum_col.w = ao.w; 
Note: See TracChangeset for help on using the changeset viewer.