Ignore:
Timestamp:
09/24/08 11:08:13 (16 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

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

    r2967 r2968  
    2121 
    2222 
    23 float3 ToneMap(const float imageKey, float3 color) 
     23float3 ToneMap(float imageKey, float whiteLum, float3 color) 
    2424{ 
    2525        float3 outCol; 
     
    2929        const float lum = MIDDLE_GRAY * pixLum / imageKey; 
    3030          
    31     // map to range 
    32         const float scaledLum = lum / (1.0f + lum); 
    33  
    34     /*outCol *= MIDDLE_GRAY / (vLum + 1e-3f); 
    35     outCol *= (1.0f + vColor / LUM_WHITE); 
    36         outCol /= (1.0f + vColor);*/ 
     31        // map to range and calc burnout 
     32        const float burnedLum = lum * (1.0f + lum / whiteLum * whiteLum) / (1.0f + lum); 
    3733         
    38         outCol = color * scaledLum; 
     34        outCol = color * burnedLum / pixLum; 
    3935        //vColor.rgb += 0.6f * vBloom; 
    4036         
     
    4238} 
    4339 
     40 
    4441float4 main(v2p IN,  
    4542                        uniform sampler2D colors, 
    4643                        uniform sampler2D normals, 
    47                         uniform float imageKey 
     44                        uniform float imageKey, 
     45                        uniform float whiteLum 
    4846                        ): COLOR 
    4947{ 
     
    115113 
    116114        //return float4(w); 
    117         col.xyz = ToneMap(imageKey, col.xyz); 
     115        col.xyz = ToneMap(imageKey, whiteLum, col.xyz); 
    118116 
    119117        return col; 
Note: See TracChangeset for help on using the changeset viewer.