DrunkenKerbalnaut

FSmeshSwitch doubles down on Shaders?

Recommended Posts

Having an issue whereby the inclusion of FSmeshSwitch in a part seems to be applying a shader twice. Or that's my assumption. The part is visibly darker, and using previously vetted FStextureSwitch2 to switch through textures works, but they are all also visibly darker. 

Unity Hierarchy is 

GameObject

-Model

-AltModel (tagged "Icon_Hidden")

-collider

-collider

Now my first assumption was that the models shared a parent, and needed to be separated. So I tried dedicated .mu for each, but couldn't switch anymore. Interestingly enough, the model was still darker. This same material/shader is producing the intended results on an identical part that doesn't have FSmeshSwitch. 

Anybody have a clue what's going in here? I'm on my phone, or else I would given pics and the cfg. I can still do that, if necessary. 

Edited by DrunkenKerbalnaut

Share this post


Link to post
Share on other sites

Update but still not right:

I realized that I had not referenced the alternate model in FSTextureSwitch MODULE, so changed that. So something like

objectNames = model;modelALT

And then I realized I might be able to workaround it so I dialed both shaders (KSP/Specular) down to 

_Opacity 0.5

In the hopes that if both were going to be visible, they could get along instead of overlapping. If it's of any importance, they share a material template. But nope. No visual difference. Meshes switch and so do textures, but the textures are very noticeably darkened to the point that features are hardly visible. 

Edited by DrunkenKerbalnaut

Share this post


Link to post
Share on other sites

Hi,  although it's not something i dont do often due to the limitations with colliders etc, the image below shows the usual set up and arrangement that works for me.

5 hours ago, DrunkenKerbalnaut said:

Update but still not right:

You must reference the mesh name not the model name you want to switch in order for it to work Ps if you want to test a working mesh switch i can send you the mod that contains the object below

 

vaLW8ES.png

Edited by SpannerMonkey(smce)

Share this post


Link to post
Share on other sites
19 minutes ago, SpannerMonkey(smce) said:

Mesh not model

Thanks for helping Spanner. Sorry, I used the wrong terminology. I think my dilemma might be better explained with pics:

hierarchy and partial config:

f2g2WZv.jpg

and the problem part is on the right. They are both set to the same texture currently:

j5V3HEO.jpg

Share this post


Link to post
Share on other sites

Hey no module iDs will make it behave badly,  number the modules, it needs to know which is which, module numbering starts at zero, and report back :)

 

6 minutes ago, DrunkenKerbalnaut said:

partial config:

 

Share this post


Link to post
Share on other sites
Just now, SpannerMonkey(smce) said:

Hey no module iDs will make it behave badly,  number the modules, it needs to know which is which, module numbering starts at zero, and report back :)

 

 

I've tried 0, 1, and 5 lol

Share this post


Link to post
Share on other sites
Just now, SpannerMonkey(smce) said:

they have to be different

I understood. For the sake of my sanity, will try again. And I just saw your post script; it would take me ages to DL right now, but yes please. 

Share this post


Link to post
Share on other sites
Spoiler

EDIT: oops! Just realized you likely weren't pinged @SpannerMonkey(smce)

 

Just tried doing different module ID (both 0 & 1, and 1 & 2) for the two FS modules. No dice. I'm not so sure that matters, as the documentation 

Spoiler

name = FSmeshSwitch
// If there are multiple instances of this module in a part, they must each have a unique module ID to avoid conflicts
moduleID = 0

 

From here leads me to believe it's only necessary when using 2 of the same modules, ie.: FSTextureSwitch used twice in the same part cfg. 

I also just tried deleting the FStextureSwitch from the cfg, and it's still misbehaving. 

For the record, I'm doing a complete reboot, not a DB reload. And I'm deleting MM caches each time. (Edit: and and I just tried removing the offending part from PartDatabase.cfg )

Edited by DrunkenKerbalnaut

Share this post


Link to post
Share on other sites
1 hour ago, DrunkenKerbalnaut said:
  Reveal hidden contents

EDIT: oops! Just realized you likely weren't pinged @SpannerMonkey(smce)

 

Just tried doing different module ID (both 0 & 1, and 1 & 2) for the two FS modules. No dice. I'm not so sure that matters, as the documentation 

  Reveal hidden contents

name = FSmeshSwitch
// If there are multiple instances of this module in a part, they must each have a unique module ID to avoid conflicts
moduleID = 0

 

From here leads me to believe it's only necessary when using 2 of the same modules, ie.: FSTextureSwitch used twice in the same part cfg. 

I also just tried deleting the FStextureSwitch from the cfg, and it's still misbehaving. 

For the record, I'm doing a complete reboot, not a DB reload. And I'm deleting MM caches each time. (Edit: and and I just tried removing the offending part from PartDatabase.cfg )

Grasping at straws here, how did you create your colliders? did you create meshes and forget to delete the mesh render for the collider?  Or is there a bump/normal map, is it set right in unity?,

Share this post


Link to post
Share on other sites
1 minute ago, SpannerMonkey(smce) said:

Grasping at straws here, how did you create your colliders? did you create meshes and forget to delete the mesh render for the collider?  Or is there a bump/normal map, is it set right in unity?,

I think I see what your getting at. 

Colliders created in Unity. Right click the model>add empty>add component>physics>capsule collider. Width set to .05 (don't ask) length set appropriate. Angle as needed with local parameters. Repeat as necessary. NOT set as triggers. 

Bump/normal maps: haven't pulled one off yet, so certainly not. material is png texture. shader is KSP Specular, currently opacity 1.0, but I've tried others (noted above). Shininess .03. 

If that doesn't do anything for you, then I think I'll be starting one from nil, see if I can repeat from completely clean slate. it's gonna suck if every one of these damn things does this haha. 50 models, or so. 

Share this post


Link to post
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.