Scene Features
DDDBrowser supports a rich set of features that make scenes interactive and engaging. This guide covers all the features available in scenes.
Portals
Portals allow you to travel between scenes:
- Purpose: Connect different scenes together
- Trigger: Interact with portal instance
- Configuration:
- Auto-trigger (travel immediately on approach)
- Manual trigger (require interaction)
- Script trigger (controlled by scripts)
- Validation: Destination URL and world are validated
- Travel: Loads destination scene when triggered
Portals can specify:
- Destination URL
- Trigger radius
- World ID and position (for world-based scenes)
See Portal Examples for more details.
Textboxes
Textboxes display information and collect user input:
- Purpose: Show text, dialogs, quests, etc.
- Features:
- Title and content text
- Action buttons
- Checkboxes for preferences
- Script callbacks for user actions
- Types:
- Scene textbox instances (3D positioned)
- ImGui textboxes (overlay style)
Textboxes are controlled by scripts using Engine.openTextBox() and Engine.closeTextBox().
See Textbox Examples for usage.
Pictureboxes
Pictureboxes display images in the 3D world:
- Purpose: Show images, signs, UI elements in 3D space
- Configuration: Texture asset reference
- Positioning: Placed like any other instance
- Use cases: Signs, billboards, UI panels
Pictureboxes are defined as assets and placed as instances.
See Picturebox Examples for usage.
Audio Playback
Scenes can play audio:
- Types:
- Spatial audio: Positioned in 3D space, volume based on distance
- Ambient audio: Constant volume regardless of position
- Features:
- Looping support
- Volume control
- Multiple simultaneous sounds
- Script-controlled playback
Audio is controlled by:
- Audio instances in the scene
- Scripts using
Engine.playAudio()andEngine.stopAudio()
See Audio Examples for usage.
Lighting
DDDBrowser supports three types of lights:
Point Lights
- Type: Omni-directional light from a point
- Properties: Color, intensity, range
- Use case: Lamps, torches, area lighting
Directional Lights
- Type: Parallel light rays (like sunlight)
- Properties: Color, intensity, direction, shadows
- Use case: Sun, moon, global illumination
- Shadows: Can cast shadows with configurable resolution
Spot Lights
- Type: Cone-shaped light
- Properties: Color, intensity, direction, angle, range
- Use case: Flashlights, spotlights, focused lighting
All lights support:
- Color (RGB)
- Intensity (brightness)
- Shadows (directional lights)
- Real-time updates via scripts
See Lighting Examples for usage.
Shadows
Directional lights can cast shadows:
- Purpose: Realistic lighting with depth
- Configuration:
- Shadow map resolution
- Shadow bias
- Orthographic size
- Performance: Higher resolution = better quality but slower
- Limitations: Only directional lights cast shadows
Skyboxes
Skyboxes provide environment mapping:
- Purpose: Background environment (sky, space, etc.)
- Format: Cubemap texture (6 faces or equirectangular)
- Rotation: Optional rotation for animated skies
- Configuration: Defined in scene JSON
Skyboxes create atmosphere and context for scenes.
Scripts and Gamemodes
Scenes can include Lua/Luau scripts:
Entity Scripts
- Attached to: Individual instances
- Lifecycle:
on_start,on_update,on_interact, etc. - Purpose: Object behaviors, interactions, animations
- Access: Entity ID, asset ID, position, etc.
Gamemode Scripts
- Scope: Scene-wide
- Purpose: Game logic, state management, events
- Features:
- State persistence
- Event system
- Save/load support
See Lua/Luau API for complete scripting documentation.
Trigger Volumes
Trigger volumes detect player presence and trigger events:
- Types:
lookAtVolume: Player looks at itlookedAtVolume: Player has looked at itsingleTriggerVolume: Triggers oncemultiTriggerVolume: Triggers multiple timescooldownTriggerVolume: Triggers with cooldownexitTriggerVolume: Triggers on exitstayTriggerVolume: Triggers while stayingtimedEntryTriggerVolume: Triggers after timecounterTriggerVolume: Triggers after countsequenceTriggerVolume: Triggers in sequencetoggleTriggerVolume: Toggles on/off
- Use cases: Doors, checkpoints, events, puzzles
Autosave Volumes
Autosave volumes automatically save scene state:
- Purpose: Persistent game state
- Trigger: Player enters the volume
- Notification: Optional on-screen notification
- State: Saves gamemode and script state
See Scene Save Examples for usage.
Teleport Volumes
Teleport volumes move the player:
- Purpose: Instant player movement
- Trigger: Player enters the volume
- Destination: Target position in the scene
- Use cases: Elevators, portals, fast travel
Spawn Points
Spawn points define where players appear:
- Purpose: Set initial player position
- Configuration: X, Y, Z coordinates
- Default: (0, 0, 0) if not specified
- Use case: Start locations, respawn points
Movement Bounds
Movement bounds limit player movement:
- Purpose: Restrict player to an area
- Configuration: Min and max X, Y, Z coordinates
- Default: (-100, -100, -100) to (100, 100, 100)
- Use case: Confined spaces, levels with boundaries
Game Types
Scenes can specify a game type:
- FPS: First-person shooter style movement
- Full movement controls
- Jump, sprint, crouch, etc.
- NONE: View-only mode
- No player movement
- Camera controls only
- For viewing/interacting only
Next Steps
- Scene Format - Learn how to define features
- Lua/Luau API - Script interactive features
- Examples - See features in action