Jump to content

[Solved] Spotlights illuminating planets from space


Recommended Posts

Hi,

@Spin discovered a very weird bug in my Feline Utility Rovers mod, which i'm not able to understand.

The lights of the rover are able to illuminate Kerbin from Orbit: (Solution can be found below)
xilmSmk.jpg

This is a reallybig distance! And i double checked in Unity and in game (with logs) that the distance is set to only 60m and an intensity of 4. This definitely should'nt be something powerful enough to do this.
Here is the configuration of the lights:

7e129at.png

Does anyone have an idea what could cause this or even better how to fix this?

Solution:

The solution to this problem is to set the culling mask of the light to ignore the 10.th layer (Scaled Scenery) .
See here for the layers in unity: 

How?

First if not already done you have to set a name to the layer 10, e.g. Scaled Scenery, by clicking on "Layers" in the top right corner and then on "Edit layers" in the drop-down menu.
After that select the light and click on the button next to"Culling Mask" and then click on "Scaled Scenery" or whatevery you named layer 10. The checkmark should disappear.

Thats it, now you only have to export the part again with the KSP Partools

Edited by Nils277
Link to comment
Share on other sites

Are you using time-warp?  It is known problem with KSPs use of 'scaled space'.  Essentially the big planet you see 'in the background' is actually a smaller planet closer to the foreground, close enough to be illuminated by the lights on the craft.

I've not seen the problem outside of that (timewarp).

Link to comment
Share on other sites

No, it is not in timewarp. I have seen simliar things also with e.g. the lights of the Bufflo (although they are way less intensive) and been told that the lights from B9 are doing the same thing.

The 'scaled space' explains why the planet is actually well within the reach of the lights. I'm just wondering why the stock lights do not have this problem. There must be some kind of setting for the lights... :/ 

Edited by Nils277
Link to comment
Share on other sites

8 hours ago, Nils277 said:

@Shadowmage Your mention of 'scaled space' gave the right clue to find a fix. KSP uses Layer 10 for Scaled Scenery. The lights do not illuminate kerbin from orbit when i set the lights to ignore this layer. Yay!

Excellent, glad you were able to find a solution.

Now to somehow remember this solution when it comes time for me to fix the lights in my mod(s) :)

Link to comment
Share on other sites

35 minutes ago, SchwinnTropius said:

For anyone that has little experience with making lights, how might someone set the light to ignore that Layer?

First if not already done you have to set a name to the layer 10, e.g. Scaled Scenery, by clicking on "Layers" in the top right corner and then on "Edit layers" in the drop-down menu.
After that select the light and click on the button next to"Culling Mask" and then click on "Scaled Scenery" or whatevery you named layer 10. The checkmark should disappear.

Thats it, now you only have to export the part again with the KSP Partools

Link to comment
Share on other sites

@Nils277 That's one helluva revelation! Thank you dude for sharing that.

I have no time to create a new topic, but there's one more thing I found nobody knows about. The shader on the Kerbal's visor uses one of the legacy Unity shaders, which has a very valuable attribute: it is specular, has transparency and can mix with underlying transparent materials without cancelling them out. The shader name is Alpha-Glossy (Legacy Shaders/Transparent/Specular) and can be downloaded from the Unity website, the game supports it and PartTools will export it.

Edited by Enceos
Link to comment
Share on other sites

  • 1 year later...

Sorry  but I attempted several shearch without result. Moreover, this thread don't solve my problem. Maybe because it's just for developpers... but I'm just and user without any knowledge in use of Unity and assets modification. 

This bug degrades my immersion so if someone could help me ?

Thank you in advance

Link to comment
Share on other sites

On 10/16/2018 at 5:20 PM, LtWilliamManuel said:

Sorry  but I attempted several shearch without result. Moreover, this thread don't solve my problem. Maybe because it's just for developpers... but I'm just and user without any knowledge in use of Unity and assets modification. 

This bug degrades my immersion so if someone could help me ?

Thank you in advance

What exactly is your problem? If you see the light problem in another mod, report the bug (best with a screenshot) in the forum thread of the mod that causes the problem. Also link to this thread (or the first post) to help the mod author to solve the bug.

Link to comment
Share on other sites

@LtWilliamManuel Before uninstalling all your mods one by one you might see if you can track the mod down by figuring out which light it is - should be easy to see which light lights the planet when you turn it on, go into the VAB and find the part and check the Manufacturer in the part selection. See what other parts are from that manufacturer and it may give you a clue - if not try googling the name or manufacturer - might turn something up. Could be a lot less painful if you have lots of mods.

Link to comment
Share on other sites

9 hours ago, wasml said:

@LtWilliamManuel Before uninstalling all your mods one by one you might see if you can track the mod down by figuring out which light it is - should be easy to see which light lights the planet when you turn it on, go into the VAB and find the part and check the Manufacturer in the part selection. See what other parts are from that manufacturer and it may give you a clue - if not try googling the name or manufacturer - might turn something up. Could be a lot less painful if you have lots of mods.

Thank you :)  ; I didn't have think to this method. However, I already begun delete some of those I suspected and add them again one by one. For now, one reproduce my bug : DockingPortToggle. So in fact, even with your method, as it isn't a part which cause that, I wouldn't have find the bug like that. I'll continue to add the others one by one and test if another one cause the same bug ; but for now I would like to inform the developper of this mod. I said "would like" because when I shearch it in google, I don't find it. Maybe this folder was a part in the whole of an another mod. But for now I don't know what.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...