Prefabs Overview
In Foxel, a Prefab (short for "prefabricated object") is a reusable asset that encapsulates a specific design or functionality within your voxel environment. Prefabs are essential for streamlining the development process, allowing you to create complex structures and objects quickly and efficiently. By using Prefabs, you can maintain consistency across your projects and easily replicate designs without the need to recreate them from scratch.
Key Features of Prefabs
Voxel Grid: Each Prefab is built on a single voxel grid with a maximum size of 256x256x256. The Level of Detail (LOD) for each Prefab is automatically generated from the data the Prefab is made from, optimizing performance based on the viewer's distance.
Color Palette and Material Set: Every Prefab contains its own Color Palette and Material Set. This allows for unique visual styles and textures that can be easily customized to fit the theme of your project.
Integration with Voxel Scenes: Prefabs can be added to Voxel Scenes seamlessly. When a Prefab is integrated into a scene, its colors and materials are automatically matched to the Color Palette and Material Set of the open project, ensuring a cohesive look and feel.
Prefab Packages: Prefabs are organized and stored in Prefab Packages. These packages are compressed zip files that can contain any number of Prefabs, along with an index file that stores metadata about the Prefabs and the package itself in JSON format. This structure makes it easy to manage and share your Prefabs across different projects.
Related Topics
Creating and Managing Prefabs: Learn how to create a Prefab Package and manage the Prefabs contained within it.
Using Prefabs: Discover how to install and open a Prefab Package and how to add Prefabs to your scene.
Prefab Properties: Understand the properties of Prefabs and Prefab Packages, and learn how to edit them to suit your needs.