1---2name: game-development-3d-games3description: 3D game development principles. Rendering, shaders, physics, cameras.4---5# 3D Game Development67> Principles for 3D game systems.89---1011## 1. Rendering Pipeline1213### Stages1415```161. Vertex Processing → Transform geometry172. Rasterization → Convert to pixels183. Fragment Processing → Color pixels194. Output → To screen20```2122### Optimization Principles2324| Technique | Purpose |25|-----------|---------|26| **Frustum culling** | Don't render off-screen |27| **Occlusion culling** | Don't render hidden |28| **LOD** | Less detail at distance |29| **Batching** | Combine draw calls |3031---3233## 2. Shader Principles3435### Shader Types3637| Type | Purpose |38|------|---------|39| **Vertex** | Position, normals |40| **Fragment/Pixel** | Color, lighting |41| **Compute** | General computation |4243### When to Write Custom Shaders4445- Special effects (water, fire, portals)46- Stylized rendering (toon, sketch)47- Performance optimization48- Unique visual identity4950---5152## 3. 3D Physics5354### Collision Shapes5556| Shape | Use Case |57|-------|----------|58| **Box** | Buildings, crates |59| **Sphere** | Balls, quick checks |60| **Capsule** | Characters |61| **Mesh** | Terrain (expensive) |6263### Principles6465- Simple colliders, complex visuals66- Layer-based filtering67- Raycasting for line-of-sight6869---7071## 4. Camera Systems7273### Camera Types7475| Type | Use |76|------|-----|77| **Third-person** | Action, adventure |78| **First-person** | Immersive, FPS |79| **Isometric** | Strategy, RPG |80| **Orbital** | Inspection, editors |8182### Camera Feel8384- Smooth following (lerp)85- Collision avoidance86- Look-ahead for movement87- FOV changes for speed8889---9091## 5. Lighting9293### Light Types9495| Type | Use |96|------|-----|97| **Directional** | Sun, moon |98| **Point** | Lamps, torches |99| **Spot** | Flashlight, stage |100| **Ambient** | Base illumination |101102### Performance Consideration103104- Real-time shadows are expensive105- Bake when possible106- Shadow cascades for large worlds107108---109110## 6. Level of Detail (LOD)111112### LOD Strategy113114| Distance | Model |115|----------|-------|116| Near | Full detail |117| Medium | 50% triangles |118| Far | 25% or billboard |119120---121122## 7. Anti-Patterns123124| ❌ Don't | ✅ Do |125|----------|-------|126| Mesh colliders everywhere | Simple shapes |127| Real-time shadows on mobile | Baked or blob shadows |128| One LOD for all distances | Distance-based LOD |129| Unoptimized shaders | Profile and simplify |130131---132133> **Remember:** 3D is about illusion. Create the impression of detail, not the detail itself.134135## When to Use136This skill is applicable to execute the workflow or actions described in the overview.137138## Limitations139- Use this skill only when the task clearly matches the scope described above.140- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.141- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.