Skip to content

Colors and Materials Overview โ€‹

Colors and materials define the appearance of voxels, pixels, and texels in Foxel.

Each asset manages its own Color Palette and Material Set. Instead of storing full color and material values in every voxel, pixel, or texel, Foxel stores indices that reference entries in the asset's palette and material set. This keeps asset data compact and makes it easy to update the appearance of an asset consistently.

Color Palette โ€‹

Each asset in Foxel contains its own Color Palette with up to 256 colors.

Colors are stored as indexed entries rather than being written directly into each voxel, pixel, or texel. When you change a palette entry, every part of the asset that uses that color updates automatically.

Material Set โ€‹

Each asset also contains its own Material Set with up to 128 materials.

A material is defined by four properties:

  • Metallic: Controls how metallic the surface appears.
  • Roughness: Controls how smooth or rough the surface appears.
  • Emissive: Controls how much light the surface emits.
  • Alpha: Controls transparency.

Foxel uses a physically based shading model, so material properties respond consistently to lighting.

Default Material โ€‹

Each Material Set includes a built-in Default Material at slot 0.

It is always available and cannot be deleted. Unlike regular materials, its properties are not edited in the Material Set Editor. Instead, they are defined per object in the Inspector, which also makes them animatable.

How Colors and Materials Are Assigned โ€‹

Each voxel, pixel, or texel stores references to a color and a material by index.

This means Foxel stores links to palette and material entries instead of repeating full values throughout the asset. This improves consistency, reduces storage requirements, and makes it easier to update the look of an asset.

Asset-Based Color and Material Data โ€‹

Colors and materials are managed per asset, not shared automatically across the entire project.

This means different assets in the same project can use different palettes and material sets. It also allows imported content to keep its own visual setup instead of being forced into another asset's color configuration.

Importing External Assets โ€‹

When you import an external file as a new asset, Foxel analyzes its source colors and builds a matching Color Palette for that asset automatically.

If the source contains 256 colors or fewer, those colors can usually be preserved directly. If more than 256 colors are found, Foxel reduces them to fit within the palette limit by using color quantization.

When you import a file into the hierarchy of an existing asset, the imported content becomes part of that asset and must use its existing Color Palette and Material Set. In that case, Foxel maps the source colors to the colors of the current asset.

As a result, importing as a new asset usually preserves the original colors more closely, while importing into an existing asset integrates the content into the current asset's visual setup.