Skip to guide
Rainbow Lab/Documentation

UV Foundry

Default swatch texture

The default Foundry Swatches Dual.png is a normal texture asset under Samples/Textures, with identical gradient areas in its top and bottom halves. The shared default material uses this texture. Top places auto gradients and swatches in the top half; Bottom places them in the bottom half. The original single-area Foundry Swatches.png is retained for older saved assets. It has sixteen named colour anchors with smooth transitions between them. Each shading range runs from deep shadows through a saturated midtone to a lighter highlight. The central midtone can be used for flat colours without the old separate bottom strip. You can assign it like any other model texture; no special runtime shader is required.

UV tools and colour matching are the main workflow. The swatches are an optional starting texture:

  1. Select a model section.
  2. Open Swatches and click a named colour such as Orange. It immediately assigns the texture and places the selected UVs on that colour's midtone.
  3. For shading, enable Auto gradient before clicking a colour. Set Bottom shade and Top shade to choose how much of its shading range to use: 0 is deepest shadow, 100 is the lightest highlight. For example, Bottom 55 and Top 80 gives a lighter, restrained gradient without the dark end. Width (%) controls horizontal coverage within the colour column. The range preview shows the selected colour with these settings.
  4. Choose a colour, then drag the shade or width controls to update the selected UVs immediately. Enabling Auto gradient and Reset range also update the selection. A slider drag is one Undo step. The range and width are remembered across model changes, window reopening and editor restarts. Reset range restores the full default range. No extra colour click or Apply action is needed. Select faces and enable Auto gradient to use the controls; point-sized or line-shaped UVs still need projection first.

Auto gradient is off by default. It fits the current UV layout rather than deciding a new projection direction. If the source UVs occupy a single point or line, use the visible Front, Top or Side projection buttons first. You can also assign Foundry Swatches in UV tools and position/stretch UVs over it completely by hand.

The swatch action preserves other surfaces' current material where possible. Partial material selections may require a separate material slot, which can add a draw call after export. The supplied texture is fixed; assign your own texture if you need another palette.

Shared master material

Swatches has a Master material field. The default is a shared lit material using the duplicated Foundry Swatches Dual texture. It is created on first use under Assets/UVFoundry Shared, with a separate default for Built-in or URP. UV positions define each surface's colour and gradient, so saved models can share one material.

Both Save new prefab and Apply to selected reference the master directly for swatch surfaces. Duplicate slots using that same master are combined into one submesh per mesh. This preserves every triangle and UV while avoiding redundant material slots. Unrelated textures and explicit Material override surfaces retain separate saved materials.

Choose your own saved material in the field to use a particular shader or material settings. It must have a saved base-colour texture through a recognised base-colour texture property, using Foundry Swatches or an atlas with the same colour layout. The choice is stored per project. Changing it updates working swatch surfaces without changing UVs; Use default master switches back. Workspace previews still use neutral preview lighting rather than reproducing every custom shader effect.

UV edits operate on temporary working copies; they do not change the master asset. Editing the master asset itself in Unity deliberately affects all objects sharing it. Previously saved prefabs retain their current assignments until reapplied; reapply earlier conversions to consolidate them onto the chosen master. Old material files are kept. Reopening a prefab using the configured custom master retains sharing. Older sessions using the previous default material move their working swatch UVs into the top half while retaining their shading. Apply/Save updates the object; original saved mesh/material assets remain intact.