Drawing

The picture is Java and OpenGL. Rust does not submit draw calls. Window owns the GLFW window. Renderer draws chunk meshes, actors, the HUD, and the loading card, then the loop swaps buffers.

Window and camera

Activerse.start opens a 1280×720 window titled Activerse Frontier. On macOS the process must be started with -XstartOnFirstThread or GLFW will not run. pollEvents and swapBuffers stay on that thread.

Camera stores position, yaw, pitch, and vertical field of view. Yaw 0 looks along +X. turn applies cursor pixels times mouseSensitivity, with optional invert on Y. Pitch is clamped. writeForward and writeUp feed the audio listener each frame.

vsync in Activerse.toml defaults to true. The swap waits for the display. Turning it off does not make nowNs the present time. It only stops the wait. The engine does not yet record the timestamp of the swap.

Chunks on the GPU

ChunkMesher builds a MeshData from a VoxelChunk and the neighbour solidity query. Workers mesh off the main thread. pumpUploads creates the GL buffers on the main thread, nearest chunks first, up to chunk_uploads_per_frame.

An empty chunk is queued without a worker and is marked published with no buffer. getGpuMeshCount() therefore stays below the chunk count whenever part of the column is air. getMeshPublishedCount() includes those empty chunks. WorldLoadGate uses the published count. The overlay closes once every loaded chunk is published and the generate, mesh, and upload queues are empty, after minDisplaySeconds (default 0.9 s). It no longer waits out a timeout because air never produced a mesh.

msaa_samples is 0, 2, 4, 8, or 16. Default is 4. texture_filter is nearest or linear. dynamicLighting turns point lights on in the lit shader. Fog distances are fog_start and fog_end.

Actors, skins, UI

An actor with a mesh is drawn in its transform. PlayerAvatar is the third-person figure used by OptiShoot: head, body, arms, and legs, plus overlay layers. PlayerSkin.load reads a 64×64 PNG, or the older 64×32 layout, and detects slim arms. One texel is 1/16 m, so a 32-texel figure is 2 m tall. Material can discard low-alpha texels for those overlays.

UI is ActiverseRender.ui: UiCanvas, buttons, labels, sliders, text fields, item slots, and UiInventoryPanel (9 hotbar slots and 27 storage slots). The canvas updates from Input when no loading card and no chat is open. Hit tests use framebuffer pixels.

LoadingOverlay is a single global card. WorldLoadGate drives its progress. The bar stays at or below 92% until the world is actually ready, then the gate hides it.

Audio

AudioEngine.init opens the OpenAL device during Activerse.start and shutdown closes it. Each frame the loop sets the listener to the camera position, forward, and up. SoundBuffer holds decoded PCM. WavLoader reads WAV files. SoundSource is a positioned voice. Game code plays sources. The clock does not schedule audio.