Skip to content

Implements a packed octree using native memory management in Zig + Java 19 JEP 424

License

Notifications You must be signed in to change notification settings

ShirleyNekoDev/Chunky-CPUNativeOctree

Repository files navigation

[Experimental] NativeOctree plugin for Chunky 2.5+

Provides a new octree implementation which uses native CPU operations and OS memory management to speed up chunk loading / octree creation and rendering of Chunky scenes.

⚠️ Disclaimer: This project is experimental. Do not expect interoperability, feature completeness or faster rendering with the current implementation. Especially Java-native interoperability is a bottleneck and will change in the future.

Project Goals

Different octree implementations optimized for different user needs with optimizations for different stages in the scene creation process:

  • Octree optimized for insertion / building (faster octree creation)
  • Octree optimized for memory efficiency (loading huge worlds)
  • Octree optimized for access speed (fast rendering)

(Personal goals: learn Zig, efficient memory management, optimizations for modern platforms)

Requirements

Builds / Releases

Releases are compiled for x86_64 (64-bit) systems targeting Windows, Linux and MacOS and packed into a single cross-platform .jar.

⚠️ Disclaimer: Only Windows is tested at the moment.

Build Requirements

  • JDK 21+
  • Zig 0.11.0+

Installation

  1. Download the newest version from the releases
  2. Put the downloaded .jar-file in .chunky/plugins/
  3. Start the Chunky launcher and ensure that you have the newest release installed (2.5-SNAPSHOT or higher)
  4. Enable the plugin in the plugin manager
  5. Make sure that you are using an installation of Java 19 (or a subversion 19.x, but not a lower or higher version)
  6. Append --enable-preview --enable-native-access=ALL-UNNAMED to the Java options
  7. Start Chunky and switch the octree implementation to NATIVE_ZIGv1 in the Advanced tab
  8. (If you have the debug console enabled, you should now see some messages about created octrees)

About

Implements a packed octree using native memory management in Zig + Java 19 JEP 424

Topics

Resources

License

Stars

Watchers

Forks