Documentation
Core Concepts
Understanding scenes, objects, and components in Modularity Engine.
Scene Format and Serialization
Scenes are stored in a text format handled by SceneSerializer:
- Header keys include
version,nextId,timeOfDay, andobjectCount. - Each object is written as an
[Object]block with key/value pairs. - Transforms are stored as local position/rotation/scale relative to the parent.
This text format is intentionally human-readable for diffing and manual edits.
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