Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: A2597 on July 29, 2006, 09:09:17 am

Title: Shadows...
Post by: A2597 on July 29, 2006, 09:09:17 am
I did a search, saw that a year or so ago there was a WiP version of it...

and that 8 months ago someone asked about it again...and it was "A matter of time, but not hte foreseeable future"...

well, 8 months later now. Any word on shadows? That would be, simply put: FRAKING AWESOME!!!!!!!!!!!!!!!!!!!!!!!!
Title: Re: Shadows...
Post by: Kazan on July 29, 2006, 09:48:44 am
they were removed from the engine because they were too farking expensive
Title: Re: Shadows...
Post by: karajorma on July 29, 2006, 09:56:55 am
They were removed from the engine because Bobboau only hacked them in to test what was possible. Shadows wouldn't always be that expensive as Bobboau said he learned lots of things as he was adding them and could see all kinds of optimisations that could be made.

As such the code for shadows was never even submitted to CVS in the first place AFAIK.
Title: Re: Shadows...
Post by: IPAndrews on July 29, 2006, 10:51:28 am
Shadows too expensive? (looks in the direction of Silent Hill 2 on the PS2). This thread has appeared at a good time actually. I was going to ask about this myself. If there's any way the work on stencil shadows can be resumed then I do believe it's well worth doing. Surely they are the last big important visual effect missing from the game engine. I'm imaginging a small ship casting a large shadow over a bigger ship as it passes in front of a star and it looks very impressive indeed. I can imagine it being an enormous pain to implement but it would be the jewel in the crown. What's more, PCs are getting faster day by day so what's expensive now may be insignificant in a couple of years.
Title: Re: Shadows...
Post by: karajorma on July 29, 2006, 11:17:44 am
Like I said I don't think it was the expense so much as the fact that Bobboau knew his code was too shoddy to be committed. Then afterwards he went off to design the material system after which shadows would return in a properly programmed fashion. We're still waiting for both.
Title: Re: Shadows...
Post by: CP5670 on July 29, 2006, 11:38:48 am
IIRC it was actually Dave who originally brought this idea up.

I don't think you would generally notice shadows cast from one ship onto another (they would need to be in just the right positions), but shadows from ships onto themselves would look really neat. The four big guns and two pillar things on the top of the Hecate, for example, could cast shadows on the rest of the ship.
Title: Re: Shadows...
Post by: A2597 on July 29, 2006, 12:13:50 pm
as IPAndrews said, it is the last major visual element really missing from the game. (Shaders are awesome, don't get me wrong!!!)

Just curious if there are plans to revisit them again in the near future really. Would be SWEET! :)
Title: Re: Shadows...
Post by: Mathwiz6 on July 29, 2006, 08:29:38 pm
I agree, it would be a good idea to put them in, for preparation or somesuch.

Eventually hardware will be able to support it, and having a code ready for that time would be nice.
Title: Re: Shadows...
Post by: Mars on July 29, 2006, 08:37:08 pm
And one day there will be real-time photon calculation for games, that doesn't mean they should have the code standing by.
Title: Re: Shadows...
Post by: A2597 on July 29, 2006, 08:39:00 pm
I don't nessasarily mean put the current code in, but maybe revisit them to get them done in a better form...dare I say, even soft shadows? :D
Title: Re: Shadows...
Post by: Nuke on July 30, 2006, 03:53:15 am
dont most current video cards support hardware shadows? i mean seeing as most games sence unreal 2 had shadows, and that they really dont hurt performance that much if you have hardware support for them. shadows just add so much to the game and the imersion hey create in a space sim would be awesome. i think they would look awesome in combination with kazan's planned asteroid revamp.
Title: Re: Shadows...
Post by: Mehrpack on July 30, 2006, 07:06:20 am
dont most current video cards support hardware shadows? i mean seeing as most games sence unreal 2 had shadows, and that they really dont hurt performance that much if you have hardware support for them. shadows just add so much to the game and the imersion hey create in a space sim would be awesome. i think they would look awesome in combination with kazan's planned asteroid revamp.

hi,
shadow isnt shadow.

theres serval ways to make shawdows and there are many types of shadows that you generate / programm.

and shadows need doesnt priceless, shadows need every time resource.
some way more, some way less, but isnt priceless.

but yes self-shadowing of the ships will be nice and shadow of other ships too.

Mehrpack
Title: Re: Shadows...
Post by: CP5670 on July 30, 2006, 10:12:25 am
Quote
shadow isnt shadow.

:wtf: :D
Title: Re: Shadows...
Post by: Chris B. Yond on July 30, 2006, 01:52:42 pm
If they make good use of the "stencil buffer" they won't cost that much performance.

Honestly I don't think we need them at all. There are just three possible situations involving shadow-casting: ship-on-ship, ship-on-station and ship on asteroid in close proximity. And, in theory, you'll need a very bright lightsource to get a detailed shadow. The "casual sun" won't be enough. If we aim for realism, that is...
Title: Re: Shadows...
Post by: Zacam on July 30, 2006, 02:11:20 pm
more like:

ship-on-ship, ship-on-self, ship-on-station, station-on-ship, station-on-self, ship-on-asteroid, asteroid-on-ship, asteroid-on-self

Then add the intricacies of lighting with things other than the ambient light source such as warpholes, beam effects, explosions, etc all to dynamically interact with all of the above.
Title: Re: Shadows...
Post by: DaBrain on July 30, 2006, 02:41:53 pm
Ok.. we got high-res maps, expensive animated effects, spec mapping, glow maps, env mapping and a lot of other things.

There will soon be normal mapping and shader support. Those two will push my mashine to the limit already... self shadows will probably make it unplayable for me.

I don't mind. I won't hold back any feature. I'll probably be able to use all the nice features later with better hardware. So I got something to look forward too. But don't request too much at the same time. Those new features are pefrormance killers! (Excep for pixel shaders, that my speed up things, but I doubt they'll be used only for this. ;) )


Title: Re: Shadows...
Post by: IPAndrews on July 30, 2006, 02:42:28 pm
* looks back at Silent Hill 2 on the PS2 again *
Title: Re: Shadows...
Post by: IPAndrews on July 30, 2006, 03:04:43 pm
Ok, ok. Looks we all appreciate it's very complicated. I think anyone with a brain can consider all the objects in your average game of FS2, all the associated polygons, and all the pesky angles when calculating shadows to them. To be honest I wouldn't know how to approach adding shadows into the game engine. I wouldn't even try. My maths is terrible. I'm not going to assume it's enormously expensive though just because I don't know how to do it. I would imagine the expense is dependent on the poly efficiency of your models. So it would work better in say TBP than it would in BSG (that Battlestar would cause a headache).
Title: Re: Shadows...
Post by: Col. Fishguts on July 30, 2006, 05:03:34 pm
You could use the lower LODs for the "source" of the shadow, y'know.

I still hope that shadows will one day be implemented.
Title: Re: Shadows...
Post by: Flaser on July 30, 2006, 05:45:56 pm
The "casual sun" won't be enough. If we aim for realism, that is...

That's wrong...

In space that would be more than enough. Remeber there is nothing between you and the lightsource to disperse the light.
Actually far out you could handle the sun as a mere directional lightsource (so shadows would be paralell projections of the sillouettes.)
Title: Re: Shadows...
Post by: Mehrpack on July 30, 2006, 05:59:30 pm
Quote
shadow isnt shadow.

:wtf: :D

hi,
ok.

you see in two games shadows, they look like shadows, but the programmcode behind the simulation of that shadows isnt the same.
one shadow use way 1 to got render and the other shadow the total different way 2.

thats i mean with, shadow isnt shadow.
its look maybe like the same, but isnt the same.

@chris: nope, stencil shadows are limit too, and i see very often in game with stencil shadows problem with the shadows itsself, like climbing.

and stencil shadows cost performence too, and if i remember they are limited, because thats a fixed function.
the first good shadows came up with the shaders and there with 2.x.

@dabrain: i think with shadersupport, its easier to implant shadows and i think the shader support can use to give performence free.

Mehrpack
Title: Re: Shadows...
Post by: Bobboau on July 31, 2006, 01:26:58 am
ok, the thing with the shadows is, with the way our graphics abstraction is organised now, it would be a major headache to deal with the stencel buffer, and the shadow geometry. the changes I had in mind for the materials system would have made these problems disapear.

if people would be almost as happy with objects only shadowing themselves that would make the project vastly easier, as the majority of the hacitry I did was in makeing every object in game draw it'self four times (once full lit, once for the back of the shadow once for the front of the shadow and once for the in-shadow geometry) you have to draw everything, then draw everything again, then draw everything AGAIN, then, you have to draw it all over one last time.

now I want to do some reorganiseation of the graphics abstraction, to make the capabilities of both APIs a bit more available. but I'm not going to be able to do that untill after the next release.
Title: Re: Shadows...
Post by: gonz on July 31, 2006, 02:17:13 am
Hi Bobboau

Have not seen you posting here for a while, had thought that real life had taken you away from the scp.

Will the material system will be implemented at some point or has work on that ceased? The screenies of the beta material system looked fantastic, it would be a shame if nothing ever came of it.
Title: Re: Shadows...
Post by: IPAndrews on July 31, 2006, 03:25:46 am
Would doing it the elegant way (materials system) make it any quicker?
Title: Re: Shadows...
Post by: Kaine on July 31, 2006, 09:04:59 am
if people would be almost as happy with objects only shadowing themselves that would make the project vastly easier, as the majority of the hacitry I did was in makeing every object in game draw it'self four times (once full lit, once for the back of the shadow once for the front of the shadow and once for the in-shadow geometry) you have to draw everything, then draw everything again, then draw everything AGAIN, then, you have to draw it all over one last time.

I know i could live with self-shadowing only. Even just self-shadowing on the larger ships (ie not fighters, too many of them around and moving too fast to appreciate the effect anyway)
Title: Re: Shadows...
Post by: A2597 on July 31, 2006, 04:50:40 pm
I've little problem with self shadowing only...

but to be honest, how much of a hog can it be? Flight sims in the mid 1990s had shadows. Nowadays it's soft shadowing with multiple light sources that fades naturally at a distance thats the rage...simple scanline

and the graphical improvment of them is awesome. :) Just simple hard shadows, purhaps 80% opacity from a single light source and voila, would look awesome. :)  (Of course, I am not a coder, I'm a graphics guy...)

Also, is the aim of the source code project to make a game where everyone can crank the settings to max and get playable framerates, or to improve the capabilities of the engine? Because there are many people out there with ATI x850 graphics cards, and dua core 64bit processors with 2 gigs of ram, thats actually becoming the new minimum specs for next gen games. IMHO, the source code project should be making advances for those people, with the options of turning those options off for lower spec cards. older PC's are not capable of running next gen stuff, but that doesn't mean it shouldn't be enabled. (And as DaBrain stated, gives even the coders something to look forward to on an upgrade)


All that said, please don't think I'm nagging for it to be implemented NOW. Obviously, I'd be extatic if that were possible, but you guys are doing a GREAT job on updating the engine, like I said, I'm not a coder, but I DO know how much work it is. And I thank you for doing all that work!
Title: Re: Shadows...
Post by: Chris B. Yond on August 01, 2006, 05:47:20 am
Because there are many people out there with ATI x850 graphics cards, and dua core 64bit processors with 2 gigs of ram.

I really doubt that. Just because you happen to have that kind of money you think you can make demands here. Let the guys work at their pace.

is the aim of the source code project to make a game where everyone can crank the settings to max and get playable framerates, or to improve the capabilities of the engine?

The first. Because we need people actually playing this thing.
Title: Re: Shadows...
Post by: Colonol Dekker on August 01, 2006, 07:32:15 am
Its actually to improve the capabilites of the engine,
Because the retail FS2 had the option of maxing detail etc.. :doubt:
Title: Re: Shadows...
Post by: Shade on August 01, 2006, 07:48:14 am
The problem with shadows isn't that they're too expensive. That's what graphics options are for, so you can turn things off if they are too much for a particular system. The problem is that implementing them takes a coder who has the time, inclination, knowledge and currently-not-too-terribly-annoyed-at-people-assuming-it-will-be-easyness to do it.
Title: Re: Shadows...
Post by: Colonol Dekker on August 01, 2006, 07:51:51 am
I gotta admit, i'm really not that bothered about the shadows, Sure it'll be fancy but will anyone use them effectively in campaigns, will people have time to appreciate them amidst combat.
etc......... :nervous:
Title: Re: Shadows...
Post by: Zacam on August 01, 2006, 08:00:30 am
Not everybodies migration to newer hardware happens at the rate that said new hardware happens.

At the current moment, for example, I'm on a Semperon (socket 462) 2400+ (1.67 Ghz) with 1gb DDR3200 and an 8x Sapphire Radeon 9600XT, Audigy 2 SE and IDE HDD's. I'm just now laying in to get parts for a 939 X2 3800+, PCI-E e-VGA 7600, 2gb DDR3200 and SATA HDD's. It's roughly $500+ (counting 3rd Party HS solutions and a new Power Supply). Can I really afford it? No, but I have different circumstances than most so I'm doing it one piece at a time.

Secondly, I have yet to see a single new game MINIMUM spec that states those requirements. I have yet to see it as a minimum spec for any game yet to be released. I could see it as a RECOMMENDED, but not as a minimum.

And for someone starting out with little in the way of income over expenses and no computer trying to settle in to one, even the Ars Technica budget box may be outside thier budget. And to some fashion, the SCP need's to avail itself to anyone who can atleast meet somewhere around or slightly above the recommended system specs for FS2. (Or atleast degrade nicely enough to make itself available to such a machine.)

Colonol Dekker: A good pointm however it would be noticed, that I can guarantee. I have no idea how many times I got creamed when I first started running the SCP vs. Retail because I kept stopping to look at all the interesting shiney improvements. Sadly, I'm now taking most of them for granted when I'm playing, so I have to remind myself (usually by launching a session in Retail mode, or the Retail EXE) that they're there.
Title: Re: Shadows...
Post by: IPAndrews on August 01, 2006, 08:07:38 am
Look when it comes to expence and specs Shade hit the nail on the head. If your system isn't up to the shading you would be able to turn them off. So that's really not an issue. As for Shade's comment about people assuming it'll be easy? I don't think anyone is assuming that. Neither are we nagging. Just expressing an interest in / enquiring about the possibility of. If it's upsetting you guys though then I for one will shut up and more onto a different topic.
Title: Re: Shadows...
Post by: karajorma on August 01, 2006, 08:16:27 am
It's also worth remembering that although shadows will look good in the engine they'll look great in screenshots :) So when pimping out the engine to new people we'll have yet one more reason why they should realise that this isn't last century's Freespace any more.
Title: Re: Shadows...
Post by: Colonol Dekker on August 01, 2006, 08:30:20 am
I'm not knocking it, my comp is full of beef
Spoiler:
(tick tock elves or elctronics would be more help)
it could probably handle it,  As long as its scalable i should be fine. As you say though the coders have their own stuff to do before a hobby as this can be considered though.

All in all, i play this arguemnt swiss and stay neutral. :P
Title: Re: Shadows...
Post by: Shade on August 01, 2006, 08:43:19 am
As for Shade's comment about people assuming it'll be easy? I don't think anyone is assuming that. Neither are we nagging. Just expressing an interest in / enquiring about the possibility of. If it's upsetting you guys though then I for one will shut up and more onto a different topic.
I wasn't referring to this thread in particular in that comment, so no need to worry in that regard :) It just happens to be one of the main factors in whether something gets done or not, as it is a free-time project and one still needs to be in the mood regardless of other factors, and that particular thing is one of the main reasons why one might not be in the mood for coding.
Title: Re: Shadows...
Post by: IPAndrews on August 01, 2006, 08:47:47 am
Shuoldn't you code it anyway? Look at your name?   ;7
Title: Re: Shadows...
Post by: Shade on August 01, 2006, 09:03:38 am
Wish I could. But I only satisfy two of the four criteria :(

I have inclination and I'm not annoyed, but I have zero time at the moment (it's been week since I even gave the code any more than a cursory look. Not even had time to finish many of the wiki updates I was working on a month ago) and I have no knowledge whatsoever about working with the stencil buffer, or indeed 3d graphics in general. I'm more of a SEXP and minor feature guy, when I have the time for it anyway...

I'm learning though. So maybe in 2-3 years if noone has gotten around to it by then :p
Title: Re: Shadows...
Post by: IPAndrews on August 01, 2006, 09:10:10 am
Just in time for Machina Terra's release then.
Title: Re: Shadows...
Post by: A2597 on August 01, 2006, 09:13:15 am
Crysis, due later this fall requires it, and reccomends dual core.
I guess it's just that my main hangout these days is a tech forum, so I see ALOT of people with kicking rigs to play games like Oblivion, Crysis, etc.

Myself? Nooo..thats not my rig. my poor rig is a Athlon XP 2800+, 1 gig ram, and a Radeon 9600 Pro 256MB (Was a 9800 Pro, but I burned it out)

Even on my current rig, which is starting to show it's age though, I can crank Freespace 2 SCP and it runs quite fast. Obviously I know most people are not in a situation to update frequently, but it just seems like thee purpose should be to add features for current and future systems, rather then systems a few years old.  :cool:

I agree it should be available to people with PC's the meet the specs for FS2, but that is why there is an option to turn on or off features in the launcher. But really, Freespace 2 is 7 years old now, can we really keep system requirement that are litterally hundreds of times slower than current systems as a limit when trying to add new features? 

(As for coding, I do web work...LOL)
Title: Re: Shadows...
Post by: wolf on August 01, 2006, 01:39:56 pm
At the current moment, for example, I'm on a Semperon (socket 462) 2400+ (1.67 Ghz) with 1gb DDR3200 and an 8x Sapphire Radeon 9600XT, Audigy 2 SE and IDE HDD's. I'm just now laying in to get parts for a 939 X2 3800+, PCI-E e-VGA 7600, 2gb DDR3200 and SATA HDD's. It's roughly $500+ (counting 3rd Party HS solutions and a new Power Supply). Can I really afford it? No, but I have different circumstances than most so I'm doing it one piece at a time.

Secondly, I have yet to see a single new game MINIMUM spec that states those requirements. I have yet to see it as a minimum spec for any game yet to be released. I could see it as a RECOMMENDED, but not as a minimum.
Already mentioned here, Crysis:

Minimum Requirements

CPU: Athlon 64 3000+/Intel 2.8ghz
Graphics: Nvidia 6600/X800GTO (SM 2.0)
RAM: 768Mb/1Gb on Windows Vista
HDD: 6GB
Internet: 256k+
Optical Drive: DVD
Software: DX9.0c with Windows XP

Quote
And for someone starting out with little in the way of income over expenses and no computer trying to settle in to one, even the Ars Technica budget box may be outside thier budget. And to some fashion, the SCP need's to avail itself to anyone who can atleast meet somewhere around or slightly above the recommended system specs for FS2. (Or atleast degrade nicely enough to make itself available to such a machine.)
And just what forbids these people to run fs2_open without every available switch turned on?
Title: Re: Shadows...
Post by: A2597 on August 01, 2006, 05:06:16 pm
you know...

I really didn't mean for this to become a debate on adding features to Freespace. I was just curious if anyone had picked up shadows or if it was planned for in the future. Short answer seemed to be yes, at some point we will get shadows.

the Freespace Open team is working hard on improving this engine for FREE, I don't want anyone to be ragging on them for not adding features fast enough, or not making them "cool" enough. And I apologise for my own comments that tilted that way.

You guys are doing an AWESOME job, I don't know how much work it is to modify an engine, but I'm guessing it's more than creating your own engine with all the bells and whistles already in mind. So THANK YOU. And please don't let our whineing get in the way of things. :)
Title: Re: Shadows...
Post by: Bobboau on August 01, 2006, 05:53:00 pm
yeah at some point in the future I plan on implementing shadows, but there are lots of things that need to be done first.

I just remembered another thing I need to take care of, I need to upgrade the way BSP geometry is stored/acced/ect.
Title: Re: Shadows...
Post by: Nuke on August 02, 2006, 03:22:19 am
hey bob, any chance of ever converting over from per object rendering to per material rendering, to boost htl performance? it would really speed up the game when capships are around. :D maybe you can even improve the capabilities of textures with transparency, such as being able to use alpha arbitrarily, on any object, subobject, or weapon, with proper blending.

as for per object shadows, it would be nice. not as nice as full shadow effects. maybe comprimise and have an optional ship flag such as "cast shadows", to get shadow casting only on specific objects. might be a way to boost performance.
Title: Re: Shadows...
Post by: Flipside on August 02, 2006, 10:41:36 am
Alas, adding shadows is not like adding glowmaps, even self-shadowing would be cool, though I'll miss the sight of a Fenris drifting across a Deimos, throwing a tiny little shadow on the hull, you just got such a wonderful impact of size from it.
Title: Re: Shadows...
Post by: DaBrain on August 02, 2006, 11:52:07 am
Well... as quite a few mods  are going for some ground missions now, I think selfshadowing would be a wast of time, when you could also work on 'real' shadows.


But I got one request. Please keep it in mind whenever you start with this: It should be possible to exclude ships/objects from casting and/or receiving shadows.
Title: Re: Shadows...
Post by: Unknown Target on August 02, 2006, 04:58:34 pm
*ahem*

Please?
Title: Re: Shadows...
Post by: Nuke on August 02, 2006, 08:49:49 pm
well i have a feeling that adding self shadowing is a first step to full shadowing. add in self shadowing and lay down the groundwork for a later upgrade.
Title: Re: Shadows...
Post by: gevatter Lars on August 03, 2006, 08:11:09 am
I don't know if just adding a little part of a shadow technic and then later adding more will be good. Taking code in then out again and so on. I would love to see shadows but somewhere it was mentioned that if the shader system would work correct it would be easier to do shadows so I say concentrate on the shader system first and then add the shadows.
Title: Re: Shadows...
Post by: A2597 on August 03, 2006, 03:03:35 pm
I don't know if just adding a little part of a shadow technic and then later adding more will be good. Taking code in then out again and so on. I would love to see shadows but somewhere it was mentioned that if the shader system would work correct it would be easier to do shadows so I say concentrate on the shader system first and then add the shadows.

ditto. :)
Title: Re: Shadows...
Post by: Nuke on August 04, 2006, 05:11:33 am
i think one would have to know the code pretty well to make that judgement.
Title: Re: Shadows...
Post by: Dark RevenantX on August 06, 2006, 09:13:24 pm
Quote
Minimum Requirements

CPU: Athlon 64 3000+/Intel 2.8ghz
Graphics: Nvidia 6600/X800GTO (SM 2.0)
RAM: 768Mb/1Gb on Windows Vista
HDD: 6GB
Internet: 256k+
Optical Drive: DVD
Software: DX9.0c with Windows XP

OMFG
my computer CAN run the game!