1---2name: 3d-games3description: "3D game development principles. Rendering, shaders, physics, cameras."4allowed-tools: Read, Write, Edit, Glob, Grep5risk: unknown6source: rootcastle-rei7metadata:8 source: https://skillmd.com/skills/rootcastleco/3d-games9---1011# 3D Game Development1213> Principles for 3D game systems.1415---1617## 1. Rendering Pipeline1819### Stages2021```221. Vertex Processing → Transform geometry232. Rasterization → Convert to pixels243. Fragment Processing → Color pixels254. Output → To screen26```2728### Optimization Principles2930| Technique | Purpose |31|-----------|---------|32| **Frustum culling** | Don't render off-screen |33| **Occlusion culling** | Don't render hidden |34| **LOD** | Less detail at distance |35| **Batching** | Combine draw calls |3637---3839## 2. Shader Principles4041### Shader Types4243| Type | Purpose |44|------|---------|45| **Vertex** | Position, normals |46| **Fragment/Pixel** | Color, lighting |47| **Compute** | General computation |4849### When to Write Custom Shaders5051- Special effects (water, fire, portals)52- Stylized rendering (toon, sketch)53- Performance optimization54- Unique visual identity5556---5758## 3. 3D Physics5960### Collision Shapes6162| Shape | Use Case |63|-------|----------|64| **Box** | Buildings, crates |65| **Sphere** | Balls, quick checks |66| **Capsule** | Characters |67| **Mesh** | Terrain (expensive) |6869### Principles7071- Simple colliders, complex visuals72- Layer-based filtering73- Raycasting for line-of-sight7475---7677## 4. Camera Systems7879### Camera Types8081| Type | Use |82|------|-----|83| **Third-person** | Action, adventure |84| **First-person** | Immersive, FPS |85| **Isometric** | Strategy, RPG |86| **Orbital** | Inspection, editors |8788### Camera Feel8990- Smooth following (lerp)91- Collision avoidance92- Look-ahead for movement93- FOV changes for speed9495---9697## 5. Lighting9899### Light Types100101| Type | Use |102|------|-----|103| **Directional** | Sun, moon |104| **Point** | Lamps, torches |105| **Spot** | Flashlight, stage |106| **Ambient** | Base illumination |107108### Performance Consideration109110- Real-time shadows are expensive111- Bake when possible112- Shadow cascades for large worlds113114---115116## 6. Level of Detail (LOD)117118### LOD Strategy119120| Distance | Model |121|----------|-------|122| Near | Full detail |123| Medium | 50% triangles |124| Far | 25% or billboard |125126---127128## 7. Anti-Patterns129130| ❌ Don't | ✅ Do |131|----------|-------|132| Mesh colliders everywhere | Simple shapes |133| Real-time shadows on mobile | Baked or blob shadows |134| One LOD for all distances | Distance-based LOD |135| Unoptimized shaders | Profile and simplify |136137---138139> **Remember:** 3D is about illusion. Create the impression of detail, not the detail itself.140141## When to Use142This skill is applicable to execute the workflow or actions described in the overview.143144---145146> 🏰 **Rei Skills** — Curated by [Rootcastle Engineering & Innovation](https://www.rootcastle.com) | Batuhan Ayrıbaş 147> Engineering Beyond Boundaries | admin@rootcastle.com