why not store the depth in blue and green as well?

Gives you a 256*4= 1024 byte range if you used addition. Pseudo-code:
Code:

out_color.r = clamp(depth , 0, 255);
out_color.g = clamp(depth-256, 0, 255);
out_color.b = clamp(depth-512, 0, 255);
out_color.a = clamp(depth-768, 0, 255);




...or you could use multiplication? giving you a 256+512+1024+2048= 3840 range (at least).Pseudo-code:
Code:

out_color.r = clamp(depth , 0, 255); // 0 - 255
out_color.g = clamp((depth-256)/2 , 0, 255); // 255 - 768
out_color.b = clamp((depth-768)/4 , 0, 255); // 769 - 1792
out_color.a = clamp((depth-3840)/8, 0, 255); // 1793 - 3840



...I'd give it a try, but I don't have my computer anymore, so I can't do shaders. Otherwise I'd be all over SSAO & shadowmapping


xXxGuitar511
- Programmer