1. Dashboard
  2. Getting Started
  3. GitHub
  4. API
  5. Articles
  6. Level Editor
  7. Members
    1. Recent Activity
    2. Users Online
    3. Staff
    4. Search Members
  8. Forum
  9. Discord
  • Login
  • Register
  • Search
Getting Started
  • Everywhere
  • Getting Started
  • Articles
  • Pages
  • Forum
  • More Options
  1. GFX-Engine
  2. Articles
  3. Getting Started

Core Concepts

  • Andy
  • December 25, 2025 at 7:47 PM
  • 337 Views
  • 0 Comments

This section explains the fundamental concepts behind GFX-Next.
It assumes familiarity with C#, object-oriented design, and general game development workflows.

GFX-Next is designed around explicit control, clear ownership, and minimal hidden behavior.
Understanding these core ideas is essential before diving into advanced features.

Contents [hideshow]
  1. Application Structure & Game Loop
    1. Lifecycle Overview
  2. Asset Management & Resource Lifetime
    1. Key Principles
  3. Meshes, Primitives & Geometry
    1. Meshes
    2. Primitives
  4. Scenes, GameElements & Hierarchies
    1. GameElements
  5. Components & Behaviors
  6. Physics Integration
  7. Rendering Pipeline & Post Processing
  8. UI & HUD Rendering
  9. Summary

1. Application Structure & Game Loop

At the heart of every GFX-Next application is the Game base class.

A typical project derives from it:

C#
public class MyGame : Game
{
    public override void LoadContent(AssetManager assets) { }
    public override void Initialize(IRenderDevice renderer) { }
    public override void Update(float deltaTime) { }
    public override void Render() { }
}

Lifecycle Overview

The application lifecycle is explicitly split into stages:

  1. LoadContent
    Load and register assets using the AssetManager.
  2. Initialize
    Upload GPU resources and initialize runtime systems.
  3. Update
    Advance game logic, physics, animations, and input.
  4. Render
    Perform all rendering steps in a fully explicit order.

This separation ensures that:

  • Asset loading is deterministic
  • GPU resource ownership is explicit
  • Editor and runtime can share the same core logic

2. Asset Management & Resource Lifetime

All assets in GFX-Next are managed through the AssetManager.

C#
_lionModel = assets.Load<StaticMeshModel>("Ressources/Lion/Lion.gltf");
_defaultMaterial = assets.Add(new SGMaterial("DefaultMaterial", color));
_cubeMesh = assets.Add("CubeMesh", Cube.GetMesh(_defaultMaterial));

Key Principles

  • Assets are registered explicitly
  • Ownership lies with the user, not the engine
  • CPU and GPU resources are handled separately
  • Assets can be shared across multiple game elements

This design avoids implicit loading, background magic, or hidden caches.

3. Meshes, Primitives & Geometry

GFX-Next distinguishes between geometry and instances.

Meshes

A Mesh represents raw geometry data:

  • vertices
  • indices
  • optional default material

Meshes are assets and can be shared freely.

Code
_cubeMesh = assets.Add("CubeMesh", Cube.GetMesh(_defaultMaterial));

Primitives

A Primitive is a renderable scene element that references a mesh.

C#
var ground = new Primitive("Ground", _cubeMesh);
var debugCube = new Primitive("DebugCube", _cubeMesh, _debugMaterial);

Key points:

  • Multiple primitives can reference the same mesh
  • Materials can be overridden per instance
  • No geometry duplication occurs

This enables efficient instancing and clean separation between data and usage.

4. Scenes, GameElements & Hierarchies

All world objects live inside a Scene.

C#
this.Scene = new Scene3D();
Scene.AddGameElement(ground);

GameElements

A GameElement is the base unit of a scene:

  • has a transform
  • can have children
  • can contain behaviors
C#
Player = new Empty("Player", position);
Player.AddChild(new StaticModel("ViewModel", _viewModelMesh));

This allows hierarchical transformations and clean scene graphs.

5. Components & Behaviors

Behavior logic is attached via behaviors, not inheritance.

C#
var rigidbody = Player.AddBehavior(new CapsuleRigidBody(PhysicsHandler));
var controller = Player.AddBehavior(new FPSController());

Benefits:

  • Clear separation of data and logic
  • Reusable behavior components
  • No deep inheritance chains

This approach keeps game elements lightweight and flexible.

6. Physics Integration

Physics is integrated explicitly through a PhysicsHandler.

C#
this.PhysicsHandler = new PhysicsHandler3D(gravity);
Scene.PhysicsHandler = this.PhysicsHandler;

Colliders and rigid bodies are added via behaviors:

C#
var collider = ground.AddBehavior(new BoxCollider(PhysicsHandler));
collider.CreateCollider(0);

Debug visualization is opt-in and configurable.

7. Rendering Pipeline & Post Processing

Rendering in GFX-Next is fully explicit.

C#
Scene.RenderShadowMaps(Viewport, RenderDevice, Camera);
Scene.Render(Viewport, RenderDevice, Camera);

Post-processing is handled through a stack:

C#
_postProcessStack.Apply(RenderDevice, renderTarget.TextureId);
RenderDevice.DrawRenderTarget(_postProcessStack.RenderTarget, GLRenderer.Backbuffer);

There is no implicit “final pass” — the user controls:

  • when render targets are drawn
  • how UI and scene rendering are composed
  • which effects are applied

8. UI & HUD Rendering

2D UI rendering is handled separately using Canvas2D.

C#
HUD.Render(Viewport, RenderDevice);
RenderDevice.DrawRenderTarget(HUD.RenderTarget, GLRenderer.Backbuffer);

This allows:

  • clean separation between 3D and 2D rendering
  • flexible composition
  • editor overlays and debug tools

Summary

The core concepts of GFX-Next revolve around:

  • Explicit control instead of hidden behavior
  • Clear ownership of assets and resources
  • Separation of data, logic, and rendering
  • A shared core for runtime and editor usage

Understanding these principles makes the rest of the engine predictable, flexible, and easy to extend.

  • Tutorial
  • Previous Article Installation
  • Next Article Scene & Gameplay

Related Articles

Scene & Gameplay

This article explains how gameplay logic, scene structure, and runtime behavior are organized in GFX-Next. It provides an overview of the core architectural concepts and shows how these elements interact to form a cohesive execution model. By outlining responsibilities, data flow, and lifecycle management, the article helps developers understand how to design, extend, and debug systems built on top of GFX-Next more effectively.
Andy
December 26, 2025 at 11:29 AM
0

Categories

  1. Advanced Tutorial 1
  2. Getting Started 8
  3. Default Category 1
  4. Reset Filter

Partner & Supporter

  1. Privacy Policy
  2. Legal Notice
Powered by WoltLab Suite™