Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Nighteyes on September 16, 2011, 06:34:11 pm

Title: Feature request: glow points should act as lens flares
Post by: Nighteyes on September 16, 2011, 06:34:11 pm
think about it, glow points on ships, missiles and engines are all representing light sources... thus should act like real lens flares(like our new suns)

I've been adding glow points to capships engines to test it out, and found a strange behavior for large radius glow points(radius of 50-200):
when you fly close to the engine, the glow point would move towards you and go bright until you fly through it, instead of staying at the position of the engine, I have no idea why this is happening, and even if this is intentional, it looks very strange, the glow point should stay where I put it.

other glow point problems is that they don't shut off when a capship dies, IMO when a capship enters the death roll phase glowpoints, as well as the glow map should turn off, the ship is splitting in 2, I doubt the electricity is still working at this stage...

screenshots will follow a bit later as im not on my FS computer atm
Title: Re: Feature request: glow points should act as lens flares
Post by: Bobboau on September 16, 2011, 07:26:45 pm
the glow map should turn off, the ship is splitting in 2, I doubt the electricity is still working at this stage...

when ever this is brought up I ask should the glow map on the flaming debris also get shut off?
Title: Re: Feature request: glow points should act as lens flares
Post by: mjn.mixael on September 16, 2011, 08:53:35 pm
But I use the glow map in my damage chunks...
Title: Re: Feature request: glow points should act as lens flares
Post by: Nighteyes on September 17, 2011, 03:04:40 pm
guys,  the debris object is a separate object, if you want have the glow map "on" so that you can have some glowing hot metal and such, thats fine, what I'm talking about is the actual model that is splitting apart, the original whole ship(glow map and glow points should turn off when its starting its death roll)

also for the old way of having debris using 2 maps(original and damage), the glow map can turn off on the original and stay on for the damage texture...

now, back on topic, glow maps rendered as flares, this is what I have in mind:
its a bit strong, and I still need to play a bit with the mipmaps, maybe have it activate only when far away/close

(http://img11.imageshack.us/img11/8440/screen0025z.jpg)
Title: Re: Feature request: glow points should act as lens flares
Post by: Mobius on September 17, 2011, 03:23:56 pm
Well, wow. Amazing, really - I can't wait to see this feature fully implemented. :)
Title: Re: Feature request: glow points should act as lens flares
Post by: Nighteyes on September 17, 2011, 03:44:48 pm
some more screenshots:

(http://img717.imageshack.us/img717/4918/screen0032r.jpg)

(http://img836.imageshack.us/img836/8617/screen0026.jpg)

(http://img155.imageshack.us/img155/9895/screen0030k.jpg)
Title: Re: Feature request: glow points should act as lens flares
Post by: Nighteyes on September 17, 2011, 03:49:34 pm
and here is the ugly problem with the glow points not acting as lens flares, basically the same problem we once had with our suns...

(http://img705.imageshack.us/img705/5166/screen0034r.jpg)
Title: Re: Feature request: glow points should act as lens flares
Post by: torc on September 17, 2011, 04:02:12 pm
good job Nighteyes...i'd like to see it in Diaspora once is finished :)
i think this effect and the thruster distortion should work really good in-game
Title: Re: Feature request: glow points should act as lens flares
Post by: Nighteyes on September 17, 2011, 04:09:58 pm
Diaspora won't have anything like this, do you remember seeing anything like this in the show? if it wasn't in the show, I won't add it, Freespace on the other hand... I have a bit more creative freedom  ;)
Title: Re: Feature request: glow points should act as lens flares
Post by: JCDNWarrior on September 17, 2011, 04:17:26 pm
This looks very very good. The effect may need to be a little toned down as you said before but I love it. Especially perfect in screenshots, curious how it's in actual movement. Do you think you could post a small video demonstrating it's effect, so I can get a better idea of the effect? Thanks in advance ;)
Title: Re: Feature request: glow points should act as lens flares
Post by: torc on September 17, 2011, 04:22:34 pm
well,i was thinkin that tuning down the effect could fit and give a more realistic look.
Anyway, i think that the effect needs to be blink as you see in this video,but more faster

http://www.youtube.com/watch?v=LpwI_O9CY-A

Sorry but i haven't found a better example than this :P
Title: Re: Feature request: glow points should act as lens flares
Post by: MetalDestroyer on September 17, 2011, 04:58:24 pm
Woaw !! Could you give us your glow point effect ? :) I really like it.
Title: Re: Feature request: glow points should act as lens flares
Post by: DaBrain on September 18, 2011, 04:50:22 pm
and here is the ugly problem with the glow points not acting as lens flares, basically the same problem we once had with our suns...

http://img705.imageshack.us/img705/5166/screen0034r.jpg (http://img705.imageshack.us/img705/5166/screen0034r.jpg)


Alright, let me explain how the lensflares work. It's basically on or off. It's not sorted. Thanks to the Z-Mode change it's simply on top of all other objects. No problem so far, but we need to determine when it's supposed to be on or off.  This is done by a raycast. If the ray is blocked by geometry, the flare is turned off.

A hand full of raycasts for the suns are no problem. Once we do it for all glowpoints on every single ship, it might become a problem.
I am not a coder, so I can't say how bad it will be, but I doubt it will be cheap.


On the other hand, there is a better way to do it, but it requires HDR rendering. We could add a streak bloom effect to everything on the screen that is very bright. (Actually brighter than the white your display.)
That would give specular highlights a "flare" effect as well... and everything else bright.
Title: Re: Feature request: glow points should act as lens flares
Post by: Dragon on September 18, 2011, 05:54:00 pm
Didn't Valathil implement HDR at some point?
He's working so fast I lost track of all the improvements he made.  :)
Anyway, that's not a bad idea.
Title: Re: Feature request: glow points should act as lens flares
Post by: Nighteyes on September 18, 2011, 06:04:00 pm
thats an option, but will be problematic in missions that are very bright, like atmospheric missions... can someone test out this raycast thing? it might be a very simple check that will not even affect FPS, also having the control over lens flares for various effects would be awesome, think about it, together with the mipmaps trick, you can have simple things like lasers wizzing by your screen create a bright flare  :)

anyway, here is a video showcasing the flares as someone asked here, its also showing the problem with the glow points dissapearing before the center point is out of screen, the grow big, bit vanish before they should(seems like even Volition thought of using them as lens flares :P )

http://www.youtube.com/watch?v=oADXodHXS0w
Title: Re: Feature request: glow points should act as lens flares
Post by: Goober5000 on September 19, 2011, 11:47:30 am
This is a bad idea.  I do not want FSO to turn into the latest Star Trek movie.
Title: Re: Feature request: glow points should act as lens flares
Post by: mjn.mixael on September 19, 2011, 12:01:34 pm
This is a bad idea.  I do not want FSO to turn into the latest Star Trek movie.

This is a bad post. Sorry. Because you do not like a visual element does not mean you should actively try to keep it from being available for other mods to use. If you don't like all the lens flares, then don't play Nighteyes' mod. The solution, however, is not to keep this feature from being added.

EDIT: Deja Vu (http://www.hard-light.net/forums/index.php?topic=78100.0) Am I the only one that doesn't like seeing "I think that's ugly, don't add that feature" posts? (With the implication seeming to be that we must limit people to creating what is only generally acceptable.)
Title: Re: Feature request: glow points should act as lens flares
Post by: Commander Zane on September 19, 2011, 12:41:45 pm
thats an option, but will be problematic in missions that are very bright, like atmospheric missions... can someone test out this raycast thing? it might be a very simple check that will not even affect FPS, also having the control over lens flares for various effects would be awesome, think about it, together with the mipmaps trick, you can have simple things like lasers wizzing by your screen create a bright flare  :)

anyway, here is a video showcasing the flares as someone asked here, its also showing the problem with the glow points dissapearing before the center point is out of screen, the grow big, bit vanish before they should(seems like even Volition thought of using them as lens flares :P )

http://www.youtube.com/watch?v=oADXodHXS0w
I like how they appear on FRED. :lol:
Anyway, this looks awesome.
Title: Re: Feature request: glow points should act as lens flares
Post by: Dragon on September 19, 2011, 02:18:08 pm
I think that lens flares over glowpoints are a bit of stretch (thrusters are fine though, as long as the effect is subtle). On the other hand, making glow points render like lens flares (on top of everything else) and using raycasting (or HDR, if I understood this correctly) to make them disappear when obscured is a good idea.
Title: Re: Feature request: glow points should act as lens flares
Post by: Nighteyes on September 19, 2011, 02:27:36 pm
this is what I mean, on very bright parts like thrusters a flare could be seen, Goober, don't worry too much I know and hate the lens flares in film like the new star strek, I do however love it when its used subtly, look at mass effect for reference to awesome looking lens flares... keep them subtle and on very specific things and it can look amazing.
Title: Re: Feature request: glow points should act as lens flares
Post by: Goober5000 on September 19, 2011, 03:15:42 pm
This is a bad post. Sorry. Because you do not like a visual element does not mean you should actively try to keep it from being available for other mods to use. If you don't like all the lens flares, then don't play Nighteyes' mod. The solution, however, is not to keep this feature from being added.
What I am against is every light source in the game -- including glowpoints, as mentioned in the original post -- automatically generating a lens flare.  FSO should not force such a fundamental and pervasive change upon its players.

As far as I'm concerned, Nighteyes can do whatever he wants with his mod.  And if lens flares can be selectively applied to light sources, that's fine.  But it should be optional.
Title: Re: Feature request: glow points should act as lens flares
Post by: Nighteyes on September 19, 2011, 04:15:17 pm
This is a bad post. Sorry. Because you do not like a visual element does not mean you should actively try to keep it from being available for other mods to use. If you don't like all the lens flares, then don't play Nighteyes' mod. The solution, however, is not to keep this feature from being added.
What I am against is every light source in the game -- including glowpoints, as mentioned in the original post -- automatically generating a lens flare.  FSO should not force such a fundamental and pervasive change upon its players.

As far as I'm concerned, Nighteyes can do whatever he wants with his mod.  And if lens flares can be selectively applied to light sources, that's fine.  But it should be optional.

what your not understanding is that saying "lens flares" is not necessarily means flashy flares everywhere, in fact it won't change a thing in how the game currently looks, blinking small glow points would stay as they are, thrusters would stay as they are, are glow points used for anything else I'm not away of?
the only thing it would change in the look is that when a ship is in front of a glow point(must be a pretty large one at that, like in my screenshot), and even then in most cases like tiny blinking lights it barely will be visible...

*also, nowhere in my post did I say FSO should automatically generate a lens flare for every light source, I'm just talking about they way FSO renders GLOW POINTS...
Title: Re: Feature request: glow points should act as lens flares
Post by: shini028 on September 19, 2011, 09:35:18 pm
Any one else thinking about the JJ Abrams Star Trek movie?...  just please keep it below that level...

(http://cdn.screenrant.com/wp-content/uploads/star-trek-crew-and-lens-flares.jpg)
Title: Re: Feature request: glow points should act as lens flares
Post by: Bobboau on September 19, 2011, 09:41:13 pm
http://www.youtube.com/watch?v=bHqjmlM3kxs
Title: Re: Feature request: glow points should act as lens flares
Post by: mjn.mixael on September 19, 2011, 10:38:38 pm
I am going to absolutely lose my freaking mind if everytime someone asks for something lens flare related people scream that they don't want JJ Abrams or the new Star Trek.

That is NOT a reason to disallow the features. Good gravy people.

EDIT: FS is too much like this (http://www.youtube.com/watch?v=yHLgeNqjrYw) these days. Can we hard limit some of the explosions features please?

(http://i719.photobucket.com/albums/ww192/EquisX/BAYSPLOSIONS.jpg)
Title: Re: Feature request: glow points should act as lens flares
Post by: sigtau on September 19, 2011, 10:42:56 pm
Keep it adjustable to the player's preference, and keep it optional.

As long as the above two things are maintained, any complaints about the new feature looking like a J.J. Abrams movie will have no basis.
Title: Re: Feature request: glow points should act as lens flares
Post by: mjn.mixael on September 19, 2011, 10:46:51 pm
Keep it adjustable to the mod creator's preference, and keep it optional.

As long as the above two things are maintained, any complaints about the new feature looking like a J.J. Abrams movie will have no basis.

Fixed that for you. If you don't like JJ Abrams lens flares, then don't play mods with them. Plain and simple.

Not everything can be a commandline option...
Title: Re: Feature request: glow points should act as lens flares
Post by: Sushi on September 20, 2011, 09:51:42 am
This is a bad idea.  I do not want FSO to turn into the latest Star Trek movie.

This is a bad post. Sorry. Because you do not like a visual element does not mean you should actively try to keep it from being available for other mods to use. If you don't like all the lens flares, then don't play Nighteyes' mod. The solution, however, is not to keep this feature from being added.

EDIT: Deja Vu (http://www.hard-light.net/forums/index.php?topic=78100.0) Am I the only one that doesn't like seeing "I think that's ugly, don't add that feature" posts? (With the implication seeming to be that we must limit people to creating what is only generally acceptable.)

+1
Title: Re: Feature request: glow points should act as lens flares
Post by: Dragon on September 20, 2011, 11:50:32 am
People above: http://tvtropes.org/pmwiki/pmwiki.php/Main/CompletelyMissingThePoint
what your not understanding is that saying "lens flares" is not necessarily means flashy flares everywhere, in fact it won't change a thing in how the game currently looks, blinking small glow points would stay as they are, thrusters would stay as they are, are glow points used for anything else I'm not away of?
the only thing it would change in the look is that when a ship is in front of a glow point(must be a pretty large one at that, like in my screenshot), and even then in most cases like tiny blinking lights it barely will be visible...
Read the thread:
Quote
nowhere in my post did I say FSO should automatically generate a lens flare for every light source, I'm just talking about they way FSO renders GLOW POINTS...
This is about how things like thrusters and glowpoints are rendered, as in, the points themselves.
Title: Re: Feature request: glow points should act as lens flares
Post by: Aardwolf on September 20, 2011, 02:23:40 pm
I thought of some possible ways this could be done (from a modder's perspective, more than a coder's):

Title: Re: Feature request: glow points should act as lens flares
Post by: Dragon on September 20, 2011, 02:58:03 pm
Actually, the current system seems to have no adventages over "lens-flare" method. I'd prefer it to be a default mode.
Title: Re: Feature request: glow points should act as lens flares
Post by: DaBrain on September 20, 2011, 05:38:46 pm
(render after everything, if a ray-check passes)

Still waiting for a coder to comment on how expensive this would be...
Maybe a view-angle dependend shader would be a cheaper soltion and put off some workload from the CPU.


And in all honesty, I wanted a lensflare system like this before, but this method seems outdated. Using the pixel bightness seems to be a way more accurate way.
I still think it makes sens for the sun, cause in terms of brightness, the sun is somewhat special. The flares on everything else should work and look the same.
I can wait for the HDR rendering.

If you're desparate, alter the current bloom effect. You can easily turn it into a flare-like streak effect by blurring it on one axis only.
Title: Re: Feature request: glow points should act as lens flares
Post by: shini028 on September 20, 2011, 05:51:28 pm
Quote from: mjn.mixael
I am going to absolutely lose my freaking mind if everytime someone asks for something lens flare related people scream that they don't want JJ Abrams or the new Star Trek.

I love the idea of the lens flares for engines and other light sources because it makes things look more realistic.  It just that a little lens flare goes a LOOOOOONG way.  If possible I think allowing the users to control how much of a lens flare they get would be great, though Im not a coder and I have no idea if thats possible.  The  amount of lens flare that looks good is a rather subjective thing...
Title: Re: Feature request: glow points should act as lens flares
Post by: Nighteyes on September 20, 2011, 07:23:29 pm
but this method seems outdated. Using the pixel bightness seems to be a way more accurate way.

I'm not looking for accurate, I'm looking for creative freedom, and what if I want only flares on the engines? the HDR option would put streaks/flares on EVERYTHING bright enough to trigger the effect, creating EXACTLY that star trek lens flares madness. (especially in very bright lit backgrounds)
I want the option to control how my flares look, color, brightness and where and when they show up, the HDR option doesn't give me this control, and the glow point flare type rendering would.

basically enhanced bloom with HDR would be nice, but it has nothing to do with glow points rendering as flares, if you think about it, you would see how limiting the method you propose is...
Title: Re: Feature request: glow points should act as lens flares
Post by: DaBrain on September 21, 2011, 01:46:06 am
In the movie they used anamorphic lenses and added flares in post.

As soon as you add a lens flare to your game, you pretend the game is recorded by a camera with a lens.
Doing it closer to how it would work in real life, will create a more believable effect.
You would not use a fish-eye lens effect on a few objects only either.

By saying it will not work on bright backgrounds I assume you do not fully understand the concept of what I am suggesting.

Plus you can adjust the required brightness, so only very few will appear.
...and I want them for specular highlights.... because that simply looks amazing. :-)