Jump to content

Questions regarding Texture&Animation.


Recommended Posts

Hi,

My Questions:

1.I haven't seen a KSP-Anisotropic shader. Is there a way to fake it somehow. I can only think of using a light bump map. Baking it wouldn't look very god on a shiny part.

2.Is there an efficient way to have an animated texture? I've read that it's only possible but creating a kind of film-strip and letting it slide.(and similar techniques)Maybe possible with rpm/fs)

Maybe possible with rpm/fs?

3. Is it possible to have a bunch of animations that switch- and play randomly without involving the user?

Bonus: Colliders...(How) Can I create a collider that can be used in the VAB/SPH to drag the part around, but doesn't conflict when in flight or with nearby colliders in the VAB.

Bonus bonus: would it be possible to create a comet from a custom asteroid(mod) with the ksp particle emitters?

I took apart some parts(Blender .mu import plugin) but without a description I wasn't able to find out exactly how they work.

I hope there's a solution to those things without any coding(my knowledge to programming is limited to Q-basic and that was quite a while ago)

Many thanks in advance!

Edited by ximrm
idea.
Link to comment
Share on other sites

Hi,

My Questions:

1.I haven't seen a KSP-Anisotropic shader. Is there a way to fake it somehow. I can only think of using a light bump map. Baking it wouldn't look very god on a shiny part.

2.Is there an efficient way to have an animated texture? I've read that it's only possible but creating a kind of film-strip and letting it slide.(and similar techniques)Maybe possible with rpm/fs)

Maybe possible with rpm/fs?

3. Is it possible to have a bunch of animations that switch- and play randomly without involving the user?

Bonus: Colliders...(How) Can I create a collider that can be used in the VAB/SPH to drag the part around, but doesn't conflict when in flight or with nearby colliders in the VAB.

Bonus bonus: would it be possible to create a comet from a custom asteroid(mod) with the ksp particle emitters?

I took apart some parts(Blender .mu import plugin) but without a description I wasn't able to find out exactly how they work.

I hope there's a solution to those things without any coding(my knowledge to programming is limited to Q-basic and that was quite a while ago)

Many thanks in advance!

1. You could try the KSP/BumpedSpecular shader, with a normal map like:

120px-AnisoDirection2.jpg

I think this only really would work correctly on flat (or near flat) surfaces.

I can't say I've tried it, but it could produce something reasonably close.

The rest of the questions I cannot answer with certainty, sorry :(

But on:

3. I'm pretty sure this is not possible without a custom animation plugin (Such as Firespitter.dll, but I'm not sure if even Firespitter supports random animations).

Bonus: Again, I do not think this is possible without a plugin to remove a specific collider when moving to the flight scene.

Bonus Bonus: Again again, I'm not totally sure, but I believe the particle emitter has to be linked up to a module (Ex. an engine module) to be used. For example, decoupler FX will only play if a decoupler module is present and used in a part. - Writing a custom module to display comet effects wouldn't be sooo hard, I imagine (Don't know the maths to calculate trail direction, just the vector coming straight off of the sun I guess).

Edited by Beale
Link to comment
Share on other sites

1. there's a user written unity anisotropic shader but you probably need a plugin to add it into KSP.

2. animate the texture X and/or Y offset in the material component. the mesh would need to be a separate object and you need a unique material for that object. Haven't tried it, but it should work.

3. need a plugin most likely.

4. no easy way to do it. You can hack it using a landingGear module with a collider named Bounds ( that collider is destroyed on launch). but you'd need to supply a wheelCollider and some other empty transforms. you might get away with it by pointing the wheelCollider toward the middle of the vessel and make it very small.

5. maybe, I haven't tried it. A custom asteroid part could work using FSanimateGeneric to attach the FX and ModuleDeployableSolar to keep the emitter oriented relative to the Sun. of course you might end up with all the asteroids having a trail

Edited by nli2work
Link to comment
Share on other sites

2. animate the texture X and/or Y offset in the material component. the mesh would need to be a separate object and you need a unique material for that object. Haven't tried it, but it should work.

I hate to bother you, because you're obviously already very busy and active here, but if you ever figure this out I'd be really eager to try it. I've been wanting this from the very beginning for a more realistic engine exhaust animation.

Link to comment
Share on other sites

key the Main Tex.offset.x and .offset.y values like you would in an emissive animation. If you are using a more complex shader you'd need to key the other shader layers (Bump, Emissive mainly) the same way. There are some caveats as you can see

. if you set the clip mode to Default in Unity, you get a ping-pong effect with Start/Stop buttons. if you set the clip to Loop, Start/Stop becomes play forward/backward. animSwitch setting in ModuleAnimateGeneric doesn't appear to change anything. I was hoping it would play, then when I stop, the clip jumps to frame 0. but not the case.

that said, a plugin can take advantage of this for the effects you are looking to get.

Edited by nli2work
Link to comment
Share on other sites

Hi,

3. Is it possible to have a bunch of animations that switch- and play randomly without involving the user?

Many thanks in advance!

Random not sure, but something close enough yes..

make one long animation, 2000 frames and spread your moving stuff randomly on that length, set it to "playautomatically" and "wrap mode Loop", then it will animate those 2000 frames constantly and repeat it when finished..

for the most part, it should look quite random over that length of time..

Link to comment
Share on other sites

I hate to bother you, because you're obviously already very busy and active here, but if you ever figure this out I'd be really eager to try it. I've been wanting this from the very beginning for a more realistic engine exhaust animation.
key the Main Tex.offset.x and .offset.y values like you would in an emissive animation. If you are using a more complex shader you'd need to key the other shader layers (Bump, Emissive mainly) the same way. There are some caveats as you can see
. if you set the clip mode to Default in Unity, you get a ping-pong effect with Start/Stop buttons. if you set the clip to Loop, Start/Stop becomes play forward/backward. animSwitch setting in ModuleAnimateGeneric doesn't appear to change anything. I was hoping it would play, then when I stop, the clip jumps to frame 0. but not the case.

that said, a plugin can take advantage of this for the effects you are looking to get.

I can write a little plugin to do this if you like? It's dead simple. My tracks use code which moves the texture in one plane to give the effect of rotation where the mesh, of course, does not. Adapting that little piece and adding a some configurable, random values to change the UV placement is quite easy. There are probably lots of applications for it.

Link to comment
Share on other sites

It seemed like too cool a thing not to create, so here is the POC:

That's the random version, it smotthyl jiggers the UV offsets around between ranges over random amounts of time, the ranges for which you can also configure. I'll create another two versions which linearly progress to set placements over the texture and randomly picks specific placements respectively. The idea is you'll be able to set up a grid of frames on the texture and the plugin will choose which frame by changing the UV offset. Easy, easy (and hopefully useful) little plugin, so I'll release shortly once it's finished. The version shown should above be useful for engine and light effects.

Link to comment
Share on other sites

It seemed like too cool a thing not to create, so here is the POC:

http://youtu.be/TBmuXPtDlXU

That's the random version, it smotthyl jiggers the UV offsets around between ranges over random amounts of time, the ranges for which you can also configure. I'll create another two versions which linearly progress to set placements over the texture and randomly picks specific placements respectively. The idea is you'll be able to set up a grid of frames on the texture and the plugin will choose which frame by changing the UV offset. Easy, easy (and hopefully useful) little plugin, so I'll release shortly once it's finished. The version shown should above be useful for engine and light effects.

Would be awesome if this could work as part of EFFECT{} using extended input curves like SmokeScreen

Link to comment
Share on other sites

I honestly have no idea how to do that. But I'll have a look at the source for smokescreen and see what I can come up with :)

A light controller would be useful as an EFFECT node too, now I think about it.

Link to comment
Share on other sites

It seemed like too cool a thing not to create, so here is the POC:

http://youtu.be/TBmuXPtDlXU

That's the random version, it smotthyl jiggers the UV offsets around between ranges over random amounts of time, the ranges for which you can also configure. I'll create another two versions which linearly progress to set placements over the texture and randomly picks specific placements respectively. The idea is you'll be able to set up a grid of frames on the texture and the plugin will choose which frame by changing the UV offset. Easy, easy (and hopefully useful) little plugin, so I'll release shortly once it's finished. The version shown should above be useful for engine and light effects.

that is awesome, I could really use exactly that for my force fields on the star trek ships..

care to share that code snip used for those tyres? :-D

*very_sympathic_motivating_and_big_grin_kind_of_like_spongebob_at_his_best*

11274.jpg

Link to comment
Share on other sites

Yeah, no problem! I'll release it over the weekend; it was a half hour mess about, so I need to strip some debugging stuff, comment and document the config entries. Will be released public domain, though I'm hoping to start a community effort to roll useful little general use modules into a common plugin; I have a few more similar ideas. Will PM you when its ready - won't be long :)

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