Ignore:
Timestamp:
09/23/08 18:02:33 (16 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders
Files:
3 edited

Legend:

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

    r2891 r2967  
     1#include "../shaderenv.h" 
     2 
    13struct v2p 
    24{ 
     
    1820 
    1921 
     22 
     23float3 ToneMap(const float imageKey, float3 color) 
     24{ 
     25        float3 outCol; 
     26        const float pixLum = 0.2125f * color.x + 0.7154f * color.y + 0.0721f * color.z; 
     27         
     28        // adjust to middle gray 
     29        const float lum = MIDDLE_GRAY * pixLum / imageKey; 
     30          
     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);*/ 
     37         
     38        outCol = color * scaledLum; 
     39        //vColor.rgb += 0.6f * vBloom; 
     40         
     41        return outCol; 
     42} 
     43 
    2044float4 main(v2p IN,  
    2145                        uniform sampler2D colors, 
    22                         uniform sampler2D normals 
     46                        uniform sampler2D normals, 
     47                        uniform float imageKey 
    2348                        ): COLOR 
    2449{ 
     
    86111        float4 sc = tex2Dlod(colors, float4(IN.c.xy, 0, 0)); 
    87112 
    88         return (s0 + s1 + s2 + s3 + sc) * 0.2f; 
     113        float4 col = (s0 + s1 + s2 + s3 + sc) * 0.2f; 
    89114        //return (s0 + s1 + s2 + s3) * 0.25f; 
     115 
    90116        //return float4(w); 
     117        col.xyz = ToneMap(imageKey, col.xyz); 
     118 
     119        return col; 
    91120} 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg

    r2966 r2967  
    1515        float4 color: COLOR0; 
    1616}; 
    17  
    18  
    19  
    20 float3 ToneMap(const float imageKey, float3 color) 
    21 { 
    22         float3 outCol; 
    23         const float pixLum = 0.2125f * color.x + 0.7154f * color.y + 0.0721f * color.z; 
    24          
    25         // adjust to middle gray 
    26         const float lum = MIDDLE_GRAY * pixLum / imageKey; 
    27           
    28     // map to range 
    29         const float scaledLum = lum / (1.0f + lum); 
    30  
    31     /*outCol *= MIDDLE_GRAY / (vLum + 1e-3f); 
    32     outCol *= (1.0f + vColor / LUM_WHITE); 
    33         outCol /= (1.0f + vColor);*/ 
    34          
    35         outCol = color / scaledLum; 
    36         //vColor.rgb += 0.6f * vBloom; 
    37          
    38         return outCol; 
    39 } 
    4017 
    4118 
     
    7451        const float4 ambient = glstate.light[0].ambient; 
    7552         
     53        return (emmisive < 0.95) ? (ambient + diffuse) * color : color; 
     54 
    7655        //return (saturate(((ambient + diffuse))) * (1.0f - emmisive) + emmisive) * color; 
    77         return saturate((((ambient + diffuse)) * (1.0f - emmisive) + emmisive) * color); 
     56        //return saturate((((ambient + diffuse)) * (1.0f - emmisive) + emmisive) * color); 
    7857} 
    7958 
     
    8665                   uniform sampler2D positions, 
    8766                   uniform sampler2D normals, 
    88                    uniform float3 lightDir, 
    89                    uniform float imageKey 
     67                   uniform float3 lightDir 
    9068                   ) 
    9169{ 
     
    161139                                  uniform sampler2D noiseTexture, 
    162140                                  uniform float2 samples[NUM_PCF_TABS], 
    163                                   uniform float3 lightDir, 
    164                                   uniform float imageKey 
     141                                  uniform float3 lightDir 
    165142                                  ) 
    166143{ 
     
    207184        OUT.color = (emmisive < 0.95) ? (ambient + diffuse) * color : color; 
    208185 
    209         OUT.color.xyz = ToneMap(imageKey, OUT.color.xyz); 
    210  
    211186        // also write out depth component 
    212187        OUT.color.w = color.w; 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/sky_preetham.cg

    r2964 r2967  
    9292        OUT.color = float4(hcol, 1.0); 
    9393 
    94         OUT.color.rgb *= 5e-5f;  
     94        //OUT.color.rgb *= 1e-2f;  
     95        //OUT.color.rgb *= 2e-5f;  
    9596 
    9697        //OUT.worldPos = mul(glstate.matrix.inverse.projection, OUT.position); 
Note: See TracChangeset for help on using the changeset viewer.