Jump to content

How to make Emissive Animations in KSP with the Color Animation Editor


Recommended Posts

this seems to be Squad's work around/fix for Emissive animation after Unity abandoned material properties animation in legacy animation component.

Min/Max time is the start and end of the emissive animation, in seconds
Relative, this is the path to the object's material to be animated, excluding the object hosting the Animation component. For example your Animation component is on Parent Object, it has a Cube and Sphere as children. You want to animate the material on Cube, you enter Cube in the Relative field. If you want to animate Sphere, enter Sphere. If Cube is child of Sphere which is child of Parent, and Animation component is on the Parent Object, and you want to animate the material on Cube, you enter Sphere/Cube in the Relative field.
Type, should be Material in nearly all cases. Unity5 can still do other types of legacy animation so there's no need to rely on this for other types.
Property, _EmissiveColor for Emissive; Any color property should work. Whether they are actually applied in the shader is another matter.
Color Gradient, represents start and end RGB(A) values from left to right. left is start of the animation, right is the end.

lZtBKal.jpg

 

 

 

Combining multiple objects each with emissive animation
Select the clip for each Object; right click and select Compile Selected. if it was successful you will see Console log "It Worked!" Rename and assign the combined clip as usual. Thanks to Porkjet for the pointer!
iTcyqvy.jpg

 

 

 

Edited by sumghai
Pinned and renamed thread title for clarity
Link to comment
Share on other sites

Hi, I'm looking at your post and I don't understand. Are these properties your referring to in unity somewhere? Do we no longer animate emissives in unity by animating the emissive properties in the material?

 

I tried running one of my parts in 1.1 and when activating one of the emissive animations, it caused some issues. Namely the screen darkened, but did show the animation.

Edit: OK, so I found the _Emissive Color property in the animation window. I'm still looking for those other fields you are referring to, I'll keep messing with it.

Edited by martinezfg11
Link to comment
Share on other sites

 

Huh, that looks interesting. I was wondering what their workaround might be. For now I'm still doing everything in Unity 4.2.2, since I don't yet have a case of something actually needing Unity 5. The only thing that comes to mind as strictly needing Unity 5 and the U5 part tools is importing the new IVA props.

 

 

Link to comment
Share on other sites

the new Internal See through Shader might require Unity5. Haven't looked at that in detail or tried anything, but might have a sense of how it works... a modified kind of backface culling I think. the new IVAs have extra geometry around it, presumably facing inwards toward the internals to hide faces on internals showing through at unwanted directions.

Color Animation Editor so far seems very limited, can't affect any material other than on the same object as the animation clip, as each object gets an instance of the material, not shared. so any emissive objects has to be in a single mesh. relative path setting doesn't seem to affect anything, nor break anything. It's enough for engine bells and window lights, but very limited for anything more complex than that. maybe possible to add transform animation after the color animation clip is created.

All in all it's kinda disappointing. Seems 4.2.2 is still the best option for part modders for the time being. part of me feels like Squad should just wrap up KSP and start something from scratch with Unity 5 or wahtever. KSP2 or whatever else. Current game is becoming more and more of a frankenstein with each update, 4+ years on spanning 3 different Unity versions.

Edited by nli2work
Link to comment
Share on other sites

Yepp, animating is a big pain in the butt compared to 4.2.2, but at least we got some replacement tools at all. It's still possible to do all the things we used to be able to, it's just more complicated now.

"Relative" can specify a path in the hierarchy to another sub object.

Also mu wrote another tool that can compile several animations into a single clip, you use it by selecting the anim files, right click -> animation -> Compile selected

You can afterwards open the anim in the animation window and fine-tune the curves like you used to. It'll mark the material properties as missing, but works anyway.

Link to comment
Share on other sites

4 hours ago, Porkjet said:

Yepp, animating is a big pain in the butt compared to 4.2.2, but at least we got some replacement tools at all. It's still possible to do all the things we used to be able to, it's just more complicated now.

"Relative" can specify a path in the hierarchy to another sub object.

Also mu wrote another tool that can compile several animations into a single clip, you use it by selecting the anim files, right click -> animation -> Compile selected

You can afterwards open the anim in the animation window and fine-tune the curves like you used to. It'll mark the material properties as missing, but works anyway.

Aha! Thanks for the tip! I was wondering what that animation compiler did. I thought it was part of MU export. I tried Relative path using Parent/Child/child syntax (based on what I see in 4.2.2 animation clips) etc. doesn't seem to work? I can only get emissive anim to work when applied directly to the object

Link to comment
Share on other sites

 

I'm assuming this method doesn't allow you to set RGB values above 1.0, to super-saturate the emmissive? I've been relying on that in Unity 4.2.2, so that the inside of my engine bells can transition from red, up through orange, yellow, and white realistically, just via saturation. My animation usually ends with the values "5,2,1" for RGB.

Link to comment
Share on other sites

hard to say. You might be able to push the keys in Unity 5 after creating the clip. But there are other render settings that might override it in game... tone mapping for example, might map whatever blow-outs you animate back to 0-255. I don't really know how pre-Unity5 shaders interact with Unity5's HDR

Edited by nli2work
Link to comment
Share on other sites

color animation editor is part of PartTools Legacy. the zip file next to Assetbundles.unitypackage in PartTools 1.1

Asset Compiler is for making assetbundles for things like FX prefabs, Plugins, and KSPedia pages.

Link to comment
Share on other sites

 

I tried this out in Unity 5, and yeah... the over-saturation thing doesn't seem to work anymore with this method. At least not via the UI.

 

Below is the same engine. Left side is Unity 5, with the color animation, using the same proportion of R/G/B as my Unity 4 setup, but normalized to within the 0-255 range since that's all it permits. Right side is how I have it currently in Unity 4.2.2:

 

KSP%202016-04-04%2013-36-30-01.jpg

 

EDIT: The benefit of using saturation, is that you can have the spectrum of red, orange, yellow, and white appear simultaneously, and those hotter colors appear only at the hot end of the animation.

 

Link to comment
Share on other sites

2 hours ago, NecroBones said:

 

I tried this out in Unity 5, and yeah... the over-saturation thing doesn't seem to work anymore with this method. At least not via the UI.

 

Below is the same engine. Left side is Unity 5, with the color animation, using the same proportion of R/G/B as my Unity 4 setup, but normalized to within the 0-255 range since that's all it permits. Right side is how I have it currently in Unity 4.2.2:

 

KSP%202016-04-04%2013-36-30-01.jpg

 

EDIT: The benefit of using saturation, is that you can have the spectrum of red, orange, yellow, and white appear simultaneously, and those hotter colors appear only at the hot end of the animation.

 

I think you just have to set multiple points along the gradient to match the color changes. Increasing (A) past 1 just shifts everything toward white. You can't really get more than 1 since the monitors can't display it.

Edited by nli2work
Link to comment
Share on other sites

46 minutes ago, nli2work said:

I think you just have to set multiple points along the gradient to match the color changes. Increasing (A) past 1 just shifts everything toward white. You can't really get more than 1 since the monitors can't display it.

 

Right, that's the point of high saturation like that. It all gets truncated down to 1. So in places where it would go above, it shifts up through yellow and toward white, and where it's "cooler" you see more red, since that's the strongest color. My engine bell on the right looks more like the one on the left when it is at 20% throttle, but as you can see, it gets a mix of orange, yellow, and white at higher throttles, due to the saturation.

 

Setting multiple curve points on the color animation won't achieve the same effect because the whole bell would emit only one fixed color at any given time. Saturation allows the color to truncate so you get a blend of colors, on a per-texel basis.

 

Link to comment
Share on other sites

you can move the keys after the animation has been created. just move the Color.a curve end point above 1. You can get the same effect by changing RGB mixture and keep Color.a at 1. Pushing Color.a beyond 1 will push the opacity of emissive out through the gradients.

Everything you can do in 4.2.2 you can still do with this new tool. Not as easy or intuitive sure. Blame Unity for pulling the plug on Animation Component. Or Squad need to get with the times. :D afterall it's been at least 3 years since Unity said they're not supporting Animation Component any more.

Zyl7ToS.jpg

 

Edited by nli2work
Link to comment
Share on other sites

3 hours ago, nli2work said:

you can move the keys after the animation has been created. just move the Color.a curve end point above 1. You can get the same effect by changing RGB mixture and keep Color.a at 1. Pushing Color.a beyond 1 will push the opacity of emissive out through the gradients.

Everything you can do in 4.2.2 you can still do with this new tool. Not as easy or intuitive sure. Blame Unity for pulling the plug on Animation Component. Or Squad need to get with the times. :D afterall it's been at least 3 years since Unity said they're not supporting Animation Component any more.

 

Actually increasing the "a" doesn't get the effect I'm describing at all, it just saturates within the same hue. The saturation has to happen on the RGB channels to get the mix of reds, yellows, and whites together. But it looks like it is working going above 1 on the RGB mixture. I didn't think it was working initially, because if I enter a number (any number, even 0.X range), and hit "enter", it undoes it immediately, so I didn't think it could be edited there. If I click on another variable instead of hitting "enter", it retains the color, but still reverts the number displayed to "0". Ugh. Sometimes I really hate what Unity does.

 

(The color curves in the video still aren't what I'm talking about, since it's one hue at a time. I might have to share a video too)

 

Pain in the butt workaround, but it least it may still work.

 

Screenshot. I got the color effect I wanted, but it's still displaying those zeroes.

 

KSP%202016-04-04%2017-07-01-01-2.jpg

 

Link to comment
Share on other sites

 

Just for clarity, here's a quick sample of the engine glow. Notice that when it's white hot on the inside, there's also a lot of yellow, and still orange on the outside, and even the dimmest part of the bell is a reddish orange. It gets a spectrum of hues simultaneously, on a per-texel basis, by allowing for various levels of saturation (truncation at 255) on the individual RGB channels, which is a trick I use on all of my engines. Doing it as a gradient alone results in only one hue on the model at any given time, just with a variance in intensity.

 

 

 

Link to comment
Share on other sites

I see what you're saying. You can change the RGBA channels in animation window after the anim clip has been created, it all works the same as before. There isn't anything above 255 as it's impossible to display on the monitor or any hardware. What you set above 1 in Unity just spills the channel over to neighboring pixes, until such point all pixels on the object contains the color you're pushing "above" 1. (A) pushes all the channel closer to 255, which becomes closer to white. If you are seeing any colors anywhere just means not all the channels are at 255. You aren't "over" saturating anything, just changing the proportion of RGB on each pixel between 0 to 255. The shader hasnt' changed, it's always been RGBA + RGB Emissive. 
What you're doing is perfectly doable in 5.2.4. There's nothing special going on in 4.2.2 that isn't in 5.2.4.

Edited by nli2work
Link to comment
Share on other sites

1 hour ago, nli2work said:

What you set above 1 in Unity just spills the channel over to neighboring pixes, until such point all pixels on the object contains the color you're pushing "above" 1. (A) pushes all the channel closer to 255, which becomes closer to white. If you are seeing any colors anywhere just means not all the channels are at 255. You aren't "over" saturating anything, just changing the proportion of RGB on each pixel between 0 to 255.

 

No worries, I get that the shader hasn't changed, and I was able to reproduce the same animation as I noted above. But this part I don't think is quite right. Nothing should be spilling into adjacent pixels. Any channel above 1.0 should simply be getting truncated to 255 wherever the emissive map is bright enough to go "over" that, with the multiplier that's set in the animation curve. Colors approach white when all three channels are bright enough that they're all near 255. Since the RGB multipliers I've been using are 5.0/2.0/1.0 for the end of the animation, anything that's "bright" on the emissive map will become white since all three channels will be at or near 255 after truncation. Anything "dark" on the emissive map still has an orange glow, since there's a higher proportion of red, but all three channels will still be under 255 because the multiplier hasn't attempted to go beyond 255.

 

But anyway, we're kinda getting off track. Thanks for digging up the details about how to get this stuff working in Unity 5, as it'll be hugely useful! :)

 

Link to comment
Share on other sites

"spilling over" isn't exactly the right way to describe it... see the clip I linked and you'll see what I mean, the difference between keeping (A) at 1; and pushing (A) to 2+. Same thing happens with all the channels. You can push higher values, the "truncation" happens when the frame is sent to display, anything above 255 just turns white, it's why the old horizon was white, before 1.1's tone mapping implementation. 

It's easy to do that in the 5.2.4, just move the key frames up in the Animation window. the only difference is you can't type in a value in the properties list. Less precise sure... but no one will be able to tell the difference between 5/2/1 and 4.9575/2.0129/1.0234

Not getting irritated or anything. just trying to prod you into revealing your secret methods.

Edited by nli2work
Link to comment
Share on other sites

There's supposedly a fix in 5.4 comming for the yellowed out properties claiming that the object was missing but is working anyway.
It's apparently just a UI issue https://issuetracker.unity3d.com/issues/two-or-more-custom-components-cant-be-animated-in-animation-window
This won't fix the rest of nuisances ofc but thought I'd mention it :P

Link to comment
Share on other sites

8 hours ago, nli2work said:

"spilling over" isn't exactly the right way to describe it... see the clip I linked and you'll see what I mean, the difference between keeping (A) at 1; and pushing (A) to 2+. Same thing happens with all the channels. You can push higher values, the "truncation" happens when the frame is sent to display, anything above 255 just turns white, it's why the old horizon was white, before 1.1's tone mapping implementation. 

It's easy to do that in the 5.2.4, just move the key frames up in the Animation window. the only difference is you can't type in a value in the properties list. Less precise sure... but no one will be able to tell the difference between 5/2/1 and 4.9575/2.0129/1.0234

Not getting irritated or anything. just trying to prod you into revealing your secret methods.

 

No worries, we're almost saying the same thing. ;)

 

Link to comment
Share on other sites

Yea. I did some more tests and your methods definitely give a better results. Far as "spill over" it's the Emissive map multiplied to Emissive Color. Pushing Emissive Color past one increases channel value of non-0 pixels in the Emissive map till it's 1, beyond which it's clipped to 1, until your emissive color value is high enough the entire gradient in emissvive map is 1.

@Porkjet, push for Animator. :D

Edited by nli2work
Link to comment
Share on other sites

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