Can LUA fix the !(@#(!@ Shadowmap?

Can LUA fix the !(@#(!@ Shadowmap?

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Can LUA fix the !(@#(!@ Shadowmap?

Post by Argh »

I mean, c'mon now, really! Is there a way to fix the shadowmap, so that resolution of the map, in pixels, has a direct correlation with the detail of the shadowmap as drawn on the map's surface, per frame?

Or does that shader need to be re-written to work with the camera correctly, or what? I just think it's ridiculous that games like DoW have figured out how to have nice, crisp, picture-perfect shadows at whatever zoom the engine supports, yet Spring's shadows look progressively worse as the camera approaches the ground, which suggests that something is seriously wrong with the way that the shadowmap is being applied to geometry in the scene... I know this seems like a stupid thing, but it's not! Objects with fine details on their geometry look like crap at high zoom levels, because the shadows don't match the objects at all, or we end up with "phantom pixels" of giant, dark blocks from teeny-tiny objects like antennas, etc.!

If it's an issue with the way that shadows are drawn on the terrain... can we maybe have a new method, where it "burns in" the shadowmap, at, say, 16X heightmap resolution, and applies only the patches to areas within the POV, using mipmaps or something to keep performance from taking a nosedive? There's gotta be a way- heck, I'd even prefer some sort've pre-burned shadows as part of the map format, since the sun is in a fixed position presently... but, if we can move it in the future, then this problem really has to get solved somehow...


Ahh... I've got it! "Just" have the shadowmap that's burned during the map-loading process use the sun's angle, etc., like it currently does, then run a shader-based gaussian blur and create alpha levels depending on angle! Then have the shadows run during the simulation not shade the terrain... for most terrains, that'd produce nice, smooth shadows that looked good even up close... then have the Unit / Feature shadowmap move with the camera, and that way we'd have 1-bit, very sharp shadows that scaled with distance and were still fast! Betcha that'd look a lot better than what we have now, with minimal performance hit...
User avatar
aGorm
Posts: 2928
Joined: 12 Jan 2005, 10:25

Post by aGorm »

And then as teh terrain deforms you get odd shadows... You didn't think that last bit through!

:-)

aGorm
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Post by zwzsg »

trepan wrote:Try "/shadows 1 4096" to bump up your shadowmap size.
Avoid grainy shadows if your card supports larger maps, it
was the first thing I noticed when I saw the [...]
User avatar
LOrDo
Posts: 1154
Joined: 27 Feb 2006, 00:21

Post by LOrDo »

Good looking shadows in Spring? Balsphemy!
User avatar
Abokasee
Posts: 222
Joined: 03 Nov 2006, 21:51

Post by Abokasee »

LOrDo wrote:Good looking shadows in Spring? Balsphemy!
DOWN WITH THE GREEDY CHURCH OF SPRING!!!
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

And then as teh terrain deforms you get odd shadows... You didn't think that last bit through!
Oops, you're entirely right! Well, I never use the terrain-deformation stuff anyhow, because I think it's evil. So I forgot about it. Drat :oops:

As for "/shadows 4096", etc... I've tried that, and it doesn't work as advertised, when tested.
Post Reply

Return to “Lua Scripts”