- Timestamp:
- 09/24/08 11:08:13 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/antialiasing.cg
r2967 r2968 21 21 22 22 23 float3 ToneMap( const float imageKey, float3 color)23 float3 ToneMap(float imageKey, float whiteLum, float3 color) 24 24 { 25 25 float3 outCol; … … 29 29 const float lum = MIDDLE_GRAY * pixLum / imageKey; 30 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);*/ 31 // map to range and calc burnout 32 const float burnedLum = lum * (1.0f + lum / whiteLum * whiteLum) / (1.0f + lum); 37 33 38 outCol = color * scaledLum;34 outCol = color * burnedLum / pixLum; 39 35 //vColor.rgb += 0.6f * vBloom; 40 36 … … 42 38 } 43 39 40 44 41 float4 main(v2p IN, 45 42 uniform sampler2D colors, 46 43 uniform sampler2D normals, 47 uniform float imageKey 44 uniform float imageKey, 45 uniform float whiteLum 48 46 ): COLOR 49 47 { … … 115 113 116 114 //return float4(w); 117 col.xyz = ToneMap(imageKey, col.xyz);115 col.xyz = ToneMap(imageKey, whiteLum, col.xyz); 118 116 119 117 return col;
Note: See TracChangeset
for help on using the changeset viewer.