Nexus Skirmisher
Nexus Modding => Mod Development / Released Mods => Topic started by: jstubbles 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!).
-
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.
-
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.
-
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.
-
never? just start a battle in a scenario with no lightsources and you'll see.
-
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.
-
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 :'(
-
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.
-
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.
-
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. ;)
-
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.
-
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.
-
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.
-
no, my bad. It's meant for nexus 1.01. Which one did you download?
-
Great idea for that patch, I'm gonna have a look at it ;)
-
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!
-
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.
-
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)
-
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.
-
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)