Author Topic: Script request: Lens flares  (Read 2411 times)

0 Members and 1 Guest are viewing this topic.

Offline Nighteyes

  • 211
Script request: Lens flares
well I always thought this is impossible but apparently a script that generates lens flares is possible, here is a request I made to M!M, he can't work on this but maybe someone else wants to give this a try?

Nighteyes:
Hi there :)
you guessed it, I have another script request, this time its LENS FLARES
I don't know if its even possible, but can a script create a lens flare at a specific point, say a ships engine, it will need to fade and grow in size according to the ships speed, and also act as a lens flare, meaning rendering on top of everything unless something is obscuring it(like how suns work)
let me know what you think, this can also be great for weapon impacts as well as capships explosions

M!M:
Hello Nighteyes,
Theoretically it would be possible but it would be very ineffective as you have to do a ray check for every ship and every ship engine meaning that you would need to do n * m (n: number of objects, m: number of thrusters) which will decrease FPS to an unplayable point. A better way would be to determine the position of the thruster on the screen, read the z-Value and compare it to the z-Value of the point. That way you have pixel-exact occlusion checking without the overhead of a ray check for every object out there and the flares would render on top of the other ships because you would do this after rendering all other objects. A problem would be that you could only check a thruster which is on the screen so a flare would just disappear when the center of the thruster isn't on the screen anymore.
Sadly, I won't be able to work on this as I'm pretty occupied with RL currently and I rarely find enough time to do something for FreeSpace.

Regards,
m!m

*to my knowledge this is how lens flares work no? only show up when on screen? I'm not sure if its a real problem...

 

Offline m!m

  • 211
Re: Script request: Lens flares
It would actually be better to have this as a feature request for the SCP as a script doesn't have the ability to get the z-Value of a given pixel and it isn't able to hook into the rendering pipeline at the point where this would be necessary but these features could be added quite easily. The cause why it would be better to have this as a code solution is that the performance of the operations would be better and the lens flare drawing could take advantage of things like geometry batching to improve performance.

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: Script request: Lens flares
It's been requested a few times, but each time it's been ignored because people don't want FSO to become a JJ Abrams production...
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

 

Offline Nighteyes

  • 211
Re: Script request: Lens flares
lens flares can be done in a way that won't overdo the effect, think Mass Effect for reference.
I think the problem is people think of lens flares as something huge with all the small flares all along the screen, what I'm talking about is only the effect itslef, rendering ontop of everything else and causing a nice color bleed, modders can choose to overdo it or not.

@mjn.mixael: I assume you'r in favor of such a script? you seem to have quite a liking to lens flares :)

 

Offline pecenipicek

  • Roast Chicken
  • 211
  • Powered by copious amounts of coffee and nicotine
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • PeceniPicek's own deviantart page
Re: Script request: Lens flares
lens flares can be done in a way that won't overdo the effect, think Mass Effect for reference.
have you played ME2?!? that **** be flarey like hell.
Quote
I think the problem is people think of lens flares as something huge with all the small flares all along the screen, what I'm talking about is only the effect itslef, rendering ontop of everything else and causing a nice color bleed, modders can choose to overdo it or not.
if i remember correctly, nexus 2 preview had ****in lovely lens flares on the thrusters.
Skype: vrganjko
Ho, ho, ho, to the bottle I go
to heal my heart and drown my woe!
Rain may fall and wind may blow,
and many miles be still to go,
but under a tall tree I will lie!

The Apocalypse Project needs YOU! - recruiting info thread.

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: Script request: Lens flares
Yes, I am very, very much in favor of getting a more controlled lens flare system. Whether script or code doesn't really matter.. (Would prefer code). I was super annoyed at this thread.
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.