Skip to content

ModuleDepthMask

Sofie edited this page Nov 24, 2024 · 1 revision

ModuleDepthMask

Added in: v0.4.0
Last Updated in: v0.4.0

Description

ModuleDepthMask is a part module orginally written by Drew Cassidy for Restock.
This module 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.

Usage

Config entries

Name: maskTransform
Description: The name of the transform that has your mask mesh. The only strictly required property.
Default Value: none

Name: bodyTransform
Description: The name of the transform that your mask mesh should apply to.
Default Value: none

Name: shaderName
Description: The name of the depth mask shader.
Default Value: DepthMask

Name: maskRenderQueue
Description: The render queue value for the mask, should be less than 2000.
Default Value: 1999

Name: meshRenderQueue
Description: The render queue value for the mesh, should be less than maskRenderQueue.
Default Value: 1000

Extra Instructions

  1. 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. You can have multiple mask objects sharing the same name and they will all be used.
  2. Mark the depth mask object with the Icon_Hidden tag to prevent it from showing in the VAB part picker.
  3. Add a new ModuleDepthMask to your part config.
  4. Add the name of your mask object in the maskTransform property.
  5. (Optional) Add the name of the object you want to restrict the mask effect to in the bodyTransform property.
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 should "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.

Example

MODULE
{
    name = ModuleDepthMask
    maskTransform = mask
    bodyTransform = interior //Optional
}

Changelog v0.4.0:
- Added ModuleDepthMask, Adapted with permission from KSP-DepthMask.