Light Map

Light Map

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

User avatar
aGorm
Posts: 2928
Joined: 12 Jan 2005, 10:25

Light Map

Post by aGorm »

I was wondering... would it be possible to have some sort of light map implamented?

Expalanation (cause im using the wrong name probablie, and it may mean somthing totaly different...)

Basicly just a mask that covers the whole world, letting more light in some places than others... How to explane? If you were in a forest you would have light stippeling through the trees onto the ground.

As a suggestion of how it would work...

You can assign a bmp, were dark = shadows and light = lighter.
You can set how much yopu want these shadows to appear as possible a percentage of the current shadow on ground value (or just keep it seperate)

You can either have one map for the whole map, or set it to tile over and over again, and you can assign a value to how many repeates you want.

how hard to add in??

aGorm
IMSabbel
Posts: 747
Joined: 30 Jul 2005, 13:29

Post by IMSabbel »

of course that would be possible, but it would colldide with the deformable terrain, i think.

Not to mention that it would make maps A LOT larger. Really a lot. shadowmapping isnt that well suited for outdoors, and especially for games with such a broad zoom range as spring.
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

If there should be any kind of lighting it should be just local hardware vertex lighting. I agree with IMSabbel that shadowmapping (eh we have shadow mapping right now... you mean the Quake style precomputed light maps? Hmm it's a vague term anyway, are you mapping shadows or are you mapping light :wink: ) is not fitted for spring.
Earth 2160 does lighting pretty well by the way. It should be quite possible to let units have small lights and keep a good framerate.
User avatar
aGorm
Posts: 2928
Joined: 12 Jan 2005, 10:25

Post by aGorm »

I mean in the vein of... like a mask over the whole maps lightsource. So naturally shaddows etc will blend in with the shadows created but the mask that stops light getting were it would normaly be going? Am I making any sort of sence??

Obviosly you would make it so as you zoomed out the effect disapered... so that it only worked when you were relativly close to the ground...

aGorm
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

like IMSabbel says, it's possible but it's just not suited for spring. The increased mapsize, memory use and lowered performance is not worth the small visual improvement.
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

ohh, that's what you meant

Post by Pxtl »

I misunderstood to think he wanted Doom/Cube style "lighting zones" available. Not prerendered lightmaps.

Although it did give me one idea - cloud lighting. Change the lighting of the maps as if clouds were passing overhead. So you get gradual waves of light and shadow passing over areas.
User avatar
Weaver
Posts: 644
Joined: 07 Jul 2005, 21:15

Post by Weaver »

Everything that should make a shadow does, so I don't understand what effect you trying to create. You can depen shadows by adjusting values in the SMD but I am sure you know this.

Do you mean that there should be a reduction in ambient light thre deeper into shadows you go? So one tree wont do much but being in the middle of a forest will, that might be interesting, I've no idea if it could be done though.
User avatar
aGorm
Posts: 2928
Joined: 12 Jan 2005, 10:25

Post by aGorm »

What I mean.... (which i doubt would make a performance hit and certainly not increase map size by any vast amount Zaphod, or not to my knoledge)

Basicly:

Currently when light hits the ground, its in one great big solid blanket. IE, there are no cloud shadows, so shadows from things above the camera that you cant actully see, but my point being that it does not mean there not there.

Now, correct me if I'm rong, but I'm sure that this effect is used in older games to make up for the fact that it cant do real lighting effects. The idea of using a mask (just simple b&w) which is used as a map for if the light counts as on or off at a certain point.

I know this aint the best way of describing it but its teh only way i got...

I can change the density of the shadows that are created by things that are there (like hills, trees, units ect...) but i wanted to be able to have a set of shadows already on the floor, befor working out all teh other ones.

So for instance.... I could make a totaly flat map with nothing in it.
Then apply this light mask/map whatever you want to call it.
And suddenly, dispite the fact there should be no shadows, it has some areas in shadow, as if someone was holding a bit of perspex with black marker pen on it infron of the light bulb.

Shurly that would not be resorce intensive??!?
And certainly not increas map size. (Im not suggesting all maps would have or need one of these anyway.)

aGorm
User avatar
Weaver
Posts: 644
Joined: 07 Jul 2005, 21:15

Post by Weaver »

You could make this part of your main texture... But a full map shader layer at metal map size could be useful for many things and would not be too big. It would need some ingame smoothing but thats possible.
User avatar
Decimator
Posts: 1118
Joined: 24 Jul 2005, 04:15

Post by Decimator »

Best thing would probably be if the shadowmap was similar to the heightmap and such in that it was 1/8th the size of the texture, then the game should smooth it on the first run of the map.
User avatar
GrOuNd_ZeRo
Posts: 1370
Joined: 30 Apr 2005, 01:10

Post by GrOuNd_ZeRo »

Hmm cloud shadows would be awesome, it's something Spring is sorely missing right now, it should probably not be visible in skyboxed maps so you wont get cloud shadows on core prime.
User avatar
munch
Posts: 311
Joined: 26 May 2005, 20:00

Post by munch »

GrOuNd_ZeRo wrote:Hmm cloud shadows would be awesome, it's something Spring is sorely missing right now
You know what? I don't think Spring is sorely missing anything - all the important stuff is there right now. The main issues for me are really things like stability. My humble machine doesn't do shadows at all, I do miss not having terrain shading (hard to see where the craters are), but I'm not at all fussed about not having shadows and certainly can live without shadows of clouds etc.

Just my tuppence

Munch
User avatar
aGorm
Posts: 2928
Joined: 12 Jan 2005, 10:25

Post by aGorm »

This is ofcours ... in the intrest of making the game as versatial as possible. You see, if you expande the idea some what, theres no reason to not think you could have this map in colour, and then you'll be able to do different colour lighting in different areas, as well as differnt levels of lighting. For instance if you had a volcano map, you may want teh ligting inside the volcano to be red, but curently this means changing the whole maps lighting.

Yes I could in theory just overlay the shadows onto teh ground texture, but
1) it wont effect units
2) it will make the texture way harder to compress well, incresising the file size probablie more than just having a extra map.

aGorm
Dwarden
Posts: 278
Joined: 25 Feb 2005, 03:21

Post by Dwarden »

just additional HiDefinity package (extension) for maps / units etc :)
User avatar
Min3mat
Posts: 3455
Joined: 17 Nov 2004, 20:19

Post by Min3mat »

don't u use ground decals munchgreeble? they show craters etc up and dont need that much power
CaptainMaim
Posts: 265
Joined: 04 Sep 2005, 01:25

Post by CaptainMaim »

Yeah, I was thinking about cloud mapping as well...

Couldn't you just use the skybox itself to help define that? Or that dynamic clouds feature? If the game just generates clouds to roll passed the point where the sun is supposed to be it could just render the cloud's shadows at run time.. or something like that... Something that's done at runtime would be better I think.. Don't you?

I dunno if this is precisely the best place to put this, but speaking of shadows. I just got a nice GE Force 6600 and finally got to look at the unit shadows (which in my opinion makes the game look 100% more realistic.) However, if I activate LOS it disables shadows. And that makes me sad. :(
User avatar
GrOuNd_ZeRo
Posts: 1370
Joined: 30 Apr 2005, 01:10

Post by GrOuNd_ZeRo »

does your card support shadows in fullscreen mode? mine doesn't :(
User avatar
aGorm
Posts: 2928
Joined: 12 Jan 2005, 10:25

Post by aGorm »

Come on bump this is a serios point that we need to discuss.

>CaptainMaim what if you were using a custom sky box (which I prob would be) then the cloud system could not be used, and youd have to have some way to specify with some sort of map...

aGorm
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

What if the skybox could be used with the clouds overlayed ontop moving as an option in the mapconfig, maybe at a very high height that no unit could reach but not on the infinite, I guess that would generate cloud shadows albeit it might be problematic.

And models having light emmiters could do that aGorm, having a feature that simply emitts red light would do the volcano thing fine.
User avatar
aGorm
Posts: 2928
Joined: 12 Jan 2005, 10:25

Post by aGorm »

KK, but that does not help out woth the whole light through the trees thing.


aGorm
Post Reply

Return to “Engine”