27 ms·
Nice example, but ray casting like this is overkill for this effect and with a low number of rays it's pretty inaccurate. I prefer using the technique shown in
by liabru 13y ago
Nice example, but ray casting like this is overkill for this effect and with a low number of rays it's pretty inaccurate.
I prefer using the technique shown in this classic article on 2D soft shadows:
http://archive.gamedev.net/archive/reference/programming/features/2dsoftshadow/ http://archive.gamedev.net/archive/reference/programming/fea...
The basic idea is to project the geometry, rather than ray cast. I've implemented this sort of technique in the past and it works well.