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

Discussion about editable terrain #8

Open
ethereumdegen opened this issue Sep 8, 2023 · 2 comments
Open

Discussion about editable terrain #8

ethereumdegen opened this issue Sep 8, 2023 · 2 comments

Comments

@ethereumdegen
Copy link

ethereumdegen commented Sep 8, 2023

After initial investigations, it looks like the path towards making the terrain editable would be to load the heightmap (and other textures) into memory first from a path, and then load them into the terrain from memory. Right now, the terrain loader seems to load the heightmap directly from a path which is non-conducive to making it editable.

If the heightmap data were loaded into memory first and then that struct were used to build the terrain (like AddAttachmentFromMemory or something similar) then a system could be built to edit that heightmap in memory and hot-reload the tiles/chunks every ~200ms as needed. Once that is done, the only thing left to do would be to add some sort of manual or auto save/export feature that could export the heightmap in memory back out to a file as the editor desired.

thoughts?

@ethereumdegen
Copy link
Author

For example , terrain config storing a path as a string is not ideal for this topology. Same goes for TileConfig. I think that disk paths need to be further decoupled in order to achieve this. Experimenting ...

@kurtkuehnert
Copy link
Owner

Sorry for replying so late. I am still waiting for bevys asset system 2.0, before I will continue working on asset related features.
Editable terrain will be a massive change to plugin. I do not think that CPU side processing will be fast enough. We will have to move the entire preprocessing code to the GPU. Ideally in a streamable and efficient manner.

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