I haven't worked with shaders before so I can't quite follow what's happening with the unit shadows.
If I understand it right the attached code works on the vertices written (or about to be written?) to the modelview. Does that mean units can self-shadow or not?
If I change to do a shadow per-piece will this look awful? Are unit models set up to handle this sort of thing? What about per-mesh?
Is it going to be the case that models really need to be designed for self-shadows? What do you think about a per-unit config for shadows (ie, the FBI or model Lua file says whether you want per-unit, per-piece, per-mesh or no shadow for a given unit)?
If this were a good idea, what would the best default be for units that don't specify? Is it different for S3O / 3DO models?
While I'm on the topic, how does sunlight work in Spring? What specifies the global light direction? Does the engine support spotlights at present (i remember a mod demo that gave units headlights, was this an engine feature or very custom)? Come to think of it was it using real lights or just ground decals.
What improvements to lighting/shadows would you like to see? Since I'm planning to rewrite the renderer anyway it seems a good time to sort this out - especially since Assimp allows lighting (even animated lights) to be imported from supported formats.
Spring shadows and lighting
Moderator: Moderators
Spring shadows and lighting
Last edited by SpliFF on 20 Jan 2010, 05:28, edited 1 time in total.
Re: Spring shadows and lighting
I believe the sun's location is specified in a map's SMD file. I may be wrong, though.
...excuse my drooling.
SpliFF wrote:...Assimp allows lighting (even animated lights) to be imported from supported formats.


...excuse my drooling.
Re: Spring shadows and lighting
Well...
1.) Don't drool on keyboard, you'll short it out.
2.) I'm not promising anything. I'm only asking so my redesign won't make adding them in the future more difficult than it needs to be, and..
3.) Don't get too excited. Even high-end graphics have limits on the number of dynamic light sources. That kind of thing is better suited to FPS where you can limit the number of light sources through clever map design. However that doesn't really rule out a few super-units with search lights like Terminator's HKs

1.) Don't drool on keyboard, you'll short it out.
2.) I'm not promising anything. I'm only asking so my redesign won't make adding them in the future more difficult than it needs to be, and..
3.) Don't get too excited. Even high-end graphics have limits on the number of dynamic light sources. That kind of thing is better suited to FPS where you can limit the number of light sources through clever map design. However that doesn't really rule out a few super-units with search lights like Terminator's HKs

Re: Spring shadows and lighting
I was thinking of of something more like invisible light sources for more decent unit lighting, but giant floodlights work too. 

Re: Spring shadows and lighting
As MidKnight correctly stated, Sun position is specified by the map (cound't tell you which file though).
And no, the engine does not support dynamic lights - you're probably referring to the "night" wigdet, which does something clever to give the impression of spotlights.
All other questions you'll need someone more into the technicals - I can only say I don't see what would hurt about optional self-shadows (quite the opposite
).
And no, the engine does not support dynamic lights - you're probably referring to the "night" wigdet, which does something clever to give the impression of spotlights.
All other questions you'll need someone more into the technicals - I can only say I don't see what would hurt about optional self-shadows (quite the opposite

Re: Spring shadows and lighting
SMD has a Sundir variable given as normals, I think.
Re: Spring shadows and lighting
This is what I remember as well.Das Bruce wrote:SMD has a Sundir variable given as normals, I think.
Re: Spring shadows and lighting
http://springrts.com/wiki/Maps:SMD wrote:Code: Select all
[LIGHT] { SunDir=0 1 2; ... }