Jump to content

TT's IVA Tutorial


TouhouTorpedo

Recommended Posts

Thank you, the problem was that I didn't have just one material per mesh, i had something like, *ahem*, 30

After lots of trimming and skinning down I managed to obtain two meshes with a single texture each without 3ds crashing, and afterwards it worked. thanks again :)

Link to comment
Share on other sites

  • 1 month later...

Got some questions

Where to start?

-------------------------------------

You need to export three different things here. An external model, an internal model, and the props internal cfg. I usually make three blank gameobjects, center them, and build from those, one for each export. Put PartTools on the internal and external, and Proptools on the internal props transform.

So, this single Unity Scene is where you write the .mu files for both the IVA and for the Game Part (exterior)?

Directions things face

--------------------------------------

the Kerbal transform Z faces forward, Y faces upward.

for external model Z faces up, Y faces forward. For the internal model, Y faces up, Z faces BACKWARD

the KSP wiki page states: "Your axes: make sure that the plugin is set to convert your model to the Y-up convention, else you risk having a sideways model". So wouldn't the model not be right-side up when brought into the game?

with the internal model having a different orientation, it would look something like this then?

46zHXF8.jpg

The Layers you need to use and not get wrong for everything in IVA

--------------------------------------

16 - Kerbals

this layer is used for placing the Kerbals transforms, and anything that you want visible in IVA AND the Kerbal portrait cameras. Place any box colliders with IsTrigger set TRUE for areas you can double click to change camera view (these may work on 20-internal space too but I haven't tried)

20 - Internal Space

this layer is used for placing anything that you want visible in IVA but NOT the Kerbal portrait cameras. The external model of the MK3 cockpit is in this layer in the MK3 IVA mod for instance, so it doesn't block the portrait camera views, but is visible on the external cameras or to Kerbals.

Is it safe to assume everything within the internal model game object will be on (16) ? do the lights need to be placed on the layer as well?

Besides the external model, is there anything else that would normally be placed on (20) ?

How to add IVA cameras

--------------------------------------

in the cfg use "InternalCameraSwitch". Set colliderTransformName to whatever you called it in Layer 16, and set cameraTransformName to the same name as an empty transform in Layer 16. It might not need to be in that layer - thats just what I used. in those transforms Z faces forward, Y faces up.

Any settings need to be modified when adding a camera in unity, or are the defaults sufficient?

New Question:

Windows

how do you setup the meshes to have windows be transparent when viewing from IVA? Does the IVA mesh just need to have window jambs modeled, and the opening free of any mesh like in the image below, or is a mesh still needed for the "glass", and transparency needs to be enabled for the UV mapping?

d9yYUW1.jpg

Link to comment
Share on other sites

Got some questions

So, this single Unity Scene is where you write the .mu files for both the IVA and for the Game Part (exterior)?

You do it this way so it all basically gets nicely packaged in the same Unity scene/project. Theoretically, you could do it as 3 separate projects with no issues, but if its all in the same scene, changing up something for one export lets you easily orient for the other and copy/paste things between the internal and external model. Having the props exporter there helps you better orient to the internal instead of guessing.

Is it safe to assume everything within the internal model game object will be on (16) ? do the lights need to be placed on the layer as well?

Besides the external model, is there anything else that would normally be placed on (20) ?

If there's a particular internal bulkhead or something that also photo-bombs your camera view and its on its own mesh, then that would be used also. Sometimes you want a dark cockpit but you want the faces lit up in the portrait, so lights can be done this way as well.

Any settings need to be modified when adding a camera in unity, or are the defaults sufficient?

Camera transforms are simple empty objects so far as I could tell. The collider to click on to orient to the camera can be its own simple box collider.

Windows

how do you setup the meshes to have windows be transparent when viewing from IVA? Does the IVA mesh just need to have window jambs modeled, and the opening free of any mesh like in the image below, or is a mesh still needed for the "glass", and transparency needs to be enabled for the UV mapping?

http://i.imgur.com/d9yYUW1.jpg

In your mesh editor (like Blender), when you make the internals by duping and flipping normals, you also separate all the windows into their own mesh (select the faces of just the windows, hit P). Depending on the effect you want, you can delete this mesh entirely or use a translucent alpha shader with its own special texture.

Edited by PolecatEZ
Link to comment
Share on other sites

Is there a tutorial somewhere that explains how to make IVAs have internal shadows? Noticed stock pods just let sunlight straight through the walls, but ALCOR's windows actually let sunlight through as you'd expect it to work.

Also is there a tutorial somewhere explaining how to affect the exterior model based on what you do in the IVA? Again ALCOR has interior lights, turn them on and the exterior model gets an emissive texture added to it to make the windows look like they're emitting light, similarly there are animated shutters on the exterior model you control with a button inside the IVA.

Link to comment
Share on other sites

  • 2 weeks later...

Thanks for this tutorial it helps me a lot. I hope somebody can help me with my problem. I have tow elements in my model that are animated. If I uncheck the "Play Automatically" option in unity the model is aligned correctly.

ZvvFgC1.png

If I check "Play Automatically" the IVA is rotatet by 90° in one and 180° in an other direction.

hT3kcGi.png

Can somebody explain this?

Link to comment
Share on other sites

  • 3 weeks later...

this will probably be helpful for many dealing with IVAs, Airlock, and Ladders. I pulled these from the squad parts folder by giving the external parts fake internal.cfg file. most except cupola came through with various information. I didn't pull the ones using generic internal space.

Javascript is disabled. View full album
Edited by nli2work
Link to comment
Share on other sites

New Question:

Windows

how do you setup the meshes to have windows be transparent when viewing from IVA? Does the IVA mesh just need to have window jambs modeled, and the opening free of any mesh like in the image below, or is a mesh still needed for the "glass", and transparency needs to be enabled for the UV mapping?

For basic windows, just model the window frames and leave the opening mesh-free as you've discerned.

For windows with frosting / dirt effects, you will need a mesh with an alpha texture.

Link to comment
Share on other sites

Explains it, ladder blocks airlock, why it's hard to get the eva prompt on stock pods, make airlock extend past ladder "width" wise, ladder can be longer in the axis kerbal move up and down it obviously, but make airlock extend past it in the 2 other dimensions.

Edited by K3|Chris
Link to comment
Share on other sites

For basic windows, just model the window frames and leave the opening mesh-free as you've discerned.

For windows with frosting / dirt effects, you will need a mesh with an alpha texture.

this is my attempt to explain how to make windows :)

fDgiamK.jpg

Link to comment
Share on other sites

"use this color for adjust transparency" What does that mean?

My current work on additional b9 cockpits and IVAs have taught me some things about windows, I'm trying to emulate the style of bac9's IVA glass, he uses long streaks of light gray smudges on his b9 windows which I replicated somewhat by using a fiber render in photoshop and motion bluring it in the line of the fibers to get a long and pretty straight black and white pattern, apply that as a mask on something light gray, mask over the window shapes, transform the striped texture to conform to the window shape to make the lines travel from the front to the back so to speak to match the wind direction, making sure the lines go straight along the edges, this might require some distortion. This simulates dirt and other debris streaking from the wind and possible moisture in the atmosphere (clouds, rain etc).

Then to simulate them being cleaned but not completely around the edges use the smudge tool to draw circles (picture a kerbal using a sponge in a swirling pattern) but not all the way out to the edge, then blur the center part until it's pretty much one shade, center is almost black in the alpha mask to make it near perfectly transparent, step after that is adding some stains/blotches, can vary their color a bit from the base gray, brown and orange-ish colors work well imo but keep the alpha low, means the effect is pretty subtle and doesn't block your vision.

Some black spots are also nice, bac9 uses a secondary layer of the main light gray effect but makes it black and masks it to just a thin line around the edges, I'm guessing to simulate heat-baked debris near the edges.

Using this method you get windows that have some pretty realistic looking wear and tear, obviously this would only happen in atmosphere, for a space pod like the alcor it doesn't fit, but for spaceplane cockpits that re-enter in a fireball it does. Try not to overdo it, I had to balance the alpha back and forth on the different elements/layers of the effect to get it where I wanted it, it's a cool effect but if you go over-board on it you can get very hard to see through windows, heavier effects around the edges are fine but the center should be near perfectly transparent or at least even, I like to leave the glass slightly opaque in a black shade to simulate the partial reflection of the glass of outside light making less than all of it go through the glass, also looks more "glassy" imo.

I always try to inform what I do based on reference pictures or failing that try to picture in my head how it would work, edges are darker because of the refraction changing at the edges and especially if they're inset you can think of the lip of material around the edges acting as a "shade" in an ambient occlusion sense, how do they get dirty? Flying at high speed through the air makes you pick up all kinds of particulates, soot and similar grime, tiny insects etc, why are the edges dirty? Because I imagine the re-entry heating is worst around the edges thus the grime gets "baked" onto the glass a bit, and especially on inset windows it's kinda tricky to clean all of it, especially if you use a rotating buffing like tool, and even if you got all the deposits the glass underneath might discolor from it.

Obviously most of that grime is unrealistic if it's a new cockpit directly from the factory, but we can't yet change how the pod looks/works etc based on it's age and or how it's been treated, having some "animation" that gradually builds up scorch marks on the hull, white marks on the heat-tiles or outright missing/damaged ones and grime on the windows the more you expose the cockpit to re-entry effects etc would be nice, but for now a "medium" level of wear and tear seems a good balance.

Just think of the parts as used or something...

Edited by K3|Chris
Link to comment
Share on other sites

"use this color for adjust transparency" What does that mean?

The KSP Unlit Alpha shader reads the texture's Alpha channel to determine per pixel transparency. The large box controls the color of the rendered mesh. if you want a red tinted window, set it to red. the small slider under it, white at start, determines the overall strength of the texture's alpha channel. Think of it as a multiplier to your alpha channel. Alpha channel ranges from 0 to 255 value. 255 is opaque, 0 is transparent. the shader slider multiplies it. so if the shader is set to half way, then the values of your alpha channel is multiplied by 0.5. It's an extra layer of control in Unity to fine tune the look.

Link to comment
Share on other sites

you must MUST work to reScaleFactor 1. If you don't, then it won't line up and you'll just have a big headache. Even if you think you'll be clever and resize the internal model 1.25 in Unity. It knows you're being a smartass and it'll make you pay dearly, trust me I tried.

to expand on this a bit... KSP applies default scale factor of 1.25 to external parts, so you model a 1m diameter part (in blender or Max), it becomes 1.25m in game. But IVA's scale factor is 1, no apparent way to match it to external part scale factor. so if you build size 1 part for external, and build IVA inside of it, IVA will be too small in game.

if you look at rescaleFactor of all pod's with IVA, you see they are set to 1. Where as parts without IVA varies, some are set to 1; some more or less than 1; some without a setting, relying on game's default 1.25 rescaleFactor.

You need to force External part's rescaleFactor to 1 in the Pod's config file. and build the mesh at 1:1, meaning 1.25m in your modeling app for 1.25m part ingame, in order for IVA and external part to match up correctly.

Edited by nli2work
Link to comment
Share on other sites

  • 4 weeks later...
Hello, I'm new to Unity, and after reading all the comments I still don't understand the layers "16 - kerbals" and "20 - Internal Space" are they GameObjects? or something? any help would be apreciated. :)

Image%202014-07-14%20at%203.51.10%20PM.png

bottom right, kerbals layer is visible in IVA and shown in the portrait camera, internal space aren't shown in the portrait camera, so if you have a prop in front of a kerbal that would block the camera it should be internal space layer.

Link to comment
Share on other sites

  • 1 month later...
to expand on this a bit... KSP applies default scale factor of 1.25 to external parts, so you model a 1m diameter part (in blender or Max), it becomes 1.25m in game. But IVA's scale factor is 1, no apparent way to match it to external part scale factor. so if you build size 1 part for external, and build IVA inside of it, IVA will be too small in game.

if you look at rescaleFactor of all pod's with IVA, you see they are set to 1. Where as parts without IVA varies, some are set to 1; some more or less than 1; some without a setting, relying on game's default 1.25 rescaleFactor.

You need to force External part's rescaleFactor to 1 in the Pod's config file. and build the mesh at 1:1, meaning 1.25m in your modeling app for 1.25m part ingame, in order for IVA and external part to match up correctly.

I have a beginner question on this front. Not limited only to IVAs, but having trouble finding a definitive response anywhere else, and it certainly sounds like you know what you're talking about :) Is there a downside to modelling all of my parts to a rescale factor of 1? It seems so much simpler just to build the dimensions exactly the way I want them in-game, but every beginner modding tutorial I've seen says to model 1m and then rescale to 1.25 in part.cfg.

Link to comment
Share on other sites

no downside from what i can tell. default rescaleFactor of 1.25 is probably just a legacy thing from the earlier versions of the game. If anything, it should be a very miniscule gain in performance as it removes one layer of recalculation for the game engine.

Link to comment
Share on other sites

no downside from what i can tell. default rescaleFactor of 1.25 is probably just a legacy thing from the earlier versions of the game. If anything, it should be a very miniscule gain in performance as it removes one layer of recalculation for the game engine.

Cool. I'll keep doing it that way until I hit trouble then. And thanks for the quick reply.

I'm gearing up for my first IVA and now that I've seen this awesomeness, you can expect plenty of annoying noobie questions from me!

Link to comment
Share on other sites

  • 3 weeks later...
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...