module Lapis::Docs::GENERAL::PIPELINE

Overview

Diorite Render Architecture & Zero-Alloc Pipeline

Architecture of Diorite's batch renderer, priority layering, immediate meshes, and zero-allocation memory recycling.

Overview

Diorite uses a decoupled architecture separating procedural command issuance from GPU batch dispatch. Commands submitted through the DSL or generated by nodes are aggregated into thread-safe queues and rendered efficiently using pre-allocated vertex arrays and immediate mesh buffers.

Key Topics

Topic Description
Visual Priority 3D items use StandardMaterial3D with render_priority 127 and FlagDisableDepthTest. 2D items render in a dedicated CanvasLayer on layer 128 with z_index 4096.
ImmediateMesh Batching All shapes are generated into unified continuous vertex arrays, dispatching to GPU in single draw calls per pass.
Lifetime Management Commands specify a duration in seconds. Single-frame commands (duration <= 0.0) are consumed immediately; timed commands decay remaining_time until expiration.

Code Examples

Configuring Render Priority

# Draw with on-top override disabled (obeys standard depth occlusion)
DebugDraw.box_3d(pos, size, Godot::Color.new(1, 1, 0), on_top: false)

Timed Persistence

# Retain hit spark for 0.75 seconds
DebugDraw.ray_hit_3d(origin, hit_point, hit_normal, duration: 0.75_f32)

Pitfalls & Best Practices

Frequently Asked Questions

Defined in:

docs/general/pipeline.cr

Class Method Summary

Class Method Detail

def self.example_01_configuring_render_priority : Nil #

Example: Configuring Render Priority

DebugDraw.box_3d(pos, size, Godot::Color.new(1, 1, 0), on_top: false)

[View source]
def self.example_02_timed_persistence : Nil #

Example: Timed Persistence

DebugDraw.ray_hit_3d(origin, hit_point, hit_normal, duration: 0.75_f32)

[View source]
def self.topic_01_visual_priority : Nil #

Visual Priority: 3D items use StandardMaterial3D with render_priority 127 and FlagDisableDepthTest. 2D items render in a dedicated CanvasLayer on layer 128 with z_index 4096.


[View source]
def self.topic_02_immediate_mesh_batching : Nil #

ImmediateMesh Batching: All shapes are generated into unified continuous vertex arrays, dispatching to GPU in single draw calls per pass.


[View source]
def self.topic_03_lifetime_management : Nil #

Lifetime Management: Commands specify a duration in seconds. Single-frame commands (duration <= 0.0) are consumed immediately; timed commands decay remaining_time until expiration.


[View source]