Ignore:
Timestamp:
10/02/08 17:34:10 (16 years ago)
Author:
mattausch
Message:

tone mapping working with using reconstructed depth

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

    r2991 r2992  
    7676        // an ambient color term 
    7777        float amb = color.w; 
    78  
    7978        float3 normal = normalize(norm.xyz); 
    80  
    8179        float4 col = shade(IN, color, position, normal, amb, lightDir); 
    8280         
    8381        OUT.color = col; 
    8482         
    85 #if 0 
     83#if 1 
    8684 
    8785        OUT.color.w = color.w; 
     
    217215        //-- write out logaritmic luminance for tone mapping 
    218216 
    219 #if 0 
    220  
     217#if 1 
    221218        OUT.color.w = color.w; 
    222  
    223219#else 
    224220 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg

    r2991 r2992  
    4242 
    4343 
     44// reconstruct world space position 
    4445inline float3 ReconstructSamplePosition(float3 eyePos,  
    4546                                                                                uniform sampler2D colors, 
     
    4748                                                                                float3 bl, float3 br, float3 tl, float3 tr) 
    4849{ 
    49         /*float eyeSpaceDepth = tex2Dlod(colors, float4(texcoord, 0, SSAO_MIPMAP_LEVEL)).w; 
    50                  
    51         // reconstruct world space position 
     50        float eyeSpaceDepth = tex2Dlod(colors, float4(texcoord, 0, SSAO_MIPMAP_LEVEL)).w; 
    5251        float3 rotView = normalize(Interpol(texcoord, bl, br, tl, tr)); 
    53         float3 sample_position = eyePos - rotView * eyeSpaceDepth;*/ 
    54         float3 sample_position = tex2Dlod(colors, float4(texcoord, 0, SSAO_MIPMAP_LEVEL)).xyz; 
     52         
     53        float3 sample_position = eyePos - rotView * eyeSpaceDepth; 
     54        //float3 sample_position = tex2Dlod(colors, float4(texcoord, 0, SSAO_MIPMAP_LEVEL)).xyz; 
    5555 
    5656        return sample_position; 
     
    174174 
    175175        //const float2 ao = ssao(IN, positions, noiseTexture, samples, normal, centerPosition, w, viewDir, eyePos); 
    176         const float2 ao = ssao(IN, positions, noiseTexture, samples, normal, centerPosition, w, eyePos, bl, br, tl, tr); 
     176        const float2 ao = ssao(IN, colors, noiseTexture, samples, normal, centerPosition, w, eyePos, bl, br, tl, tr); 
    177177                 
    178178 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/tonemap.cg

    r2991 r2992  
    114114        pixel OUT; 
    115115 
     116        float4 color = tex2Dlod(colors, float4(IN.texCoord.xy, 0, 0)); 
     117 
     118        OUT.col = color; 
     119 
    116120        // the old loglum is stored in the hightest mipmap-level 
    117         float4 color = tex2Dlod(colors, float4(IN.texCoord.xy, 0, 0)); 
    118121        float oldLogLum = tex2Dlod(colors, float4(IN.texCoord.xy, 0, MAX_LOD_LEVEL)).w; 
    119122 
     
    127130        float logLumScaled = logLum * INV_LOGLUM_RANGE - logLumOffset; 
    128131 
    129         OUT.color = color; 
     132        if (oldLogLum > 0) 
     133                OUT.col.w = lerp(oldLogLum, logLumScaled, 0.1f); 
     134        else 
     135                OUT.col.w = logLumScaled; 
    130136 
    131         if (oldLogLum > 0) 
    132                 OUT.color.w = lerp(oldLogLum, logLumScaled, 0.1f); 
    133         else 
    134                 OUT.color.w = logLumScaled; 
     137        return OUT; 
    135138} 
Note: See TracChangeset for help on using the changeset viewer.