Jump to content

Service Bays: transparency effects while closed in VAB?


Recommended Posts

I try to model a cargo bay or service bay like the stock parts for my Blacksky rocketplane. Now I want the cargo bay to use the same transparency effect like the stock service bays, so one can see what is inside while mouse over.

Has anyone figured out how this works? I've looked at the stock parts by importing it to blender and although I think I did everything limilar it doesn't work. Even directly creating my own part based on the imported service bay model doesn't work. So something is missing in Unity - I think. I'm probably using the wrong trigger or it has to be of a certain number, like for example the engine glow (22 or so).

Any general hints/lessons learned?

Link to comment
Share on other sites

Ok, I found this module on the .cfg file. Maybe it's what you're looking for.

MODULE {

name = ModuleSeeThroughObject

transformName = TrussMount

shaderName = KSP/Bumped Specular (Transparent)

screenRadius = 1.0

leadModuleIndex = 0

leadModuleTgtValue = 0

}

Better wait for Kipard to appear. He knows better than me.

Link to comment
Share on other sites

The module set the specified shader to all mesh in childs of the transformName. Then it set the "_Opacity" variable of the shader depending on 2 factor :

- if leadModuleIndex point to a module that implements a specific interface (ModuleAnimateGeneric or ModuleProceduralFairing) then it gets a value from those module to set the _Opacity

- if leadModuleIndex is not here then the _Opacity seems to be set from how far the cursor is

Link to comment
Share on other sites

The module set the specified shader to all mesh in childs of the transformName. Then it set the "_Opacity" variable of the shader depending on 2 factor :

- if leadModuleIndex point to a module that implements a specific interface (ModuleAnimateGeneric or ModuleProceduralFairing) then it gets a value from those module to set the _Opacity

- if leadModuleIndex is not here then the _Opacity seems to be set from how far the cursor is

Thanks a lot. I used the CFG part mentioned above, actually I used a modified stock CFG.

That's what I did:

- used the very same CFG file (renamed and with changed Part ID) as the stock service bay.

- imported the stock MU model into Blender

- exported it to DAE

- Created GameObject in Unity, imported model

- Set textures, materials etc.

- made sure transforms and objects are named the same as the original (as far as we can see that).

- fiddled with the Part tools etc. as usual.

Result: the part works, but the transparency doesn't kick in while mouse over.

I think the problem is the Shader: KSP/Bumped Specular (Transparent).

The "Transparent" makes me worry. Which shader should I apply to the model in Unity? Does it matter?

I'll check the transform names and other stuff again when I'm back home...

It just hit me: maybe the import/export changed the scale and so the "screenRadius" doesn't do what I want it to?

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