jermi on 26/2/2005 at 23:35
Of course the first things I have to try are those things they specifically tell you
not to do in the docs and tuts. So ... these shadows are generated by a ring of 16 shadow-casting omni lights:
Inline Image:
http://jermi.dyndns.org/~jermi/stuff/Thief/softshadows.jpg Yes, it totally kills the frame rate, but it still looks impressive when you move the light source.
Kaleid on 26/2/2005 at 23:44
Hot damn, very nice.
epithumia on 26/2/2005 at 23:47
Just for the record, could you quantify "totally kills"? What rate on what graphics card? I mean, if it could run at 10 or 15 FPS on a Geforece 59xx class card then I wouldn't find it all that bad but 5 FPS would be useless.
Gingerbread Man on 27/2/2005 at 00:40
I would imagine that a light set-up of that sort would drop you into (or damn close to) the seconds-per-frame range on virtually all but the highest-end machines.
Certainly if you did much else with the architecture or put any AI in there. Send a torch-carrying guard through that and your computer would burst into flames. :D
Aja on 27/2/2005 at 01:09
Is there a compromise between the razor-sharp shadows of TDS and these beautiful ones?
Komag on 27/2/2005 at 02:46
Well, you could make a ring of 5 lights instead of 16, but then it will still only work in one direction, and with that few lights the "softness" would start to look odd. It's really just a rediculous trick, being wholly impractical
dracflamloc on 27/2/2005 at 03:14
Could you upload that file as a "stress-test"?
I want to see how my system handles it.
jermi on 27/2/2005 at 10:12
According to Fraps the numbers are ...
* 1 light, shadows off: 180-190 fps
* 16 lights, shadows off: ~25 fps
* 16 lights, shadows on: ~4 fps
This with Athlon2800+ & 9600XT. And this scene is obviously quite sparse. More meshes in the room equals more shadow volumes equals less fps. So yes, it's very impractical indeed. Maybe you could do this in a confined space with 4-5 lights with a short light radius, but when you get it scaled down so that it almost works from a performance point of view, it stops being impressive. When they tell you to minimize the number of lights, light radiuses, shadow volumes and shadow-casting meshes etc., they're not kidding. After this experiment, null's instructions seem wise: first turn shadows off for all meshes, then turn on the shadows you need, one by one.
The setup is trivial, but here's (
http://kotisivu.mtv3.fi/jermi/Thief/softshadows.unr) the file.
dracflamloc on 27/2/2005 at 11:37
Well, technically those aren't "soft shadows" by definition as far as programming goes. But it is interesting how much multiple shadows kill framerate ingame. In the editor its actually very smooth on my geforce 6800gt, but ingame its slow. Since my proc is only a 2.4ghz P4 I would assume the bottleneck is the CPU, and the algorithm they are using to detect if garret is within the shadows or not.
A soft shadow, programmatically, is actually just a single shadow, with a fading algo used to blur/blend the edges, which is actually faster than casting multiple shadows, (though still quite slow). Soft shadows are actually usable in games provided they are used sparingly. Many game engines over the past year or so have used soft shadows for the character shadows. Of course those are only using lightmaps and so the only things dynamic are the characters shadows themselves.
Fingernail on 27/2/2005 at 11:41
Indeed, it's faking it by creating multiple shadows each slightly differently placed, but each sharp, it's just that when viewed with that many lights, it creates a gradiant effect. You can do similar things in D3, but it's just not particularly worth it. There are other ways to make softer shadows in D3...
Still, when hardware catches up... :wot: