Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
MJacred committed Aug 28, 2023
1 parent 80e5cbd commit 944a898
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Blender Mesh to RAW file Exporter

Exports your selected object's mesh as a heightmap `.raw` file with
* 16-bit or 24-bit unsigned integer value
* endianness: little or big
Exports your selected object's mesh as a heightmap file in the formats
* `.raw`
* bit depth: 16, 24 or 32 (unsigned integer value)
* endianness: little or big
* OpenEXR (32-bit float)

Tested import with the following heightmap terrain engines
* [Zylann's Heightmap Plugin](https://github.com/Zylann/godot_heightmap_plugin)
Expand All @@ -13,7 +15,7 @@ The most common method to create a heightmap in Blender is to use the camera in
But not everybody supports 16-bit PNG (e.g. [Godot does not](https://github.com/godotengine/godot/pull/19497)).
Then there's the the full (32-bit; not necessarily supported in target platform) or single channel half (16-bit) precision floating-point method using [_OpenEXR_](https://blender.stackexchange.com/questions/191253/how-to-render-height-map-in-blender), where you'll have to know if your target platform needs floats in the range of 0..1 or real height values (in meters). You could later remap e.g. 0..1 to real heights, but the precision loss there is not acceptable. Precision loss often results in _stepping artifacts_.
And then you have to be careful of Blender's color management: the color space needs to be linear, not e.g. sRGB. And use the correct [map height value](https://github.com/Zylann/godot_heightmap_plugin/issues/90#issuecomment-536215938) in your material.
And I tried all that, even working with Blender's compositor and reading the camera's z-depth. [Nothing gave good results](https://github.com/Zylann/godot_heightmap_plugin/issues/327). Hence this add-on, which uses real height information and directly reads the vertices' z-value and converts float to 16- or 24-bit unsigned integers for the `.raw` file.
And I tried all that, even working with Blender's compositor and reading the camera's z-depth. [Nothing gave good results](https://github.com/Zylann/godot_heightmap_plugin/issues/327). Hence this add-on, which uses real height information and directly reads the vertices' z-value and converts them as needed.


## Installation
Expand Down
13 changes: 6 additions & 7 deletions docs/raw-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
* clicking on `Get Status` gives you feedback on your Mesh: check your resolution and copy your min and max height values,
* specify the location and filename to save to
* choose your bit-depth
* 24-bit (better for maps with high difference between min and max value ([1](https://github.com/Zylann/godot_heightmap_plugin/issues/340#issuecomment-1222655581), [2: slide 17](https://www.gdcvault.com/play/1025480/Terrain-Rendering-in-Far-Cry)))
* 16-bit
* 32-bit (best results)
* 24-bit (good results)
* 16-bit (potentially bad results)
* choose your endianness (default: little)
* click `Export` and you get your mesh as a heightmap file (`.raw`)
* Done
Expand All @@ -24,11 +25,9 @@
In Godot, with Zylann's Heightmap Plugin, you import your `.raw` file like `.png`, `.exr`, etc.

Import settings
* Raw Endianess: The one you chose on your export
* godot4 branch:
* Once [this PR](https://github.com/Zylann/godot_heightmap_plugin/pull/369) is merged, you can import 24-bit raw files. Bit-depth is auto-detected.
* main branch (for Godot 3.x)
* expects 16-bit raw file; **does not support 24-bit import!**
* Bit depth and Raw Endianess: The ones you chose on your export
* for Godot 3.x:
* only supports 16-bit raw file
* `Min Height` + `Max Height`: take them from the Add-on Panel in Blender, see `Min-Max`.

![Imported map in Godot using Zylann's Heightmap Plugin](images/godot_zylanns_hm_plugin.png)
Expand Down

0 comments on commit 944a898

Please sign in to comment.