Grass.extm: Difference between revisions
Jump to navigation
Jump to search
imported>Zephenryus Added file specification for grass.extm files |
imported>Zephenryus m Added more images showing rgb manipulation. |
||
| Line 1: | Line 1: | ||
<onlyinclude> | <onlyinclude> | ||
[[File:580000c282.grass.extm.png|alt=Generated grass height map of Hyrule Main Field|thumb|Generated grass height map of Hyrule Main Field]] | |||
[[File:Rainbow-grass.jpg|alt=Full RGB color spectrum used for grass.|thumb|Full RGB color spectrum used for grass.]] | |||
[[File:Rainbow-grass-1.jpg|thumb]] | |||
<code>grass.extm</code> files describe the height and color of the main field grass and add-on content field. | <code>grass.extm</code> files describe the height and color of the main field grass and add-on content field. | ||
</onlyinclude> | </onlyinclude> | ||
== grass.extm File Specification == | == grass.extm File Specification == | ||
| Line 10: | Line 14: | ||
=== Grass Map Data === | === Grass Map Data === | ||
Each entry in the | Each entry in the grass data table is 4 bytes long. The rgb values are capable of producing all colors. | ||
{| class="wikitable" | {| class="wikitable" | ||
| Line 41: | Line 45: | ||
<code>x</code> and <code>z</code><ref><code>z</code> is expected to be an integer quotient. The <code>floor</code> function can be used if integer division is not supported.</ref> can be calculated, while iterating through the data table: | <code>x</code> and <code>z</code><ref><code>z</code> is expected to be an integer quotient. The <code>floor</code> function can be used if integer division is not supported.</ref> can be calculated, while iterating through the data table: | ||
<syntaxhighlight lang="c" line= | <syntaxhighlight lang="c" line="line"> | ||
for (int index = 0; index < 256 * 256; index++) { | for (int index = 0; index < 256 * 256; index++) { | ||
uint x = index % 256; | uint x = index % 256; | ||
Revision as of 06:18, 28 September 2018



grass.extm files describe the height and color of the main field grass and add-on content field.
grass.extm File Specification
grass.extm File Layout
Each file contains a 64×64 grid. For each vertex there is 4 bytes of data that describe the height of the grass and color.
Grass Map Data
Each entry in the grass data table is 4 bytes long. The rgb values are capable of producing all colors.
| Offset (h) | Size | Data Type | Description |
|---|---|---|---|
| 0x00 | 1 | Unsigned Byte | Blade height
|
| 0x01 | 1 | Unsigned Byte | r, red
|
| 0x02 | 1 | Unsigned Byte | g, green
|
| 0x03 | 1 | Unsigned Byte | b, blue
|
x and z[1] can be calculated, while iterating through the data table:
for (int index = 0; index < 256 * 256; index++) {
uint x = index % 256;
uint z = index / 256;
}
Material Index
| id | file | name | group | attribute | attribute_sub | flag | name (en) | group (en) |
|---|---|---|---|---|---|---|---|---|
| 0 | Blade_Green | 草 | A | None | 0 | Grass | ||
| 1 | Blade_Yellow | 草 | B | None | 0 | Grass | ||
| 0 | WoodChip_00 | 木くず00 | 木くず | None | None | 0 | Wood Chips 00 | Wood Chips |
| 1 | WoodChip_01 | 木くず01 | 木くず | None | None | 0 | Wood Chips 01 | Wood Chips |
| 2 | WoodChip_02 | 木くず02 | 木くず | None | None | 0 | Wood Chips 02 | Wood Chips |
| 3 | WoodChip_03 | 木くず03 | 木くず | None | None | 0 | Wood Chips 03 | Wood Chips |
| 4 | WoodChip_04 | 木くず04葦 | 木くず | None | None | 0 | Wood Chips 04 Reeds | Wood Chips |
| 5 | WoodChip_05 | 木くず04葦 | 木くず | None | None | 0 | Wood Chips 05 Leaves | Wood Chips |
- ↑
zis expected to be an integer quotient. Thefloorfunction can be used if integer division is not supported.