Jump to content

Glowing features on models/parts?


Recommended Posts

I'm currently wrapping my head around my very first modeling project for KSP, but I'm working towards my eventual goal, which is creating a multitude of sci-fi themed parts (to fill the appalling lack of such parts). One of the features that these parts will have is glowing features on the model, (like softly glowing colored lines, for instance).

How is this accomplished (in general) with Blender -> KSP? Is this a texture thing? A shader thing? Both? Something I have to take care of in Blender? In the config?

Link to comment
Share on other sites

You might want to look at the way engines turn red when firing, or small stock batteries that have a little green LED. :)

It looks like, at least with KW, it's done using an animation? That doesn't make any sense to me:

MODULE

{
name = ModuleAnimateHeat
ThermalAnim = GriffonEmissiveAnim
}

EDIT:

It looks like the glowing is done using an emissive texture on some other mods? Is it autoloaded based on part name? Hmm...

Edited by JordanL
Link to comment
Share on other sites

its a shader, KSP -> Emssive (diffuse, bumped, spec, etc)

When you select it, you get a third texture slot for an emissive, which is a black and white gradient map (black is no glow, white is full glow)

For engine glow, at this point you set up an animation on the emissive Red,Green,Blue parameters for your material so your heat glow has a curve (time code zero is for temperature = 0, and the end time code is for max time code)

I've never used a glow outside of the engine, so I'm not exactly sure how you control it for normal parts/lights or whatever.

Link to comment
Share on other sites

its a shader, KSP -> Emssive (diffuse, bumped, spec, etc)

When you select it, you get a third texture slot for an emissive, which is a black and white gradient map (black is no glow, white is full glow)

For engine glow, at this point you set up an animation on the emissive Red,Green,Blue parameters for your material so your heat glow has a curve (time code zero is for temperature = 0, and the end time code is for max time code)

I've never used a glow outside of the engine, so I'm not exactly sure how you control it for normal parts/lights or whatever.

The shader is selected after you import the model into Unity, right?

I'm still very new at this.

Link to comment
Share on other sites

The shader is selected after you import the model into Unity, right?

I'm still very new at this.

Yeah, once its imported you click on the "Material" folder and it should have the individual materials from your model.

I made a Unity setup tutorial video, if you watch it from about 2:45 it should show you how to import files and set up their materials and textures, though in it I don't select one of the emissive shaders.

Link to comment
Share on other sites

Alright, so all of your help got me very far. The problem now is that I seem to have done everything correctly, and I still don't have the glow working.

I created a KSP/Emissive/Specular shader, and made an emissive texture that's greyscaled (black being no glow), assigned it in Unity. I then created an animation which cycled the alpha of the emissive between 1.5 and -.25 over the course of 3 seconds (named EmissiveAnim), exported it using the PartTools, and created the cfg file.

But no joy.

This is what the cfg looks like (for testing purposes)

PART
{
// --- general parameters ---
name = TestFuselage
module = Part
author = Jordan

// --- asset parameters ---
mesh = model.mu
scale = 1.0
rescaleFactor = 1.0

// --- node definitions ---
node_stack_top = 0.0, 6.0, 0.0, 0.0, 1.0, 0.0, 2
node_stack_bottom = 0.0, -6.0, 0.0, 0.0, 1.0, 0.0, 2

// --- editor parameters ---
TechRequired = advConstruction
cost = 225
category = 0
subcategory = 0
title = Test Fuselage
manufacturer = Jordan
description = this is a test

// attachment rules: stack, srfAttach, allowStack, allowSrfAttach, allowCollision
attachRules = 1,1,1,1,1

// --- standard part parameters ---
mass = 0.5
dragModelType = default
maximum_drag = 0.2
minimum_drag = 0.3
angularDrag = 2
crashTolerance = 6
maxTemp = 2900
breakingForce = 5000
breakingTorque = 5000

RESOURCE
{
name = LiquidFuel
amount = 405
maxAmount = 405
}

RESOURCE
{
name = Oxidizer
amount = 495
maxAmount = 495
}
MODULE
{
name = ModuleAnimateGeneric
animationName = EmissiveAnim
animSwitch = true
isOneShot = true
}
}

For the longest time my part was actually falling through the ground, but I think it was because I didn't declare the mesh and had allowCollisions on 0. After fixing those two, it no longer falls through things. (It's still falling through the ground, it's just no longer falling through other parts. I think I screwed up the collision mesh somehow.)

But when I load the part on the launch pad I have no emissive going on at all.

Any pointers?

EDIT:

Even weirder, in Unity if I set up a camera and press play it animates the emissive properly.

Edited by JordanL
Link to comment
Share on other sites

try this out: http://forum.kerbalspaceprogram.com/threads/25023

play with 'intensity' for light and the 3 'emmissivecolor' value (also notice that regarding light and shader ksp overpass/ignore a few unity param).

Try step by step you part with this tuto you should be oki.

Hmmm... so I should use the emissive color to control the glow instead of the alpha?

Link to comment
Share on other sites

some other related things may be:

- check your anim hierarchy (sometime better to split prefab and isolate/separate different fonctionnality top of root within different game object) unity animation(s) component is very sensitive to hierarchy and may dislike in certain case to be imbricated.

- blender layer and unity shader, from what i experienced usually better to separate shader by layer in blender if you use multiple ones

keep trying with a simple geometry like only a cube and you should point out what you missed.

Edited by WinkAllKerb''
Link to comment
Share on other sites

My advice would be to set it up as a static emissive texture first and make sure it's working then add the animation.

That way you only need to play with settings on the shader and can see if it glows in unity.

Once you get a non-animated glowey part working you can start trying to animate it.

This separates the 2 problems and lets you deal with them separately rather than wondering wether the problem is with the shader or the animation.

Link to comment
Share on other sites

My advice would be to set it up as a static emissive texture first and make sure it's working then add the animation.

That way you only need to play with settings on the shader and can see if it glows in unity.

Once you get a non-animated glowey part working you can start trying to animate it.

This separates the 2 problems and lets you deal with them separately rather than wondering wether the problem is with the shader or the animation.

I'll be doing that on a test cube this evening when I get home from work.

I don't trust the Unity preview at all though. My Unity render had both static and pulsing emissives, and my .mu had neither.

Link to comment
Share on other sites

I don't trust the Unity preview at all though. My Unity render had both static and pulsing emissives, and my .mu had neither.

you can't, KSP ignore/overpass some unity parameter in many different cases, wish i can give more clue about this but i m more a generalist than a specialist :) isolate iterative testing most of the time the simpliest way to figure them out one by one.

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