Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hterrain_data.gd: Unknown heightmap format 12 #428

Open
TheConceptBoy opened this issue Feb 27, 2024 · 3 comments
Open

hterrain_data.gd: Unknown heightmap format 12 #428

TheConceptBoy opened this issue Feb 27, 2024 · 3 comments

Comments

@TheConceptBoy
Copy link

I've ported my project to Godot 4 and hterrain seems to be complaining about terrain format.

image

@Zylann
Copy link
Owner

Zylann commented Feb 27, 2024

Heightmaps used to have the Godot image format RH (12), now they are using RF (the height.res is a Godot Image saved as-is with ResourceLoader).

There is still code handling RH, however there are several spots missing this and probably needs a case for RH case

if im.get_format() == Image.FORMAT_RF:

In fact other things might break with RH, if you find some you can report them, but every new heightmap uses RF.

I dont think the plugin will currently convert to RF if you have an existing map in the old format, it will keep saving the data as-is.
However I think if you export the heightmap as 32-bit float greyscale EXR and re-import it, it will become RF.
Nevermind, looks like it won't work. So for now you may have to use a script:

var path := "terrain/height.res"
var im := load(path)
im.convert(Image.FORMAT_RF)
ResourceSaver.save(im, path)

@Zylann
Copy link
Owner

Zylann commented Feb 27, 2024

I pushed a few things, notably this which should load your old heightmap as RF if the found format is RH. To make the conversion persist, you may do any edit and save your scene.

@TheConceptBoy
Copy link
Author

Roger. Will give this a try and if no, export and re-import the heightmap :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants