Author Topic: Did someone say "Lens Flare"?  (Read 6647 times)

0 Members and 1 Guest are viewing this topic.

Offline Fry_Day

  • 28
Did someone say "Lens Flare"?
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:
Code: [Select]

$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:
Code: [Select]

$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.

 

Offline vyper

  • 210
  • The Sexy Scotsman
Did someone say "Lens Flare"?
Oooh!
I likey the sound of this!:)
"But you live, you learn.  Unless you die.  Then you're ****ed." - aldo14

 

Offline Fineus

  • ...But you *have* heard of me.
  • Administrator
  • 212
    • Hard Light Productions
Did someone say "Lens Flare"?
The people cry:

:hopping: Screenshots! Screenshots! :hopping:

 

Offline Flipside

  • əp!sd!l£
  • 212
Did someone say "Lens Flare"?
If someone can throw up a compiled version of the .EXE I could probs do some? ;)

Flipside :D

 

Offline IceFire

  • GTVI Section 3
  • 212
    • http://www.3dap.com/hlp/hosted/ce
Did someone say "Lens Flare"?
Excellent!  Should look fantastic!
- IceFire
BlackWater Ops, Cold Element
"Burn the land, boil the sea, you can't take the sky from me..."

 

Offline Fry_Day

  • 28
Did someone say "Lens Flare"?
Sorry, but I don't have any web-space, and I can't attach files, so you'll have to wait for someone else :(

 

Offline Flipside

  • əp!sd!l£
  • 212
Did someone say "Lens Flare"?
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

 

Offline Lightspeed

  • Light Years Ahead
  • 212
Did someone say "Lens Flare"?
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:
Modern man is the missing link between ape and human being.

 
Did someone say "Lens Flare"?
Quote
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.
just another newbie without any modding, FREDding or real programming experience

you haven't learned masochism until you've tried to read a Microsoft help file.  -- Goober5000
I've got 2 drug-addict syblings and one alcoholic whore. And I'm a ****ing sociopath --an0n
You cannot defeat Windows through strength alone. Only patience, a lot of good luck, and a sledgehammer will do the job. --StratComm

 

Offline redmenace

  • 211
Did someone say "Lens Flare"?
Fry_Day you need to contact stealth about a swooh account. :D
Government is the great fiction through which everybody endeavors to live at the expense of everybody else.
              -Frederic Bastiat

 
just another newbie without any modding, FREDding or real programming experience

you haven't learned masochism until you've tried to read a Microsoft help file.  -- Goober5000
I've got 2 drug-addict syblings and one alcoholic whore. And I'm a ****ing sociopath --an0n
You cannot defeat Windows through strength alone. Only patience, a lot of good luck, and a sledgehammer will do the job. --StratComm

 

Offline Fry_Day

  • 28
Did someone say "Lens Flare"?
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.

 
Did someone say "Lens Flare"?
Quote
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.
just another newbie without any modding, FREDding or real programming experience

you haven't learned masochism until you've tried to read a Microsoft help file.  -- Goober5000
I've got 2 drug-addict syblings and one alcoholic whore. And I'm a ****ing sociopath --an0n
You cannot defeat Windows through strength alone. Only patience, a lot of good luck, and a sledgehammer will do the job. --StratComm

 

Offline Fry_Day

  • 28
Did someone say "Lens Flare"?
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.

 

Offline Flipside

  • əp!sd!l£
  • 212
Did someone say "Lens Flare"?
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

 

Offline Fry_Day

  • 28
Did someone say "Lens Flare"?
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).

 

Offline Amon_Re

  • 28
    • http://www.kefren.be
Did someone say "Lens Flare"?
*drools*

*drools some more*

Cheers
Sig? What sig?

 

Offline Flipside

  • əp!sd!l£
  • 212
Did someone say "Lens Flare"?
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 :)

 

Offline Lightspeed

  • Light Years Ahead
  • 212
Did someone say "Lens Flare"?
those lense flares -- way too colourful :D
Modern man is the missing link between ape and human being.

 

Offline Flipside

  • əp!sd!l£
  • 212
Did someone say "Lens Flare"?
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