Core Concepts
Understanding scenes, objects, and components in Modularity Engine.
Scene Format and Serialization
Scenes are stored in a human-readable text format handled by SceneSerializer. This format is designed for easy diffing and manual editing, making it suitable for version control systems like Git.
Scene Structure
Each scene file contains:
- Header keys:
version,nextId,timeOfDay, andobjectCount - Each object stored as an
[Object]block with key/value pairs - Transforms stored as local position/rotation/scale relative to parent
Note
The text-based format allows for manual scene editing, merging, and debugging using standard text tools.
Scene Objects & Components
Every object is a SceneObject with a core transform and a set of component flags/data. The engine uses flags such as hasRenderer, hasLight, hasUI, etc., to decide which systems apply.
Core Components
| Component | Description |
|---|---|
Transform | Position/rotation/scale, plus local transform and parent/child relationships. |
Renderer | Mesh type + material + textures + shader paths. |
Light | Light type, color, intensity, range, and light-specific parameters. |
Camera | FOV, near/far, 2D settings, post-FX toggle. |
PostFX | Global effects settings (bloom, color adjust, motion blur, vignette, etc). |
Scripts | One or more script components (C++ or managed C#). |
Physics Components
3D (PhysX, optional):
Rigidbody- mass, damping, gravity, kinematic, lock rotationCollider- box, mesh, convex mesh, capsule
2D (built-in):
Rigidbody2D- velocity, gravityCollider2D- box, polygon, edgeParallaxLayer2DCameraFollow2D
Audio Components
AudioSource- clip path, volume, spatial, rolloffReverbZone- shape, blend distance, preset/custom parameters
Animation Components
Animation- keyframe clip, interpolationSkeletalAnimation- GPU skinning, clip index, bone data
UI Components
The UI component represents Canvas + UI elements:
- Anchoring, positioning in pixels, size, color, text, and interaction state.
- UI elements can optionally render in 3D to a texture target.
Object Types
Examples of built-in object types:
3D Primitives
Cube,Sphere,Capsule,Plane,Torus
Imported Meshes
OBJMesh- OBJ file importModel- Assimp-based (FBX, GLTF, etc.)
Lights
DirectionalLight,PointLight,SpotLight,AreaLight
UI Elements
Canvas- UI containerUIImage,UISlider,UIButton,UITextSprite(3D),Sprite2D(screen space)
Miscellaneous
CameraPostFXNodeMirrorEmpty