December 22, 2024, 10:25:47

Author Topic: Weapon lightsources  (Read 24375 times)

Offline jstubbles

  • Petty Officer
  • **
  • Posts: 169
  • Karma: 2
    • View Profile
    • http://www.ivassago.com
Weapon lightsources
« on: April 04, 2010, 19:16:27 »
Figured I'd ask, but I'm assuming hardcoded like everything else.

Just wondering if anyone has had success with projectiles casting light in non-pitch black conditions? If you play in the complete shadow of a planet or something, you get amazing realtime lighting from weapons and explosions, but it shows nothing at all if there's any sun lighting on the ships (boo!).

Offline The Old Dragon

  • Ensign
  • ***
  • Posts: 362
  • Karma: 6
    • View Profile
    • http://
(No subject)
« Reply #1 on: April 04, 2010, 22:28:14 »
I can't really answer that for the simple reason it's well beyond me, but I do remember a post from the now long deceased official forums where someone mentioned that you can get some quite spectacular lighting effects by having two suns at opposite ends of the mission scene.
Although both sides of the ship are in the light, Nexus apparently recognises that the two suns are actually casting shadows and therefore adds some effects to show things more clearly.
Better to look the fool by asking, then prove them right with ignorance.

Offline jstubbles

  • Petty Officer
  • **
  • Posts: 169
  • Karma: 2
    • View Profile
    • http://www.ivassago.com
(No subject)
« Reply #2 on: April 04, 2010, 23:23:16 »
yeah, I can make systems with 2 suns, that's not the problem though.

I'm talking about when weapons fire and impact the ships. If you play in the shadow of a moon for instance, where it's pitch black, the weapons create lightsources that affect the ships. But if the ships are being hit with a lightsource from the sun, the weapons don't make lightsources anymore. it's completely silly.

Offline Arparso

  • Administrator
  • Lieutenant
  • *****
  • Posts: 558
  • Karma: 14
  • I can see you...
    • View Profile
    • http://arparso.de/nexus
(No subject)
« Reply #3 on: April 05, 2010, 02:45:58 »
Do you happen to have any screenshot of that? I'm fairly certain Nexus doesn't have this kind of dynamic lighting, except for the suns themselves. At least all I've ever seen is clever blending of effect textures to give a fake lighting impression.

Offline Mularac

  • Lieutenant
  • ***
  • Posts: 531
  • Karma: 11
    • View Profile
(No subject)
« Reply #4 on: April 05, 2010, 09:27:23 »
never? just start a battle in a scenario with no lightsources and you'll see.

Offline Arparso

  • Administrator
  • Lieutenant
  • *****
  • Posts: 558
  • Karma: 14
  • I can see you...
    • View Profile
    • http://arparso.de/nexus
(No subject)
« Reply #5 on: April 05, 2010, 12:25:28 »
Odd... when I tried it yesterday in my Freespace mod I didn't see anything, but with regular Nexus ships and weapons I see the lighting effect. After having a look at the effect with PIX, I'd guess, Nexus uses the empty "lighting slot" of the sun to create that weapon lighting effect. That would explain, why we don't see any of that lighting when fighting in sunlight.

Nexus seems to use a single-pass lighting system with support for one or two directional lights, depending on the number of suns. Only if the current scene is not affected by sunlight, because it's hidden behind a moon or planet, the sun lighting slot gets available for local light sources. That doesn't give a realistic lighting result, because weapon lighting will be treated as directional light instead of local, but in the heat of battle noone notices that anyway.

Offline jstubbles

  • Petty Officer
  • **
  • Posts: 169
  • Karma: 2
    • View Profile
    • http://www.ivassago.com
(No subject)
« Reply #6 on: April 06, 2010, 05:41:36 »
Even with a single light source (sun) weapon effects to do create light sources. In our BSG mod, the current systems only have 1 light source, but the weapons have no lighting effects :(

I guess it's just another one of those horrible Nexus limitations :'(

Offline Arparso

  • Administrator
  • Lieutenant
  • *****
  • Posts: 558
  • Karma: 14
  • I can see you...
    • View Profile
    • http://arparso.de/nexus
(No subject)
« Reply #7 on: April 06, 2010, 11:15:17 »
Quote from: jstubbles
Even with a single light source (sun) weapon effects to do create light sources. In our BSG mod, the current systems only have 1 light source, but the weapons have no lighting effects :(
That's because Nexus uses the "single light source"-shader, if there's only one sun in your system, so there's no room for weapon lights unless you're in a moon's shadow. Nexus doesn't do multiple lighting passes on the geometry, so that's the only light you'll ever get in this kind of star system. The "two light sources"-shader is only being used in systems with two or more stars.

That's actually good news, because if you create a twin-star system and hide one of the stars behind a planet or moon, you'll actually get weapon lighting effects AND sunlight at the same time. Obviously that puts some limitations on your mission background design and care needs to be taken to not reveal the twin-star system when looking at nearby planets and such, but at least it IS possible to get both weapon lighting and sunlight at the same time.

Offline GeoModder

  • Chief Petty Officer
  • **
  • Posts: 279
  • Karma: 4
    • View Profile
    • http://
(No subject)
« Reply #8 on: April 06, 2010, 19:59:37 »
Couldn't it be possible to hide a lightsource (a tiny sun) in a planet? If it has the same orbital parameters as the planet it is hiding in nobody is the wiser except when opening the solar system builder.

Offline Arparso

  • Administrator
  • Lieutenant
  • *****
  • Posts: 558
  • Karma: 14
  • I can see you...
    • View Profile
    • http://arparso.de/nexus
(No subject)
« Reply #9 on: April 06, 2010, 22:49:13 »
Depends. I'm not sure, if the planet still casts a shadow, if the sun is hidden inside of it. If the sunlight "escapes" the planet's body, we'd have regular twin star lighting conditions without weapon lighting. Someone would need to test this first. ;)

Offline jstubbles

  • Petty Officer
  • **
  • Posts: 169
  • Karma: 2
    • View Profile
    • http://www.ivassago.com
(No subject)
« Reply #10 on: April 09, 2010, 17:24:06 »
I see what you're getting at, Arparso. But when you add a second sun to a system, it acts like an orbital body - it's not stationary. So every time you play a mission, that mission's lighting is going to change since the orbital bodies are, well, orbiting :P

So it'd be next to impossible to have it consistently be in the shadow of the second sun.


**EDIT**

just did a test right now where I used very small color and size vars for the second sun (0.00001) - it worked! We had a lightsource from the main sun AND weapon lightsources! :D

Thanks for the tips Arparso! it looks badass now :)


I wish we could have a dual-star system along with the weapon source lighting, but I'm just happy we can have ANY lighting alongside the weapon sources.

Offline Mularac

  • Lieutenant
  • ***
  • Posts: 531
  • Karma: 11
    • View Profile
(No subject)
« Reply #11 on: April 29, 2010, 00:34:26 »
Patch that adds those lightsources into the vanilla game:

If you haven't extracted the contents of the nexus_00.dat file, apply this patch: http://www.moddb.com/downloads/dynamic-lighting-effect-patch-default mirror: http://www.megaupload.com/?d=FAZON1O6

if you had: http://www.moddb.com/downloads/dynamic-lighting-effect-patch-decompressed-dat mirror: http://www.megaupload.com/?d=L9GDN8RF

also, please note that I made those patches using Nexus version 1.01, so I don't know what will happen if you apply it on the 1.0 version. I THINK it'll work, but I think it's best to be in the safe side and just update the damn game if you haven't already.

Offline jstubbles

  • Petty Officer
  • **
  • Posts: 169
  • Karma: 2
    • View Profile
    • http://www.ivassago.com
(No subject)
« Reply #12 on: April 29, 2010, 21:05:11 »
thanks mularac!
I tried this but it didn't seem to work in the main game. Is my version correct? You said 1.1, steam has 1.01.

Offline Mularac

  • Lieutenant
  • ***
  • Posts: 531
  • Karma: 11
    • View Profile
(No subject)
« Reply #13 on: April 29, 2010, 21:36:52 »
no, my bad. It's meant for nexus 1.01. Which one did you download?

Offline Arparso

  • Administrator
  • Lieutenant
  • *****
  • Posts: 558
  • Karma: 14
  • I can see you...
    • View Profile
    • http://arparso.de/nexus
(No subject)
« Reply #14 on: April 29, 2010, 22:03:22 »
Great idea for that patch, I'm gonna have a look at it ;)

Offline jstubbles

  • Petty Officer
  • **
  • Posts: 169
  • Karma: 2
    • View Profile
    • http://www.ivassago.com
(No subject)
« Reply #15 on: April 30, 2010, 00:27:41 »
I downloaded the version for if you've unpacked - it's all of the solar system files. I renamed the orig's to .BAK then dropped them into the System folder - but I'm not getting the lighting in the mission I'm on.


Just did a fresh reinstall on Nexus - seems to work fine now :)

Thanks!

Offline GeoModder

  • Chief Petty Officer
  • **
  • Posts: 279
  • Karma: 4
    • View Profile
    • http://
Re: Weapon lightsources
« Reply #16 on: March 27, 2011, 12:56:42 »
A quick question. Is this 'black sun' object from the patch necessary in a system which already has two suns? I'm thinking of the Atrox system in the Nexus campaign. I suppose not, but I'm unsure because I just replayed an old mission save within the Atrox system and I can't spot weapons lighting effect.

Offline Mularac

  • Lieutenant
  • ***
  • Posts: 531
  • Karma: 11
    • View Profile
Re: Weapon lightsources
« Reply #17 on: March 27, 2011, 21:55:13 »
To be honest with you, I didn't did a thorough test of the patch, but it should add weapon lightsources on every mission.
(You should start a new campaign if you're using the packed version, it at first nothing's changed)

Offline GeoModder

  • Chief Petty Officer
  • **
  • Posts: 279
  • Karma: 4
    • View Profile
    • http://
Re: Weapon lightsources
« Reply #18 on: March 27, 2011, 22:22:41 »
Ah, that was it then.
I did start a new campaign, and saw lighting from weapons on my target in the second mission. Although quite faint compared to the spectacle in the BSG mod. Half the hull literally looks on fire in that mod.

Offline Mularac

  • Lieutenant
  • ***
  • Posts: 531
  • Karma: 11
    • View Profile
Re: Weapon lightsources
« Reply #19 on: March 29, 2011, 10:43:51 »
I don't really know what manages the scale of the effect, probably it's due differences in the ship's models and weapons effects, it's not something you can find in the lightsources code (which is rather minimal)