Welcome to Pyrite’s Engine Documentation!
Pyrite is a highly-optimized, procedural 3D Voxel Engine written entirely in Python.
Unlike standard Python projects, Pyrite heavily utilizes Just-In-Time (JIT) LLVM compilation via Numba to bypass the Global Interpreter Lock (GIL) and achieve near C++ performance.
This documentation breaks down the core systems of the engine, explaining how terrain is generated, how light propagates, and how millions of voxels are rendered smoothly at 60+ FPS.
Getting Started:
- Installation and Setup Guide
- Core Engine Flow
- Engine Initialization
- State Management
- World Generation and Sessions
- The Main Loop
- Application Control
- Detailed Initialization Sequence
- Detailed State Machine
- The Main Game Loop (Pseudocode)
- Detailed Event Handling
- Detailed Update Step (In-Game)
- Detailed Render Step
- Scene Rendering Pipeline
- World Session Initialization (LOADING state)
- Shutdown and Cleanup
Engine Architecture:
Core Systems:
- Mesh Systems and Vertex Packing
- Overview
- Mesh Classes Hierarchy
- Vertex Packing: 32-Bit Format
- Greedy Meshing Algorithm
- Vertex Light Smoothing
- Ambient Occlusion (AO) Calculation
- Flip Detection (Diagonal Flip for Lighting)
- Water Faces Handling
- Mesh Building Pipeline (CPU to GPU)
- Data Flow Example
- Custom Mesh Variants
- Replication Guide
- Procedural Terrain Generation
- Player Systems
- User Interface Systems and Components
- World Persistence and Data Storage
- Survival & Physics Mechanics
Learning and Reference:
- Implementation Tutorials and Replication Guides
- API Reference
- Core Engine (
main.py) - Player (
player.py) - World (
world.py) - Chunk (
chunk.py) - Scene (
scene.py) - VoxelHandler (
voxel_handler.py) - Constants (
settings.py) - Shader Programs (
shader_program.py) - Mesh Building (
build_chunk_mesh.py) - Terrain Generation (
terrain_gen.py) - Lighting (
lighting.py) - Common Enums and Constants
- Core Engine (
Development: