How xkostmand/pure3d works
Project type and purpose
• This is a low-level graphics engine (“Pure3D Engine”) written in Java 21 on top of LWJGL 3 and OpenGL 3.3.
• Its purpose is to demonstrate manual GPU interaction, custom shader pipelines, and raw memory management.
File structure
• Single Gradle module (build.gradle, settings.gradle).
• Entry point: src/main/java/com/chrys/pure3d/Main.java.
• No separate “frontend”/“backend” folders—this is a standalone rendering engine.
• Dependencies managed via Gradle; wrapper files under gradle/wrapper.
README for additional insights
• Core libraries: LWJGL 3 (GLFW + OpenGL), JOML for math.
• Key subsystems: Windowing (GLFW), Rendering Loop, Shader Pipeline (vertex + fragment), Memory Manager for VBOs/VAOs, Input State Management, Math (MVP matrices, lighting).
Main components
a. Application / Entry Point (Main)
b. Window & Context Manager (GLFW)
c. Render Loop & Scheduler
d. Resource Manager / Memory Manager (native buffers, VBOs, VAOs)
e. Shader Manager (GLSL 330 pipeline)
f. Math Library (JOML modules: Vector, Matrix)
g. Input Manager (keyboard/mouse state toggles)
h. GPU Driver / Hardware (OpenGL 3.3)
Relationships and interactions
• Main initializes Window Manager → creates GLFW window/context.
• Main enters Render Loop:
• Each iteration: Input Manager polls events → updates state.
• Resource Manager provides buffer handles to the GPU.
• Math Library computes MVP matrices → passed as uniforms to shaders.
• All subsystems depend on core LWJGL bindings.
Architectural patterns & design principles
• Modular subsystem pattern: separate concerns (windowing, rendering, resource management, math, input).
• Pipeline pattern for shaders (vertex → fragment).
• Game-loop pattern: fixed update + render loop.
• Manual resource lifetime management (allocate on init, free on exit).
Technologies, frameworks, libraries
• LWJGL 3 (GLFW bindings, OpenGL bindings)
• JOML for vector/matrix math
• GLSL 330 Core for shader code
• Gradle for build and dependency management
Essential details to capture
• Initialization phase (context creation, buffer allocation).
• Per-frame loop (input, update, render).
• Shader pipeline stages and uniform uploads.
• Memory/resource lifecycle (allocate VBO/VAO, free on shutdown).
• Boundary between managed Java heap and native GPU memory.