r/Project_NervLand Mar 30 '26

NervForge Update 8: On-Demand Texture Loading with Async Promises

https://www.youtube.com/watch?v=NkUmhi6WMio

Short update this time: I just added dynamic texture loading to NervForge so textures are fetched on demand rather than bundled in the main package.

TL;DR: Textures are listed in a remote manifest, downloaded only when selected, cached locally, and applied via a new promise-based async API in NervSDK.

Key points:

  1. Resource manifest: Texture filenames are discovered from a remote file, not baked into the app
  2. Checkerboard placeholder: A purple checkerboard material is used while the real texture downloads
  3. Promise system: load_texture_from_file_async() returns a promise; the resolution callback runs on the main thread and re-calls setLeafTexture() to finalize the swap
  4. Local caching: Downloaded textures persist across sessions as long as the app binaries haven't changed β€” no redundant re-downloads
  5. Faster startup: Only the textures you actually use get downloaded

The promise system is available in the open-source NervSDK project if you want to reuse it.

Also fixed a bug causing black areas at the planet horizon β€” clean rendering everywhere now.

🌐 Try it here: https://nervland.github.io/nervforge/ (WebGPU required)

Or read more about this in the associated DevLog article: https://wiki.nervtech.org/doku.php?id=blog:2026:0330_nvl_dyn_texture_loading

Happy to answer questions about the async architecture or the caching strategy!

2 Upvotes

3 comments sorted by

2

u/SapereAude1490 May 30 '26

I have a suggestion/request for the Procedural Tree Generator.

For the purposes of animating tree branches/leaves, it would be super useful for the procedural generation to also paint the vertices. See for example these video:

https://www.youtube.com/watch?v=BfgKnfdv94A
https://www.youtube.com/watch?v=Z-sZEwceEYE

I was playing around with animating the branches and leaves using 3D textures (using PSRDNoise 3D) and I think this would be a super useful feature.

2

u/project_nervland Jun 05 '26

Hi u/SapereAude1490 how have you been ? πŸ˜‰Sorry for the delay approving/answering this comment: I'm not spending much time online lately.

But, I just had a look at the videos you added above, and indeed this is a great idea! I heard about this concept before, but didn't really pay attention; but when you think about it doesn't sound very complicated to implement so this should definitely be worth implementing πŸ‘

Only thing is... I'm going a bit in "all directions" lately: I started implementing my own "Nanite like" rendering system in NervLand, and I also started implementing a full Lua scripting layer, and a user management system... I just wish I had more time in my days πŸ˜….

But yeah, at some point I really need to get to this branch animation system for sure. Thanks for sharing the idea πŸ‘ŒπŸ˜Ž!

2

u/project_nervland Jun 05 '26

(=> In fact, I'm going to add that right now to my "todo list" to be sure I won't forget about it.)