Skip to main content

Scenes


A Scene is a container for objects and scripts. Scenes can be stored on disk in JSON and loaded at any time. The content of a scene includes:

  • Objects (Mesh3D, Image2D, Lights, Particles, etc.)
  • Scripts (scene-level Lua scripts)
  • Shaders (post-processing effects)
  • Camera position and rotation
  • ADS lighting configuration
  • Physics setup (gravity, substeps...)

Creating a New Scene


When you launch Brakeza3D, it starts with an empty scene. To create a new scene from scratch:

  1. If you have objects in the current scene, save it first or create a new project
  2. The empty scene is your blank canvas to start building

Adding Objects to a Scene

There are multiple ways to add objects to your scene:

MethodDescription
MenuUse Add Object menu to add primitives, lights, models, or empty objects
ScriptsCreate objects programmatically using ObjectFactory

Scene Objects Widget

The Scene Objects window (Window → Scene Objects) displays all objects currently in the scene as a hierarchical list:

  • Click an object to select it
  • Double-click to focus the camera on it
  • Right-click for context menu options

Managing Scenes


Scenes are managed through the File Browser window (WindowFile Browser). Navigate to the Scenes section to browse, load, save, or delete scenes.

Scenes in File Browser

ActionDescription
InfoView scene details (objects, scripts, settings)
LoadLoad the scene into the editor
SaveSave current scene to this file
DeleteRemove the scene file from disk

Scene Detail Widget


By clicking on Detail scene, we can view the detailed contents of the scene.

Scene detail window

The detail view shows:

  • List of all objects in the scene
  • Attached scripts and shaders
  • Camera position
  • Lighting configuration

Saving a Scene


To save your current work:

  1. Open WindowFile Browser
  2. Navigate to the Scenes section
  3. Click the Save button on an existing scene to overwrite it
  4. Or type a new name and click Save As to create a new scene file

Scenes are saved as JSON files in assets/scenes/.

What Gets Saved

ElementSavedNotes
ObjectsYesPosition, rotation, scale, properties
ScriptsYesFile paths and enabled state
ShadersYesPost-processing chain
CameraYesPosition and rotation
LightingYesADS components and direction
PhysicsYesGravity, substeps settings

Loading a Scene


To load an existing scene:

  1. Open WindowFile Browser
  2. Navigate to the Scenes section
  3. Select the desired scene and click Load
warning

Loading a scene will replace all current objects. Save your work first!

Loading Scenes from Scripts

You can also load scenes programmatically:

function onStart()
-- Load a scene
Components:Render():getSceneLoader():LoadScene("../scenes/MyLevel.json")
end

Scene Workflow


Typical Development Workflow

  1. Setup: Create a new project, configure global settings
  2. Build: Add objects, position them, configure properties
  3. Script: Attach scripts to objects and the scene
  4. Test: Press Play to test your scripts
  5. Iterate: Stop, make changes, test again
  6. Save: Save both scene and project regularly

Multi-Scene Projects

For larger projects with multiple levels:

  1. Create a main menu scene with UI and navigation
  2. Create level scenes for gameplay
  3. Use project scripts to manage scene transitions
  4. Use global variables to persist data between scenes

Example scene transition script:

-- In a project script
function LoadNextLevel()
currentLevel = currentLevel + 1
local scenePath = "../scenes/Level" .. currentLevel .. ".json"
Components:Render():getSceneLoader():LoadScene(scenePath)
end

Scene Scripts vs Object Scripts


TypeScopeVariablesUse Case
Scene ScriptsGlobal to sceneShared between scriptsGame managers, UI controllers
Object ScriptsPer-object instanceIsolated per objectObject behavior, AI

Adding Scene Scripts

  1. Open WindowProject Setup
  2. Expand Scene scripts
  3. Drag a script from the File Browser (Scripts section)

Scene scripts run independently of any specific object and are ideal for:

  • Game state management
  • Score tracking
  • Level logic
  • Camera control

Scene Configuration


Camera Settings

Configure the scene camera through Camera menu:

SettingDescription
FOVField of view angle (default: 90)
Far PlaneMaximum render distance

Lighting Settings

Configure through Illumination menu:

SettingDescription
AmbientBase light color
DiffuseMain light color
SpecularHighlight color
DirectionSun direction vector
ShadowsEnable/disable shadow mapping

Physics Settings

Configure through Colliders menu:

SettingDescription
GravityWorld gravity (default: -9.8 on Y)
SubstepsPhysics simulation precision
DebugVisual collision debugging

Tips and Best Practices


  1. Save frequently: Brakeza3D doesn't auto-save
  2. Use meaningful names: Name your objects descriptively for easier scripting
  3. Organize with hierarchy: Use parent-child relationships for complex objects
  4. Test incrementally: Test after each major change
  5. Backup scenes: Keep copies of working scenes before major changes