Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Fry_Day on September 10, 2003, 06:47:03 am
-
I have implemented Lens Flares, and committed the code changes required to CVS.
To create lens flares, you modify stars.tbl, for every sun to include, after $SunRGBI:
$Flare:
+FlareCount ;number of flares
$FlareTexture1: ;texture name
$FlareTextureN: ;goes up to 6 different textures
$FlareGlow1: ;up to 10 glows (actual bitmaps on the screen
+FlareTexture: ;texture number, between 0 to N-1 (references to textures defined earlier, just substract 1)
+FlarePos: ;floating point number, 0.0 is on the sun, 1.0 is the point on the opposite side (treat the center of the screen as the point of symmetry)
+FlareScale: ;scale
$FlareGlowN:
...
For example, the flare I use with every sun is:
$Flare:
+FlareCount: 10
$FlareTexture1: Corona1
$FlareTexture2: Corona2
$FlareTexture3: Corona3
$FlareTexture4: Corona4
$FlareGlow1:
+FlareTexture: 0
+FlarePos: 1.0
+FlareScale: 1
$FlareGlow2:
+FlareTexture: 1
+FlarePos: 0.717
+FlareScale: 1
$FlareGlow3:
+FlareTexture: 1
+FlarePos: 0.25
+FlareScale: 1
$FlareGlow4:
+FlareTexture: 0
+FlarePos: 0.611
+FlareScale: 1
$FlareGlow5:
+FlareTexture: 3
+FlarePos: 0.381
+FlareScale: 1
$FlareGlow6:
+FlareTexture: 2
+FlarePos: 1.026
+FlareScale: 1
$FlareGlow7:
+FlareTexture: 3
+FlarePos: 1.056
+FlareScale: 1
$FlareGlow8:
+FlareTexture: 3
+FlarePos: 0.083
+FlareScale: 11
$FlareGlow9:
+FlareTexture: 2
+FlarePos: 0.656
+FlareScale: 1
$FlareGlow10:
+FlareTexture: 2
+FlarePos: 0.549
+FlareScale: 1
I can't attach files, or I'd show you some screen-shots. Even though the glow I put together is totally half-assed with bad textures, it still looks nice.
If the sun is occluded, the glow won't show up, and as long as you don't screw the table entry up, everything should work. I'm pretty sure the limits can go up a lot without losing stability, so give me a shout if you want higher limits.
-
Oooh!
I likey the sound of this!:)
-
The people cry:
:hopping: Screenshots! Screenshots! :hopping:
-
If someone can throw up a compiled version of the .EXE I could probs do some? ;)
Flipside :D
-
Excellent! Should look fantastic!
-
Sorry, but I don't have any web-space, and I can't attach files, so you'll have to wait for someone else :(
-
LOL
Ok, everyone imagine an Orion, with the sun just above it, specular highlights gleaming almost as bright as the lights, with a lens flare arcing across your screen ;)
Flipside :D
-
yeah, specular should be very bright if youre near a sun :D
extreme contrast :)
And the lense flare would simply give it the final touch to look :yes:
-
Originally posted by Fry_Day
Sorry, but I don't have any web-space, and I can't attach files, so you'll have to wait for someone else :(
[email protected]
add HLP in the subject bar.
-
Fry_Day you need to contact stealth about a swooh account. :D
-
www.swooh.com/peon/kasperl/flare.jpg
(http://www.swooh.com/peon/kasperl/flare.jpg)
nice
-
Sent. :)
I run x4 AA (I looove my Radeon 9800 Pro AIW :D ), so the text is kind of garbled, and I spent a grand total of 10 minutes on the table entry, so better lens-flare effects shouldn't be hard to craft.
-
Originally posted by Fry_Day
Sent. :)
I run x4 AA, so the text is kind of garbled, and I spent a grand total of 10 minutes on the table entry, so better lens-flare effects shouldn't be hard to craft.
i seem to post faster then you, but i like this effect already.
-
Okay, on an off-hand note, I think that thruster glows should be drawn the way sun glows are right now - if you see the thruster, the full glow is drawn without Z-buffering. If you can't see it no glow is drawn. Remember that the glow is simulating a light source so strong that it creates bleeding to adjacent pixels, so if you can't see the light source, there should be no glow.
-
Sorry, you confused me a bit there, do you mean that you want no glow drawn when the light is obscured, or that you DO want glow to 'bleed' out, even if the source of the light is hidden?
Flipside :D
-
Look at the myrmidon's engine glows. Right now, they intersect and are partially obscured by the hull. The idea is that if you see the point in the middle of the glow, draw it over everything (so it doesn't intersect), because that's the way it's supposed to behave. If you can't see the middle of the glow, don't draw it at all.
FS actually supplies a nice way to check if you can see a point (look at shipfx_point_in_shadow does the check for suns).
-
*drools*
*drools some more*
Cheers
-
Ah yes, I can see what you mean now, and I agree, it always looks a bit 'odd' having the hull intersect with the glow from the Engine, there is this sort of 'jittery' effect as the lens flare flickers.
Flipside :)
-
those lense flares -- way too colourful :D
-
That one is, but then, it was only a test to see if it worked. You can define your own lens flare 'Glows' to suit your tastes :)
Flipside :D
-
Eek. It's the Attack of the Computer Graphic Cliches!
Just because you can do something doesn't mean you should. I've always rather liked the fact that V had the willpower to resist throwing in lens flares.
-
I sort of agree with ZB, that is I don't like lens flares on princepal, in the game you are not a camera, but rather you are a human in a cocpit, there for you will not have lens flares,
HOWEVER; I do think this is a very good implementation, and it is great to have the option.
as for the thruster glow thingy, I disagree, the point in shadow isn't very good, I see it giveing false positives all the time, and I am sure it'll be slow as hell,
I was thinking it might be a good idea to use this function to have a sort of dynamic shadowing were you test the center of a model and if it is in a shadow you don't light it, big ships would not be affected by this, little ships wouldn't cast shadows, the effect you would have would be the smaller ships getting shadowed by the larger ones, imagen several bomber wings going after a jugernat as ther aproch they enter the shadow of the ship and are only lit by there glow mapping and weapons fire
-
Originally posted by ZylonBane
Eek. It's the Attack of the Computer Graphic Cliches!
Just because you can do something doesn't mean you should. I've always rather liked the fact that V had the willpower to resist throwing in lens flares.
Actually they didn't...one version of FS1 did have flares...but apparently it was unstable at the time and only worked on 3DFX.
Lens flares are nice with the suns...but rarely elsewhere.
I cannot see the image...the site must be down.
-
did you click the link? It didn't show up for me either until I actually went to the pic.
I do not partucularly like the lens flare effect, but that's a personal taste. I'd love to see it as a launcher-selectable command line option though (or to eventually have an additional options screen made so that we can set these preferences in a more defined matter) as it is, in principle, a good graphical addition.
-
Originally posted by Bobboau
I was thinking it might be a good idea to use this function to have a sort of dynamic shadowing were you test the center of a model and if it is in a shadow you don't light it, big ships would not be affected by this, little ships wouldn't cast shadows, the effect you would have would be the smaller ships getting shadowed by the larger ones, imagen several bomber wings going after a jugernat as ther aproch they enter the shadow of the ship and are only lit by there glow mapping and weapons fire
:nod: :nod: :nod:
MMmmmm....Luvverly EyeCandy, optional, but sweet :D
Flipside :D
-
Originally posted by Bobboau
I sort of agree with ZB, that is I don't like lens flares on princepal, in the game you are not a camera, but rather you are a human in a cocpit, there for you will not have lens flares,
HOWEVER; I do think this is a very good implementation, and it is great to have the option.
as for the thruster glow thingy, I disagree, the point in shadow isn't very good, I see it giveing false positives all the time, and I am sure it'll be slow as hell,
I was thinking it might be a good idea to use this function to have a sort of dynamic shadowing were you test the center of a model and if it is in a shadow you don't light it, big ships would not be affected by this, little ships wouldn't cast shadows, the effect you would have would be the smaller ships getting shadowed by the larger ones, imagen several bomber wings going after a jugernat as ther aproch they enter the shadow of the ship and are only lit by there glow mapping and weapons fire
What he said.
-
I like eyecandy, therefore I like lenseflares :)
-
As an optional addition, this is an excellent modification. Good stuff :yes:
-
Originally posted by kasperl
www.swooh.com/peon/kasperl/flare.jpg
nice
Agreed :yes:
-
i think the glows on the engines are physical thrust, not glows, so the should in fact be seeable even when the center is obscured. yes, i know it rotates with you, but i think that's just the rays coming out.
-
Originally posted by Venom
I like eyecandy, therefore I like lenseflares :)
I gotta agree with Venom. It looks sweet, and whether you think it's realistic or not I think it gives you more of feeling of being immersed. You're tailing a shivan fighter and he pulls towards a star. As you turn to bear, lens flare runs across cockpit bubble causing a brief itch of panic as you fear you've lost the fighter from your sights. Kind of reminds me of Top Gun, when the MiG pulls up towards the sun to lose Merlin and Maverick. Makes the game much more involving, I think.
To keep everyone happy, though, maybe it should be an option in the launcher.
-
Cool.
It's a table item, so it's going to be utilized on a per-mod basis. If campaign leaders want lens flares, so be it. Same goes for glowmaps and shine maps--the campaign leaders can support it if they wish.