Ignore:
Timestamp:
09/26/08 22:36:20 (16 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders
Files:
2 edited

Legend:

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

    r2977 r2978  
    8787        //-- write out logaritmic luminance for tone mapping 
    8888 
    89         float4 oldColor = tex2Dlod(colors, float4(IN.texCoord.xy, 0, 99)); 
     89        float4 oldColor = tex2Dlod(colors, float4(IN.texCoord.xy, 0, MAX_LOD_LEVEL)); 
    9090 
    9191        const float3 w = float3(0.299f, 0.587f, 0.114f); 
     
    157157                                  uniform sampler2D noiseTexture, 
    158158                                  uniform float2 samples[NUM_PCF_TABS], 
    159                                   uniform float3 lightDir 
     159                                  uniform float3 lightDir, 
     160                                  uniform sampler2D oldColors 
    160161                                  ) 
    161162{ 
     
    201202        OUT.color = (emmisive > 1.5f) ? color: (ambient + diffuse) * color; 
    202203 
     204 
    203205        //////////// 
    204206        //-- write out logaritmic luminance for tone mapping 
    205207 
     208        float4 oldColor = tex2Dlod(colors, float4(IN.texCoord.xy, 0, MAX_LOD_LEVEL)); 
     209 
    206210        const float3 w = float3(0.299f, 0.587f, 0.114f); 
    207211 
     
    212216        float logLumScaled = logLum * INV_LOGLUM_RANGE - logLumOffset; 
    213217 
    214         OUT.color.w = logLumScaled; 
     218        if (oldColor.w > 0) 
     219                OUT.color.w = lerp(oldColor.w, logLumScaled, 0.2f); 
     220        else 
     221                OUT.color.w = logLumScaled; 
    215222         
    216223        return OUT; 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg

    r2975 r2978  
    5252        float numSamples = 0; 
    5353 
     54        // avoid singularity of  
     55        centerPosition.xyz += currentNormal * 1e-4f; 
     56 
    5457        for (int i = 0; i < NUM_SAMPLES; ++ i)  
    5558        { 
     
    8285                const float cos_angle = max(dot(direction_to_sample, currentNormal), 0.0f); 
    8386 
    84                 // distance between current position and sample position controls AO intensity. 
    8587                const float distance_intensity =  
    8688                        (SAMPLE_INTENSITY * DISTANCE_SCALE) / (DISTANCE_SCALE + length_to_sample * length_to_sample); 
Note: See TracChangeset for help on using the changeset viewer.