Grass.extm: Difference between revisions

imported>Zephenryus
Added file specification for grass.extm files
 
imported>Zephenryus
m Updated image of main field grass height map
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{lowercase}}
<onlyinclude>
<onlyinclude>
[[File:5000000000.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 ==


=== grass.extm File Layout ===
=== 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.
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 ===
=== Grass Map Data ===
 
Each entry in the grass data table is 4 bytes long. The rgb values are capable of producing all colors.
Each entry in the water data table is 4 bytes long.
 
{| class="wikitable"
{| class="wikitable"
!Offset (h)
!Offset (h)
Line 38: Line 40:
|<code>b</code>, blue
|<code>b</code>, blue
|}
|}
<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="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;
Line 49: Line 49:


=== Material Index ===
=== Material Index ===
{| class="wikitable"
{| class="wikitable"
!id
!id
Line 141: Line 140:
|Wood Chips
|Wood Chips
|}
|}
<references />
<references />
[[Category:File formats]]
[[Category:File formats]]
[[Category:File extensions]]
[[Category:File extensions (STERA)]]