3D Scene Setup
Learn professional techniques for designing compelling 3D scenes in G3Engine. This guide covers scene composition, advanced lighting, material design, and camera management.Scene Architecture Best Practices
- ❌ Bad:
Cube 1,Sphere 3,Box 7 - ✅ Good:
Player,Platform_Main,Collectible_Coin
{
"name": "Ground",
"type": "plane",
"position": { "x": 0, "y": 0, "z": 0 },
"rotation": { "x": -1.5708, "y": 0, "z": 0 },
"scale": { "x": 10, "y": 10, "z": 1 },
"material": {
"color": "#2a2a3e",
"roughness": 0.8,
"metalness": 0.0
}
}
Rotation values are in radians. -90° = -1.5708 radians. The default plane rotation ensures it faces upward.
{x: 5, y: 0.2, z: 2}) for platforms{x: 0.2, y: 3, z: 5}) for wallsAdvanced Lighting
Lighting defines the mood and visibility of your game.{
"type": "directionalLight",
"name": "KeyLight",
"position": { "x": 5, "y": 8, "z": 5 },
"lightIntensity": 1.2,
"lightColor": "#ffffff"
}
{
"type": "pointLight",
"name": "FillLight",
"position": { "x": -3, "y": 4, "z": 2 },
"lightIntensity": 0.6,
"lightColor": "#b4d4ff"
}
#ff00ff, #00ffff){
"material": {
"color": "#6366f1",
"emissive": "#8b5cf6",
"emissiveIntensity": 1.5,
"roughness": 0.4,
"metalness": 0.1
}
}
Material Design
0.0 = Perfect mirror reflection0.5 = Balanced (plastic-like)1.0 = Completely matte (no reflections)1.0 = Fully opaque0.5 = Semi-transparent0.0 = Fully transparenttransparent: true to enable transparency{
"color": "#8b5cf6",
"roughness": 0.2,
"metalness": 0.0,
"emissive": "#8b5cf6",
"emissiveIntensity": 2.0
}
Camera Setup
position: {x: 0, y: 15, z: 0}, rotation: {x: -1.57, y: 0, z: 0}Scene Composition Tips
Rule of Thirds
Place important objects at the intersection points of a 3x3 grid for balanced composition.
Leading Lines
Use walls, paths, or platforms to guide the player’s eye toward objectives.
Depth and Layers
Create depth by placing objects at varying distances from the camera. Use foreground, midground, and background elements.
Color Contrast
Use contrasting colors to make important objects (like collectibles) stand out from the environment.
Performance Optimization
Object Count
Object Count
Keep total object count under 200 for smooth performance. Use fewer, larger objects rather than many small ones.
Light Count
Light Count
Limit active lights to 3-5. Too many lights drastically reduce frame rate. Use Ambient Light + 1-2 Directional/Point Lights.
Transparent Materials
Transparent Materials
Use transparency sparingly (max 2-3 objects). Transparent materials are expensive to render.
Scale Appropriately
Scale Appropriately
Use appropriate scale values. Extremely large or small scales can cause rendering issues.
Example Scene Setup
Here’s a complete platformer scene configuration:Next Steps
- Adding Interactivity - Make your scene interactive
- 2D Game Creation - Try the 2D editor
- Publishing Games - Share your 3D world