Heightmap โ
The Heightmap is one of the four asset types that can be used in a Foxel project. Heightmaps are pixel-based. Each pixel can store a color index, a material index and the pixel's height. Heightmaps can be loaded into Voxel Scenes via VoxelHeightmapReference nodes which convert the 2D pixel data into 3D voxel data.
Properties โ
| Name | Type | Default | Access | Description |
|---|---|---|---|---|
category | 1i | 0 | ๐ฉ๐ฅ | Category |
copyrightInfoUrl | 1s | ๐ฉ๐ฅ | Metadata, link to copyright info | |
copyrightNotice | 1s | ๐ฉ๐ฅ | Metadata, copyright notice | |
copyrightStatus | 1i | 0 | ๐ฉ๐ฅ | Metadata, CopyrightStatus |
creator | 1s | ๐ฉ๐ฅ | Metadata, creator of asset | |
description | 1s | ๐ฉ๐ฅ | Metadata, description | |
fps | 1f | 24.0 | ๐ฉ๐ฅ | Animation frames per second |
guid | 1s | ๐ฉโ | Globally unique identifier | |
headline | 1s | ๐ฉ๐ฅ | Metadata, headline | |
keywords | 1s | ๐ฉ๐ฅ | Metadata, keyword | |
size | 2i | (1,ย 1) | ๐ฉ๐ฅ | The surface size in pixels |
title | 1s | ๐ฉ๐ฅ | Metadata, title | |
unitScale | 1f | 1.0 | ๐ฉ๐ฅ | Unit scale |
Details
Type1b: boolean1c: color (integer)1i: integer1f: float1s: string2b: 2-component boolean vector2i: 2-component integer vector2f: 2-component float vector3b: 3-component boolean vector3i: 3-component integer vector3f: 3-component float vector
Access
๐ฉ : Property value can be read with FxFile.Get
๐ฅ : Property value can be changed with FxFile.Set
โ : Property value is read-only and can't be changed
Create โ
To create a new Heightmap use FxFile.Create with FileType 115.
assetID = FxFile.Create(115);
assetID = FxFile.Rename(115, assetID, "MyAsset"); -- rename new asset
FxFile.Open(115, assetID); -- open new assetTIP
The size of new Heightmaps is (1, 1). To resize the open Heightmap use FxFile.Set2i with the property size. For example, to resize to (100, 100) use FxFile.Set2i(115, "size" 100, 100);
Files โ
All asset files of a project are stored in the project folder Projects\PROJECTNAME\Assets\ with the file extension .fxl.