Body Culling and Mask Painter

Body Culling, Equipment Occlusion Layers, and Mask Painter
This guide explains how Character Creator hides body triangles under equipped clothing, and how equipment items can cull each other using occlusion layers.
What It Does
Body culling hides parts of the body mesh that should not be visible under equipment (dress, armor, suit, etc.).
Equipment occlusion layers let higher-layer equipment auto-hide triangles on lower-layer equipment (e.g. a jacket hides the shirt underneath).
Both features are handled by:
RuntimeBodyOcclusionCullerat runtimeBody Culling Modeon eachEquipmentPrefabentryEquipment Occlusion Layeron eachEquipmentPrefabentryoptional authored masks via the unified Mask Painter (body culling + equipment culling in one tool)
Culling Modes per Equipment Item

In EquipmentManager -> Equipment Prefabs -> Body Culling Mode, each item can use:
No Cullingthis equipment does not hide any body triangles
Manual Cullingonly triangles painted in the Body Culling Mask Painter are hidden
Auto CullingRuntimeBodyOcclusionCullerauto-detects covered body triangles
When an item is set to Manual Culling and no RuntimeBodyOcclusionCuller is found on the character, a warning help box appears in the inspector.
Equipment Occlusion Layer
Each equipment item has an Equipment Occlusion Layer (integer, 0...10):
0= this item is not cullable by other equipment (default)1...10= this item can be culled by equipment on a higher layer
A higher-layer item automatically hides triangles on lower-layer items that it covers at runtime.
Example layer assignment:
1
Underwear
2
Shirt
3
Jacket
4
Armor
In this setup, the jacket (layer 3) will auto-hide covered triangles on the shirt (layer 2) and underwear (layer 1). The armor (layer 4) will auto-hide all lower layers.
Items on layer 0 are never culled by other equipment. Items on the same layer do not cull each other ... only higher layers cull lower ones.
You can also manually paint equipment culling masks using the Equipment Culling tab in the Mask Painter (see below).
Requirements
RuntimeBodyOcclusionCullermust exist on the character root.RuntimeBodyOcclusionCuller.bodyRenderermust reference the character bodySkinnedMeshRenderer.The source body mesh must be Read/Write enabled in import settings.
If the body mesh is not readable, runtime culling is skipped and a warning is logged.
One-Click Setup
Use: Tools/Character Creator/Character Creator Setup Wizard

Recommended options:
Add RuntimeBodyOcclusionCuller= enabledAuto Enable Source Mesh Read/Write= enabled
The wizard auto-configures references for RuntimeBodyOcclusionCuller.
Manual Mask Authoring (Painter)
In
EquipmentManager, set an equipment entry toBody Culling Mode = Manual Culling.Click
Open Body & Equipment Culling Painter.

The painter opens a draggable hotbar in the Scene view (can be repositioned by dragging the title bar).
When the selected equipment item has an Equipment Occlusion Layer > 0, the painter shows two mode tabs at the top: Body Culling and Equipment Culling. When the layer is 0, only the Body Culling tab is shown.
Body Culling Tab ... Hotbar Layout
Title
☰ Body Culling: [Slot] [EquipmentName]
Title bar with ✕ close button
1
Start Painting / Stop Painting
Toggles paint mode (green highlight when active). Saves mask data on stop.
1
Clear Mask
Removes all painted triangles for this item.
1
Triangle Count
Shows current masked triangle count (e.g. 42 tris). Displays * suffix when there are unsaved changes.
2
Target (optional)
Dropdown shown when multiple body renderers exist, to pick which body mesh you paint.
3
Brush
Slider controlling brush radius (0.002...0.2).
4
Symmetry
Toolbar: None, Horizontal, Vertical for axis-synced mirrored painting.
5
Paint Through (Front + Back)
Checkbox. Paints through along the brush ray, not only the front-facing hit.
6
Draw Mask Overlay
Checkbox. Draws painted triangles in Scene view (transparent orange fill + orange edges).
7
Preview Culled Result
Checkbox. Shows a live mesh preview of what the body looks like after culling.
8
Ghost Equipment Preview
Checkbox. Overlays the selected equipment as a semi-transparent preview while painting.
9
Ghost Opacity
Slider (0.05...0.9, default 0.28). Only visible when Ghost Equipment Preview is enabled.
10
Scene Hints
Context hints for current mode (paint, paint through, or preview active).
11
Close Painter
Full-width button to close the painter.
Equipment Culling Tab ... Hotbar Layout
This tab is available when the selected item has Equipment Occlusion Layer > 0. It lets you paint which triangles this item hides on lower-layer equipment.
Title
☰ Equipment Culling: [Slot] [EquipmentName]
Title bar with ✕ close button
1
Mode Tabs
Body Culling | Equipment Culling tab toggle
2
Target
Dropdown to select which lower-layer equipment to paint on. Format: [L#] [Slot] PrefabName. Lists both equipped and configured items on lower layers.
3
Mesh (optional)
Dropdown shown only when the target has multiple SkinnedMeshRenderers.
4
Start Painting / Stop Painting
Toggles paint mode (green highlight when active). Also Clear Mask and triangle count.
5
Brush
Slider controlling brush radius (0.002...0.2).
6
Symmetry
Toolbar: None, Horizontal, Vertical.
7
Paint Through (Front + Back)
Checkbox. Paints through to back-facing triangles along the brush ray.
8
Draw Mask Overlay
Checkbox. Draws painted triangles in Scene view.
9
Preview Culled Result
Checkbox. Shows a live mesh preview of the target with the painted mask applied.
10
Ghost Occluder
Checkbox. Overlays the occluder (this item) as a semi-transparent cyan ghost so you can see through it while painting.
10a
↳ Opacity
Slider (0.05...0.9). Only visible when the ghost is enabled.
11
Ghost Target
Checkbox. Overlays the target (lower-layer item) as a semi-transparent violet ghost.
11a
↳ Opacity
Slider (0.05...0.9). Only visible when the ghost is enabled.
12
Scene Hints
Context hints for current mode.
13
Close Painter
Full-width button to close the painter.
Painting Controls
LMB drag... paints masked triangles (green brush disc)Shift + LMB drag... erases masked triangles (red brush disc)Brush radius adjustable via the Brush slider
Symmetry = Horizontal/Verticalmirrors your stroke across the selected axisPaint Through (Front + Back)paints through front and back hits along the rayUndo/Redo is recorded per brush stroke
Mask data auto-saves when
Stop Paintingis clicked (large masks with >3000 triangles save asynchronously)
Preview Culled Result
Preview Culled Resulttemporarily shows a generated preview mesh with the current mask applied.While preview is enabled, paint interactions are disabled.
Disabling preview restores normal body mesh display.
If you were painting before enabling preview, painting mode is restored automatically when preview is turned off.
Auto + Manual Hybrid Workflow
You can combine both:
keep equipment in
Auto Cullingpaint a mask while temporarily in
Manual Cullingswitch back to
Auto Cullingkeep
RuntimeBodyOcclusionCuller.useManualMasksWhenAvailableenabled
Result: authored mask is applied on top of auto detection.
Runtime Tuning (Auto Culling)
Tune these fields in RuntimeBodyOcclusionCuller:
Rebuild Settings
autoRebuildOnEquipmentChanged
true
Rebuild when equipment is equipped/unequipped
autoRebuildOnBodyBlendshapeChanges
true
Rebuild when body blendshapes change
bodyBlendshapePollInterval
0.2
How often (seconds) to poll for blendshape changes (min 0.02)
autoRebuildContinuously
false
Rebuild every frame (performance cost)
continuousRebuildInterval
0.4
Interval (seconds) for continuous rebuild (min 0.05)
rebuildDebounceSeconds
0.05
Debounce delay before rebuild is triggered (min 0)
Occlusion Heuristics
insideDistanceEpsilon
0.0005
Distance epsilon for determining if a vertex is inside equipment
surfaceDistanceThreshold
0.006
Max distance to consider a body vertex "covered"
vertexNormalRaycastDistance
0.035
How far to cast along vertex normal to find equipment surface (min 0.001)
vertexNormalRaycastBackstep
0.003
Backstep before raycasting along normal
vertexCoverageProbeRadius
0.015
Radius for coverage probe sphere (min 0.001)
vertexCoverageProbeCount
8
Number of probes per vertex (4...20)
vertexCoverageHitRatio
0.65
Fraction of probes that must hit equipment to consider vertex covered (0.1...1.0)
requiredOccludedVerticesPerTriangle
2
How many of a triangle's 3 vertices must be occluded to hide it (1...3)
autoRelaxTriangleRequirementWhenNoHits
true
Automatically relaxes the per-triangle requirement when no triangles pass the strict check
Other
useManualMasksWhenAvailable
true
Use authored masks on top of auto detection
ignoredSlots
[Hair, Face]
Slots excluded from culling
logDiagnostics
false
Log debug info during culling
Quick direction:
if too many triangles are hidden: increase strictness (for example higher
requiredOccludedVerticesPerTriangle, highervertexCoverageHitRatio)if clipping remains: relax strictness (for example lower
requiredOccludedVerticesPerTriangle, lowervertexCoverageHitRatio, increasesurfaceDistanceThreshold)
Performance Notes
Manual Cullingis usually cheaper thanAuto Culling.Auto Cullingcan rebuild on:equipment change
body blendshape change
optional continuous rebuild
Use
rebuildDebounceSecondsandbodyBlendshapePollIntervalto avoid unnecessary rebuilds.Use
ignoredSlotsto skip categories likeHairandFace.
Troubleshooting
Nothing gets culled
Missing RuntimeBodyOcclusionCuller or missing body renderer reference
Add/configure RuntimeBodyOcclusionCuller on character root
Runtime warning about unreadable body mesh
Source body mesh import has Read/Write disabled
Enable Read/Write (or use Setup Wizard auto-enable option)
Open Body & Equipment Culling Painter button not visible
Item is not in Manual Culling mode
Set item Body Culling Mode to Manual Culling
Equipment Culling tab not shown in painter
Equipment Occlusion Layer is 0
Set Equipment Occlusion Layer to 1 or higher
Equipment-on-equipment culling not working at runtime
Target layer is 0, or target is on same/higher layer
Ensure target has a lower non-zero layer than the occluder
No lower-layer targets in the Equipment Culling target dropdown
No other equipment items have a lower occlusion layer
Assign layers to equipment items so lower-layer items exist
Warning about missing RuntimeBodyOcclusionCuller in inspector
Component not on character
Add RuntimeBodyOcclusionCuller to character root (or use Setup Wizard)
Painter suddenly does not paint
Preview Culled Result is enabled
Disable Preview Culled Result to return to paint mode
Mirror painting not happening
Symmetry is set to None
Set Symmetry to Horizontal or Vertical
Auto culling hides too much
Heuristics too aggressive
Tighten thresholds / increase requiredOccludedVerticesPerTriangle / increase vertexCoverageHitRatio / use manual mask
Auto culling misses clipping
Heuristics too conservative
Relax thresholds / lower requiredOccludedVerticesPerTriangle / increase surfaceDistanceThreshold / add manual mask
Related Files
Assets/Arawn/CrystalCharacterCreator/Runtime/RuntimeBodyOcclusionCuller.csAssets/Arawn/CrystalCharacterCreator/Runtime/EquipmentManager.csAssets/Arawn/CrystalCharacterCreator/Editor/EquipmentPrefabDrawer.csAssets/Arawn/CrystalCharacterCreator/Editor/EquipmentManagerEditor.csAssets/Arawn/CrystalCharacterCreator/Editor/EquipmentCullingMaskPainter.csAssets/Arawn/CrystalCharacterCreator/Editor/CharacterCreatorSetupWizard.cs
Last updated

