Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Nighteyes on February 14, 2010, 02:08:27 pm

Title: problem with suns
Post by: Nighteyes on February 14, 2010, 02:08:27 pm
for some reason suns arn't rendered last, making ships display ontop of lens flares and sun glows... is this easily fixable?
Title: Re: problem with suns
Post by: The E on February 14, 2010, 02:11:24 pm
Errm. Don't you mean that you want suns rendered first?

Anyway, I think the effect we have now is intentional, as you get a somewhat realistic "overshine"-effect.
Title: Re: problem with suns
Post by: chief1983 on February 14, 2010, 03:25:45 pm
I think he means that when an Orion is next to, but not blocking, a sun, it still blocks the lens flare effect that should be over the ship.  Sound about right?
Title: Re: problem with suns
Post by: The E on February 14, 2010, 03:30:08 pm
Screenshots would help immensely.
Title: Re: problem with suns
Post by: Nighteyes on February 14, 2010, 05:14:41 pm
I think he means that when an Orion is next to, but not blocking, a sun, it still blocks the lens flare effect that should be over the ship.  Sound about right?

that, and also the flares themselves are obscured by the ships, looks really bad and unrealistic... this screenshot shows it best:
(http://img5.imageshack.us/img5/6198/screen0717.png)
By gbtf67 (http://profile.imageshack.us/user/gbtf67) at 2010-02-14

**I mean rendered last, as in renders after all the other ships and nebula and skyboxs are rendered, so the sun+flares render ontop of everything else, as it should be
Title: Re: problem with suns
Post by: FUBAR-BDHR on February 14, 2010, 05:33:35 pm
Actually rendering last isn't good either.  You wouldn't want flares from a sun behind a planet.  It was quite common to put suns behind a planet in retail since there was no remove-sun-bitmap.  Now the ships part yea that doesn't look right.  But then if you were close enough to the basestar for it to block the sun entirely you wouldn't want flares either. 
Title: Re: problem with suns
Post by: Nighteyes on February 14, 2010, 05:38:24 pm
the code already know not to render flares when obscured by a ship, but when not obscured it should be ontop of everything... and regarding planets, why bother placing a sun if it will be behind a planet? and if you really want to, you can create a sun with a transparent texture and no flares...
Title: Re: problem with suns
Post by: FUBAR-BDHR on February 14, 2010, 05:43:10 pm
You missed the line about retail.  You couldn't do mods for multiplayer and there was no way not to have a sun so you put a sun in and stuck a planet on top of it.  So yes you can do what you say now but it would break compatibility. 
Title: Re: problem with suns
Post by: Pottuvoi on February 15, 2010, 12:57:32 am
Best way would be doing flares as a post process, this would allow a lot better looking flares without any problems of ordering as all bright surfaces would cast flares. (as they should.)
For reference of what it would look like check 3dmark vantage or a killzone2.
Title: Re: problem with suns
Post by: chief1983 on February 15, 2010, 01:38:08 am
Seriously, it's not complicated.  Whether or not a sun itself renders is already correct, the only problem is that when the sun is there, the flares should be on top of _everything_.  That's not a PP effect, and I think it did work before but I can't really remember.
Title: Re: problem with suns
Post by: taylor on February 15, 2010, 03:18:46 am
The lens flare is rendered with the sun glow, which is behind all ships, so it is actually working just the way that it was implemented.  With a few minor changes it could be made to work properly though.
Title: Re: problem with suns
Post by: Nighteyes on February 15, 2010, 02:01:18 pm
so, is someone willing to work on these  "few minor changes"? :D
Title: Re: problem with suns
Post by: Zacam on February 15, 2010, 03:31:34 pm
I'm more than willing to take some direction on the issue.
Title: Re: problem with suns
Post by: Nighteyes on March 02, 2010, 04:42:45 pm
any luck with this?
Title: Re: problem with suns
Post by: DaBrain on March 03, 2010, 01:24:14 pm
Actually, the sun should still be part of the background, but the flare should be on top of everything else unless the sun is completely covered by something in front of it (including animated parts of the skybox).


From the SCP internal:


[...]

Light coronas

An older feature, which seems to be "in" again. I remember seeing this a quite often in older games.
I think it's just a sprite blending/bleeding over the edges of objects in front of it, unless it's center is covered.

I'm not quite sure how it works, but I found some stuff related to this topic:

http://www.gamedev.net/community/forums/topic.asp?topic_id=133234
http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=230605

Also to illustrate the effect I mean:

http://www.youtube.com/watch?v=LE_z3-YgQsE


Current look:
(http://i46.tinypic.com/1fzgxt.jpg)

Light corona/Lens flare:
(http://i50.tinypic.com/2po8aix.jpg)


[...]
Title: Re: problem with suns
Post by: Dragon on March 03, 2010, 04:08:06 pm
Is that BTRL with normal maps?
Title: Re: problem with suns
Post by: Angelus on March 03, 2010, 04:17:22 pm
Is that BTRL with normal maps?


Looks like it is, and i think the Asteroid on the left is not one of the Scaroids.
Me wants, the flares and the roid. :D
Title: Re: problem with suns
Post by: Nighteyes on March 03, 2010, 04:20:29 pm
and, taking this flare stuff further, we can have a "glow" effect, also bleeding color on everything when a capship explodes... personally I think this will really boost the graphical quality of the SCP...
Title: Re: problem with suns
Post by: Nuke on March 05, 2010, 03:46:41 pm
i kinda like that effect ant it seems like it would be just a matter of rending a big sprite over all the geometry
Title: Re: problem with suns
Post by: DaBrain on March 06, 2010, 01:16:55 am
I think in the case of Nexus (the youtube video), they used a smart rendering order system for the flares, because sometimes it still looks like the flare gets cut-off by other ships.

I don't know if rendering all flares after everything else is an option.