1---2name: 3d-games3description: 3D game development principles. Rendering, shaders, physics, cameras.4---56# 3D Game Development78> Principles for 3D game systems.910---1112## 1. Rendering Pipeline1314### Stages1516```171. Vertex Processing → Transform geometry182. Rasterization → Convert to pixels193. Fragment Processing → Color pixels204. Output → To screen21```2223### Optimization Principles2425| Technique | Purpose |26|-----------|---------|27| **Frustum culling** | Don't render off-screen |28| **Occlusion culling** | Don't render hidden |29| **LOD** | Less detail at distance |30| **Batching** | Combine draw calls |3132---3334## 2. Shader Principles3536### Shader Types3738| Type | Purpose |39|------|---------|40| **Vertex** | Position, normals |41| **Fragment/Pixel** | Color, lighting |42| **Compute** | General computation |4344### When to Write Custom Shaders4546- Special effects (water, fire, portals)47- Stylized rendering (toon, sketch)48- Performance optimization49- Unique visual identity5051---5253## 3. 3D Physics5455### Collision Shapes5657| Shape | Use Case |58|-------|----------|59| **Box** | Buildings, crates |60| **Sphere** | Balls, quick checks |61| **Capsule** | Characters |62| **Mesh** | Terrain (expensive) |6364### Principles6566- Simple colliders, complex visuals67- Layer-based filtering68- Raycasting for line-of-sight6970---7172## 4. Camera Systems7374### Camera Types7576| Type | Use |77|------|-----|78| **Third-person** | Action, adventure |79| **First-person** | Immersive, FPS |80| **Isometric** | Strategy, RPG |81| **Orbital** | Inspection, editors |8283### Camera Feel8485- Smooth following (lerp)86- Collision avoidance87- Look-ahead for movement88- FOV changes for speed8990---9192## 5. Lighting9394### Light Types9596| Type | Use |97|------|-----|98| **Directional** | Sun, moon |99| **Point** | Lamps, torches |100| **Spot** | Flashlight, stage |101| **Ambient** | Base illumination |102103### Performance Consideration104105- Real-time shadows are expensive106- Bake when possible107- Shadow cascades for large worlds108109---110111## 6. Level of Detail (LOD)112113### LOD Strategy114115| Distance | Model |116|----------|-------|117| Near | Full detail |118| Medium | 50% triangles |119| Far | 25% or billboard |120121---122123## 7. Anti-Patterns124125| ❌ Don't | ✅ Do |126|----------|-------|127| Mesh colliders everywhere | Simple shapes |128| Real-time shadows on mobile | Baked or blob shadows |129| One LOD for all distances | Distance-based LOD |130| Unoptimized shaders | Profile and simplify |131132---133134> **Remember:** 3D is about illusion. Create the impression of detail, not the detail itself.135136## When to Use137This skill is applicable to execute the workflow or actions described in the overview.138139## Limitations140- Use this skill only when the task clearly matches the scope described above.141- Do not treat the output as a substitute for enprojectnment-specific validation, testing, or expert review.142- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.