Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Krackers87 on August 20, 2003, 11:35:36 pm
-
That could be the next big thing in fs open, it would be really sweet too.
Im not a programmer but it could work something like this:
Check to see if object is infront of light sorce then make textures darker for whichever part is behind light sorce on the same or another ship. Also have the shadow created by the ship increase exponantialy with distance but it also gets lighter with distance until it gets far enough to when it becmes normal color textures again.
ex: Hecate (because of all of its jagged parts sticking out) shadows itself by 75% (make it 75% darker).
ex2: Hercules is 50 meteres away from orion where orion is between light source and hercules.
S-------O-h
Hercules is currently 75% darker. Hercules flies to 500 meteres away from orion and away from light source so it is still dwarfed by the orion.
S-------O---h
Hercules is now 65% darker. Then hercules flies to 1000 meteres in the same direction and becomes only 55% darker and so on.
To make things more complicated (and cool looking) have the shadow distance and darkness releative to the size of the ship.
Ex: ShipA is 32x28x9 meteres big.
so (32*28*9)*.02 = 161.28 meters. so the distance from the ship to where its shadow cast is 0% is 161.28 meteres.
Again to make things more complicated you could base the shadow on how the ship is facing.
Ex: ShipA is 32x28x9 metres but it is facing straight up and down against an orion. So its shadow is only 32x28 metres. So it would cast to a distance of (32*28)*.2 = 179.2 metres until the shadow becomes 0% cast. But if it was facing right parrallel against the orion you would only have a shadow of (32*9)*.2 = 57.6 metres until the shadow becomes 0% cast.
also for other cool effects you cold distort the shadow so it looks like it is passing over a rough surface instead of a smooth one.and you could have a slight haze around the shadow for realism.
note: darkness would start at 75% no matter how close a ship is to another to compensate for stars reflecting light and other ships.
What do you think?
-
there realy is no way this can be done at all at the moment
-
Hi bobboau,
Along the lines of the original suggestion, would it be possible to achieve self-shading for FS2 models? The soon-to-be-released Lock On: Modern Air Combat has this effect, and it looks quite nice in the game movies I've seen of it so far - it's not done balls-n-all like in Doom 3, but it really makes the aircraft models pop out of the screen.
If self shading was done very harshly in FS2 - ie, any part of a model not in direct line of site to a lightsource would be almost black - I think that'd look totally amazing.
I have no coding experience in this sort of thing so if that's totally stupid, just say so :>
-
FS uses per vertex lighting, so this realy can't be done for a long time, even after the T&L thing gets done this will be a long way away,
I supose i could be posable to make a realy primitive version of this though
but not by me, not now anyway
-
and that would be fugly.
-
You can already do black shadows: Just create a new sun in stars.tbl and give it negative values, like e.g. -2 -2 -2 -2 or something, and place it at the same spot as the normal sun in FRED, et voilĂ , here you have black shadows.;)
I have a question: Would it be possible to give the shadows a higher resolution? It would be kinda cool if smaller details would too cast a proper shadow; it mustn't be such an overkill like in I-War2, but it could be a bit more accurate.
And it appears to me as if the lighting is better on round or curved surfaces. And it looks to me as if the engine uses the same shadowcasting on big flat surfaces, it looks a bit funny when the surface should be fully lit but it starts to get darker at some point.
-
Its awesome but not usefull.
-
I have an interest in shadows.
But I dont think its really worth trying till we have a HT&L codebase though.
-
Originally posted by Lynx
You can already do black shadows: Just create a new sun in stars.tbl and give it negative values, like e.g. -2 -2 -2 -2 or something, and place it at the same spot as the normal sun in FRED, et voilĂ , here you have black shadows.;)
I have a question: Would it be possible to give the shadows a higher resolution? It would be kinda cool if smaller details would too cast a proper shadow; it mustn't be such an overkill like in I-War2, but it could be a bit more accurate.
And it appears to me as if the lighting is better on round or curved surfaces. And it looks to me as if the engine uses the same shadowcasting on big flat surfaces, it looks a bit funny when the surface should be fully lit but it starts to get darker at some point.
that's not shadows, that's unlit sides.
here, it's "casted" shadows it's all about, for exemple, the turrets of the orion will cast their own shadows on the orions hull, or the shadow of the perseus that flyes between the sun and the orion will be drawn on the orions hull.
These kinds of shadows are awful resource eaters.
-
There's a reason why only Lock On: Modern Air Combat has been able to achieve this effect and thats because their graphics enging is alot more advanced not to mention that the effect only works on the most powerful of the DX8 and DX9 enabled video cards and that they had trouble getting it to work on any of them in the first place. LOMAC is cutting edge, the FS engine is much older...we should be impressed with effects like glow maps and the specular highlighting.
-
we are impressed :D
but when we see a wing of fighters fly over the hull of a ship and cast full shadows onto it well die from heat attacks;)
(and so will space game devs :D)
-
And it appears to me as if the lighting is better on round or curved surfaces. And it looks to me as if the engine uses the same shadowcasting on big flat surfaces, it looks a bit funny when the surface should be fully lit but it starts to get darker at some point.
You are correct, of course, since per-vertex lighting attempts to simulate round surfaces, since there is actually no such thing as a normal for a vertex. It's an attempt to approximate lighting for a curved surface formed from the vertices in all the polygons who touch the vertex in question. That's just the way it is. So, it's not physically or mathematically correct. Who cares? :)
About shadows, I'd think that if it were done, shadow maps would be the way to go, since they're a whole lot more scalable than stencil shadows (if your computer is too slow, you use a lower-resolution map), and do shadows only for suns. That way the preformance hit shouldn't be too bad (since each point light requires drawing the whole scene 6 times with only Z-buffering enabled, while a directional light reuiqres only once), and, if you've seen splinter cell, you know that shadow maps can look cool.
-
It would be great to see to be honest, but I think that, while eye candy has it's place, the glowmaps and specular maps already pull FS2 out of the 90's. I expect it would be quite low on a list of priority enhancements to FS2 :)
Flipside :D
-
I do think if possible it would be a good idea to have full dynamic shadows, but it would require some radical changes to the lighting system.
-
But please, make it so one can turn of the ambient light in the shadow...
-
And, of course, you have to consider how these shadows would react to glowpoints etc?
Flipside :D
-
they wouldnt
-
And why not.:doubt:
-
If we have shine maps now that make polies facing a light source brighter, we therefore already have the equivalent of darker shadows being cast on those polies which are not. It is all relative. Why reinvent the wheel that Bobboau just invented last week?
-
I think they where thinking of a projected shadow... not shading...
-
...which has been discussed before as not possible without a tremendous sacrafice in performance or a complete graphics overhaul. While it may happen eventually, I'm not forseeing it in the near future no matter how much people bang and scream for it. And unless I'm mistaken, as lighting is done on a per-vertex basis, a projected shadow (for each light source no less) would end up looking pointless on 99% of larger models. The polygons would either be full-lit, or shadowed, and the only contour that you could see would be of the polygons on the ship recieving the shadow rather than the shape of the casting ship.
-
Originally posted by Solatar
And why not.:doubt:
because a glow point is technicaly a light source itself.
you cant cast a shadow on a light bulb when its on.
Anmd the only shadow making light sources are suns. the 75% darkness maximum is meant to simulate lights from stars and other ships.