that's how the terrain shadow baker from AU works. but you won't believe how slow a complete c_trace for a 512*512 array is (262144 traces per image and object-> 30 fps minimum->almost 8 million traces/s (with only one object to be shadowed, like terrain) with a function that's marked as "slow"). so it's only usable for baking.