Great, that was exactly that kind of trick i was looking for.
However, i don´t understand how it really works.
I have a float, to be exactly a depth-value, which is between 0 and 1. Say it would be 0.5;
Tom does this:
PARAM pack = { 1, 256, 65536, 16777216 };
Squeeze the length into an RGB color.
MUL len, len, pack;
FRC result.color, len;
However, after the mul, i would have the values
{0.5, 128, 32768, 8388608}
And after the fraction, i would get
{0.5, 0, 0, 0}
So now, i am where i was at the beginning. I want to represent 0.5 with 32 bit precision, but it only gets put into the red-value, with 8 Bit precision.
I will take a look into this method, maybe i am able to get this working myself, since i got the general idea now, but i assume, that Tom´s shader is not supposed to work with [0,1] ranged values, but with greater values.
So, if anyone can give me even more hints, that would be cool.
Thanks,
Jan.