Author Topic: Shadows....  (Read 4107 times)

0 Members and 1 Guest are viewing this topic.

Offline Krackers87

  • 158 crew
  • 29
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?
Put this in your profile if you know someone who is fighting, has survived, or has died from an awp no scope.

just like seventies goofballs
he's waiting on last calls
well listen method man
'cause if you leave on the last line
don't leave on the ground kind
born just a little too slow

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
there realy is no way this can be done at all at the moment
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 
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 :>

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
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
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Nico

  • Venom
    Parlez-vous Model Magician?
  • 212
and that would be fugly.
SCREW CANON!

 

Offline Lynx

  • 211
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.
Give a man fire and he'll be warm for a day, but set fire to him and he'll be warm for the rest of his life.

 

Offline FreeTerran

  • Master of the apocalypse
    Reset count: 1
  • 210
Its awesome but not usefull.
Silva in lumine Lunae arcana est. Domos mea Silva in lumine Stellarum est.

 

Offline RandomTiger

  • Senior Member
  • 211
I have an interest in shadows.
But I dont think its really worth trying till we have a HT&L codebase though.

 

Offline Nico

  • Venom
    Parlez-vous Model Magician?
  • 212
Quote
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.
SCREW CANON!

 

Offline IceFire

  • GTVI Section 3
  • 212
    • http://www.3dap.com/hlp/hosted/ce
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.
- IceFire
BlackWater Ops, Cold Element
"Burn the land, boil the sea, you can't take the sky from me..."

 

Offline LAW ENFORCER

  • Turret Fiend
  • 210
    • http://www.armouredstar.com
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)
Conflict GRDLA:
Operation Return To Riker
www.ARMOUREDSTAR.com - the latest site is not finished yet!
[What we have here is the source to the Freespace ENGINE, not the Freespace GAME. By allowing the ENGINE to support all kinds of cool stuff, we're allowing the creation of all new GAMES] - TurboNed

 

Offline Fry_Day

  • 28
Quote
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.
« Last Edit: August 21, 2003, 11:37:08 am by 791 »

  

Offline Flipside

  • əp!sd!l£
  • 212
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

 

Offline Ace

  • Truth of Babel
  • 212
    • http://www.lordofrigel.com
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.
Ace
Self-plagiarism is style.
-Alfred Hitchcock

 
But please, make it so one can turn of the ambient light in the shadow...
When will I learn?  The answer to life's problems aren't at the bottom of a bottle, they're on TV! -- Homer,  "There's No Disgrace Like Home''
I sometimes find myself here on this forum, late at night constantly pressing "Reload" over and over again

 

Offline Flipside

  • əp!sd!l£
  • 212
And, of course, you have to consider how these shadows would react to glowpoints etc?

Flipside :D

 

Offline Krackers87

  • 158 crew
  • 29
Put this in your profile if you know someone who is fighting, has survived, or has died from an awp no scope.

just like seventies goofballs
he's waiting on last calls
well listen method man
'cause if you leave on the last line
don't leave on the ground kind
born just a little too slow

 

Offline Solatar

  • 211

 

Offline Sesquipedalian

  • Atankharz'ythi
  • 211
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?
Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

The Scroll of Atankharzim | FS2 syntax highlighting

 

Offline LAW ENFORCER

  • Turret Fiend
  • 210
    • http://www.armouredstar.com
I think they where thinking of a projected shadow... not shading...
Conflict GRDLA:
Operation Return To Riker
www.ARMOUREDSTAR.com - the latest site is not finished yet!
[What we have here is the source to the Freespace ENGINE, not the Freespace GAME. By allowing the ENGINE to support all kinds of cool stuff, we're allowing the creation of all new GAMES] - TurboNed