Modes & Use Cases

Projection Space & Directions

  • Local / World Space toggles how the projection box is oriented.

  • 18 Directions (including diagonals) cover floors, walls, ceilings, and slanted or compound angles.

Alpha Masking

Enable Alpha Mask for textures with transparency so the generated mesh/collider tightly follows the visible decal.

Quality Controls

Use separate quality settings for the render mesh and the collider. Keep the visual mesh detailed while lowering collider complexity (or vice-versa) depending on your gameplay needs.

Runtime API

Drive decals entirely from code—spawn bullet holes or footprints at impact points, batch or defer rebuilds, and gather rich analytics. The package ships with a full C# API that mirrors all editor features at runtime.

What you can do programmatically

  • Spawn/position decals: set mask box center/size and projection direction from a raycast hit, then rebuild (SetMaskBox, ForceRebuild / AsyncRebuild).

  • Non-blocking rebuilds: run AsyncRebuild(progress => …) to keep frames responsive and show progress bars.

  • Per-decal analytics & profiling: read LastRebuildStats (triangles, rays, hits, build time, memory) and counters like RebuildCounter, LastRebuildTimeMS.

  • Hit data & callbacks: query GetRaycastHits(), GetHitTransforms(), GetLayerHitStatistics(), and register filters/callbacks with RegisterOnHitCallback(...) for selective processing.

  • Quality & cost control: adapt resolution with SetAdaptiveSubdivisions(targetCm²), estimate memory via EstimateMemoryFootprint(...), and predict timings with PredictRebuildTimeMS(...).

  • Alpha trimming & sampling: adjust SetAlphaThreshold(value) and probe texture alpha at world positions with SampleAlphaAt(worldPos).

  • Geometry helpers: convert points to decal UV space WorldToLocalUV, project arbitrary points to the surface ProjectPointOntoSurface.

  • Collider utilities: bake skinned meshes for collisions (BakeAndAttachCollider(bool convex)), toggle convex/trigger, and provide contacts for gameplay logic.

  • Debug visuals: quickly visualize results using DebugDrawHitPoints(color, size, duration).

Last updated