Jump to content

Making lights?


/not/pol/

Recommended Posts

As far as I could tell, there isn't a fully written guide somewhere, but it's not terribly difficult to do if you're familiar with Unity. If you have Unity set up to export models to .mu with PartTools and you know how Unity editor works, then making a working light goes like this*:

1. Import the model you wish to make into a light from your preferred modelling program.

2. Add a Light object to your model (spotlight or point light will be the only ones you can use) and adjust its parameters (spotlight cone angle and distance, point light distance).

3. Add and Animation component (not Animator; delete any Animator component than comes up) to your model and create a new animation with a name of your choosing (just make sure you reference it correctly in the .cfg). Edit the animation to change the alpha channel of the light object (may have to search drop-down menus for it) from 0 to 1. Save the animation and reference it in the Animation component.

4. Export part to .mu.

*pics when I can get some after work, unless someone beats me to it

 

That doesn't cover emissives which can give the part a glow at the light origin. Emissives have tutorials for Unity 4 but this post best explains emissives in Unity 5.

 

Hopefully this is enough to get you started.

Link to comment
Share on other sites

2 minutes ago, SchwinnTropius said:

As far as I could tell, there isn't a fully written guide somewhere, but it's not terribly difficult to do if you're familiar with Unity. If you have Unity set up to export models to .mu with PartTools and you know how Unity editor works, then making a working light goes like this*:

1. Import the model you wish to make into a light from your preferred modelling program.

2. Add a Light object to your model (spotlight or point light will be the only ones you can use) and adjust its parameters (spotlight cone angle and distance, point light distance).

3. Add and Animation component (not Animator; delete any Animator component than comes up) to your model and create a new animation with a name of your choosing (just make sure you reference it correctly in the .cfg). Edit the animation to change the alpha channel of the light object (may have to search drop-down menus for it) from 0 to 1. Save the animation and reference it in the Animation component.

4. Export part to .mu.

*pics when I can get some after work, unless someone beats me to it

 

That doesn't cover emissives which can give the part a glow at the light origin. Emissives have tutorials for Unity 4 but this post best explains emissives in Unity 5.

 

Hopefully this is enough to get you started.

Thanks.

Link to comment
Share on other sites

  • 1 year later...

Found this whilst looking at emissives, which I believe would serve you in making the best looking Sol:
 



Sol is incredibly boring when looked at with the naked eye (too much light), so making it a glowing inferno in the vein of its current look is probably what you want... Emissives could be lightmapped with a greyscale duplicate of sol's texture as a UV, and the glow would only come from the brightest elements of Sol. Really fun mod btw. Would love to see if there is any way to give them just a little gravity and x10 them in size, cos i got a sat reserved for a little 'zero point mini-planet' ball experiment in space and that size increase should be big enough for Kerbals to clip onto then. Awesome work either way!

Link to comment
Share on other sites

  • 1 month later...
On 7/3/2017 at 3:39 PM, SchwinnTropius said:

As far as I could tell, there isn't a fully written guide somewhere, but it's not terribly difficult to do if you're familiar with Unity. If you have Unity set up to export models to .mu with PartTools and you know how Unity editor works, then making a working light goes like this*:

1. Import the model you wish to make into a light from your preferred modelling program.

2. Add a Light object to your model (spotlight or point light will be the only ones you can use) and adjust its parameters (spotlight cone angle and distance, point light distance).

3. Add and Animation component (not Animator; delete any Animator component than comes up) to your model and create a new animation with a name of your choosing (just make sure you reference it correctly in the .cfg). Edit the animation to change the alpha channel of the light object (may have to search drop-down menus for it) from 0 to 1. Save the animation and reference it in the Animation component.

4. Export part to .mu.

Could I get a bit more detail on how to add a spotlight to a part in Unity? I am rather new to unity and, although I have gotten a part into Kerbal with textures and motion animation, I have been unable to figure out the lights.

After following the steps above I got a spotlight to turn on and off in the hanger, however it did not work when I launched and I could not change the size.

Link to comment
Share on other sites

2 hours ago, Starlord Kerman said:

-snip-

Should be able to change the size and angle in Unity, though I can't remember exactly how at the moment (2am here, on mobile). I know there's a tag to set for it as well. I need to re-research things, and do those long-overdue screenshots, after I sleep.

Link to comment
Share on other sites

@Starlord Kerman I have a file with the Blender and Unity projects in it here  (Light WIP.zip file) that sets up a spot light and an omnidirectional light - Note: I haven't been able to get both the emissive animation and light to work at the same time - either the emisive animation works and the light is permanently on, or the light can be toggled on and off but the emissive animation doesn't work. If you should manage to figure this out I'd be interested in how you yours working.

Link to comment
Share on other sites

@wasmlmy current project doesn't deal with emissives, but I'll definitely look into that in my next project. I figured out how to use the spotlights, and I have almost finished lighting a greenhouse I'm making, however some of the spotlights flicker and I can't seem to figure out why. I use the same animation to turn all the spotlights on and off by changing the intensity between 0 and 5. In the current set up I have 8 spotlights in a circle and a 9th spotlight in the middle, and only the middle spotlight flickers, I made a video of the issue: https://youtu.be/w_6xQUnkxpE If anyone has dealt with this issue before, I'd like to hear the solution.

Edited by Starlord Kerman
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...