cineboxandrew Posted June 11, 2019 Share Posted June 11, 2019 (edited) This plugin allows for parts to have hollow insets that dont clip into other parts, ideal for engine nozzles, landing gear, air intakes, solar panel bays, and more. It is a standalone version of the depth mask module included in the Restock dll, along with the addition of depth masks to several stock parts ModuleDepthMask 1.1.2 requires KSP 1.11 or later. If you are using an older version of KSP, please use version 1.1.1. Downloads Source Code Usage Add a depth mask mesh to your part model. It should cover up the hollow area you want to prevent clipping in, without sticking out. Mark the depth mask object with the Icon_Hidden tag to prevent it from showing in the VAB part picker Add a new ModuleDepthMask to your part config Add the name of your mask object in the maskTransform property (Optional) Add the name of the object you want to restrict the mask effect to in the bodyTransform property An example config: MODULE { name = ModuleDepthMask maskTransform = mask bodyTransform = interior //Optional } Creating the depth mask model The depth mask will prevent any other parts from rendering behind it. Because of that, it should not be used on any kind of bay where other parts will be placed, or on any part you can look completely through. It also shouldn’t "bubble" out above the hole you want to cover, otherwise it would be possible to see through it from the side. Also double check your normal direction, since the depth shader only works one way. Screenshots mask meshes and configs for stock parts are included in Restock Licensing This plugin is licensed Creative Commons Sharealike Attribution. This means that you can redistribute it and its source code however you like under the same license as long as you include attribution and indicate the changes you made, if any. Redistribution You are free to redistribute this plugin in your mods, or embed the code in your own plugins (with a different module name for compatability of course.) To prevent duplicates of the plugin, please add the dll to the root gamedata directory. In general, treat this mod the same as Modulemanager for redistribution Edited March 14, 2022 by cineboxandrew Quote Link to comment Share on other sites More sharing options...
JadeOfMaar Posted June 11, 2019 Share Posted June 11, 2019 (edited) Fabulous. It's what in-wing VTOL fan engines (and the Internal RCS mod) will surely need, and something I will use very quickly once I have the energy to make parts again. In the spoiler is an example of how NOT to shape your depth mask mesh. Spoiler Edited June 11, 2019 by JadeOfMaar Quote Link to comment Share on other sites More sharing options...
Zorg Posted June 11, 2019 Share Posted June 11, 2019 Nice! What a neat little plugin. Those solar panel casings sitting flush with the craft look fantastic! I hope this gets wide adoption in the modding community, it opens up so many possibilities to enhance craft in an aesthetically pleasing way. Quote Link to comment Share on other sites More sharing options...
caddilacbob Posted June 11, 2019 Share Posted June 11, 2019 (edited) YAY FINALY now we just need someone to put this on procedurally sized 'surface attach' cargo bays or even just scalable ones to start with, it could even be balanced by giving every part a total sacrificial volume that would be displaced by clipping things into it i.e. a mk2 fuel tank would have a higher sacrificial volume then a 1.25m fuel tank of the same length. THANK YOU SO MUCH i have wanted this for so long and now we've finally taken the first step of course i suppose there would be problems with actually putting seperate parts in the bays, can we get around it with something like the welding mod, or maybe a grouping system or something? Edited June 11, 2019 by caddilacbob Quote Link to comment Share on other sites More sharing options...
DeltaDizzy Posted June 11, 2019 Share Posted June 11, 2019 2 hours ago, caddilacbob said: YAY FINALY now we just need someone to put this on procedurally sized 'surface attach' cargo bays or even just scalable ones to start with, it could even be balanced by giving every part a total sacrificial volume that would be displaced by clipping things into it i.e. a mk2 fuel tank would have a higher sacrificial volume then a 1.25m fuel tank of the same length. THANK YOU SO MUCH i have wanted this for so long and now we've finally taken the first step of course i suppose there would be problems with actually putting seperate parts in the bays, can we get around it with something like the welding mod, or maybe a grouping system or something? Yes there are problems. This just makes the surface of intersecting parts invisible. Think of the IVA overlay, because that is exactly the same thing, andrew has just applied to to regular parts. This only really works well for parts that have some internal volume that people can see yet not put things into. Things like solar panel containers and air intakes. It would take a ton more work to do the cargo bay thing, because it would have to essentially remodel the part it is attached to on the fly. (different sized parts and "cargo bays" along with the Offset and Rotate gizmos) Quote Link to comment Share on other sites More sharing options...
Friznit Posted June 11, 2019 Share Posted June 11, 2019 Ooh nice. So many applications. I recessed comms dish flush with the fuselage would be up there on my personal wish list. Quote Link to comment Share on other sites More sharing options...
CobaltWolf Posted June 11, 2019 Share Posted June 11, 2019 Is this the greatest thing ever made for KSP? ...yes. Quote Link to comment Share on other sites More sharing options...
danshu15 Posted June 11, 2019 Share Posted June 11, 2019 2 thumbs up! Quote Link to comment Share on other sites More sharing options...
klgraham1013 Posted June 11, 2019 Share Posted June 11, 2019 I'm speechless. Luckily, I can still type. Quote Link to comment Share on other sites More sharing options...
Whirligig Girl Posted June 11, 2019 Share Posted June 11, 2019 This is truly phenomenal. Quote Link to comment Share on other sites More sharing options...
cantab Posted June 11, 2019 Share Posted June 11, 2019 Simple (well, simple looking) but very nice. Quote Link to comment Share on other sites More sharing options...
Beetlecat Posted June 11, 2019 Share Posted June 11, 2019 6 hours ago, CobaltWolf said: Is this the greatest thing ever made for KSP? ...yes. Almost certainly Quote Link to comment Share on other sites More sharing options...
Ruedii Posted June 11, 2019 Share Posted June 11, 2019 I know a lot of mods that can use this. I was thinking this should be done with parallax maps, but this is even better. Quote Link to comment Share on other sites More sharing options...
BigFatStupidHead Posted June 11, 2019 Share Posted June 11, 2019 Oooh, awesome! That looks great! Quote Link to comment Share on other sites More sharing options...
caddilacbob Posted June 12, 2019 Share Posted June 12, 2019 (edited) 18 hours ago, DeltaDizzy said: Yes there are problems. This just makes the surface of intersecting parts invisible. Think of the IVA overlay, because that is exactly the same thing, andrew has just applied to to regular parts. This only really works well for parts that have some internal volume that people can see yet not put things into. Things like solar panel containers and air intakes. It would take a ton more work to do the cargo bay thing, because it would have to essentially remodel the part it is attached to on the fly. (different sized parts and "cargo bays" along with the Offset and Rotate gizmos) yeah thats excactly my point, conceptually i know how a depth mask works and so i know that one could, conceptually, layer other parts in front of it with their own masked depth. What i dont know is how doable this is in unity, in ksp, in this case. I also know that this is still amazingly useful even if we can only use it for solar panels, and landing gear, and engine bells, and other single parts. Thats why i suggested something like that welding mod, im not expecting to put probes in what would be essentially a virtual cargo bay, but it could be a nice place for a gravioli detector. EDIT: and i just re-read the original post and noticed the body mask property, so doesn't that make this alot more possible? Edited June 12, 2019 by caddilacbob Quote Link to comment Share on other sites More sharing options...
cineboxandrew Posted June 12, 2019 Author Share Posted June 12, 2019 12 hours ago, caddilacbob said: yeah thats excactly my point, conceptually i know how a depth mask works and so i know that one could, conceptually, layer other parts in front of it with their own masked depth. What i dont know is how doable this is in unity, in ksp, in this case. I also know that this is still amazingly useful even if we can only use it for solar panels, and landing gear, and engine bells, and other single parts. Thats why i suggested something like that welding mod, im not expecting to put probes in what would be essentially a virtual cargo bay, but it could be a nice place for a gravioli detector. EDIT: and i just re-read the original post and noticed the body mask property, so doesn't that make this alot more possible? In general, any other parts do not render behind the mask. This makes it not useful for cargo bays. The body property just lets you treat other transforms in your part exactly as you would any other part Quote Link to comment Share on other sites More sharing options...
caddilacbob Posted June 13, 2019 Share Posted June 13, 2019 (edited) 8 hours ago, cineboxandrew said: In general, any other parts do not render behind the mask. This makes it not useful for cargo bays. The body property just lets you treat other transforms in your part exactly as you would any other part what about specific parts, could they be tagged to render in front of the mask and behind the exterior of the mesh? Edited June 13, 2019 by caddilacbob Quote Link to comment Share on other sites More sharing options...
Jesusthebird Posted June 13, 2019 Share Posted June 13, 2019 This here...is HOT STUFF!! Ima try this tonight. Quote Link to comment Share on other sites More sharing options...
Beetlecat Posted June 14, 2019 Share Posted June 14, 2019 How would this behave if an intake (similar to the second photo) is intentionally set further back on a wing to create an 'upper' and 'lower' intake. Would this create a giant gap in the wing ahead of it? If so, I suppose creating a duplicate "non-masked" version of the part would work for those cases. Quote Link to comment Share on other sites More sharing options...
cineboxandrew Posted June 14, 2019 Author Share Posted June 14, 2019 16 minutes ago, Beetlecat said: How would this behave if an intake (similar to the second photo) is intentionally set further back on a wing to create an 'upper' and 'lower' intake. Would this create a giant gap in the wing ahead of it? If so, I suppose creating a duplicate "non-masked" version of the part would work for those cases. It would only clip out the parts of the wing behind the mask. Quote Link to comment Share on other sites More sharing options...
cineboxandrew Posted June 14, 2019 Author Share Posted June 14, 2019 5 hours ago, Beetlecat said: How would this behave if an intake (similar to the second photo) is intentionally set further back on a wing to create an 'upper' and 'lower' intake. Would this create a giant gap in the wing ahead of it? If so, I suppose creating a duplicate "non-masked" version of the part would work for those cases. Heres a screenshot : Quote Link to comment Share on other sites More sharing options...
Beetlecat Posted June 14, 2019 Share Posted June 14, 2019 11 hours ago, cineboxandrew said: Heres a screenshot Oh, splendid. So the mask would just be as intricate/specific as is defined. The lower intake in this shot could have just the area defined by the edge of the opening as a mask as well, yeah? This is fantastic Quote Link to comment Share on other sites More sharing options...
cineboxandrew Posted June 14, 2019 Author Share Posted June 14, 2019 Released version 1.1.0 This update adds support for using multiple depth masks with the same name, as well as hopefully better supporting multiple depth mask modules on the same part Quote Link to comment Share on other sites More sharing options...
cineboxandrew Posted September 2, 2019 Author Share Posted September 2, 2019 Released version 1.1.1, which just fixes the code using the Restock namespace. no effect in-game but might confuse anyone wanting to tap into the code of this plugin for whatever reason Quote Link to comment Share on other sites More sharing options...
KAO Posted September 7, 2019 Share Posted September 7, 2019 Is it at all possible to see a backport to 1.6.1, or does it rely on new features in release 1.7? I'm sure lots of people playing Realism Overhaul would love to use this. Also, is it within the capabilities of plugins to append the Icon_Hidden tag to the whole part model itself? This way, with the module applied to something like Procedural Parts for example, you can make arbitrary cavities in your ships. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.