3D Game Development
Principles for 3D game systems.
1. Rendering Pipeline
Stages
1. Vertex Processing → Transform geometry
2. Rasterization → Convert to pixels
3. Fragment Processing → Color pixels
4. Output → To screen
Optimization Principles
| Technique |
Purpose |
| Frustum culling |
Don't render off-screen |
| Occlusion culling |
Don't render hidden |
| LOD |
Less detail at distance |
| Batching |
Combine draw calls |
2. Shader Principles
Shader Types
| Type |
Purpose |
| Vertex |
Position, normals |
| Fragment/Pixel |
Color, lighting |
| Compute |
General computation |
When to Write Custom Shaders
- Special effects (water, fire, portals)
- Stylized rendering (toon, sketch)
- Performance optimization
- Unique visual identity
3. 3D Physics
Collision Shapes
| Shape |
Use Case |
| Box |
Buildings, crates |
| Sphere |
Balls, quick checks |
| Capsule |
Characters |
| Mesh |
Terrain (expensive) |
Principles
- Simple colliders, complex visuals
- Layer-based filtering
- Raycasting for line-of-sight
4. Camera Systems
Camera Types
| Type |
Use |
| Third-person |
Action, adventure |
| First-person |
Immersive, FPS |
| Isometric |
Strategy, RPG |
| Orbital |
Inspection, editors |
Camera Feel
- Smooth following (lerp)
- Collision avoidance
- Look-ahead for movement
- FOV changes for speed
5. Lighting
Light Types
| Type |
Use |
| Directional |
Sun, moon |
| Point |
Lamps, torches |
| Spot |
Flashlight, stage |
| Ambient |
Base illumination |
Performance Consideration
- Real-time shadows are expensive
- Bake when possible
- Shadow cascades for large worlds
6. Level of Detail (LOD)
LOD Strategy
| Distance |
Model |
| Near |
Full detail |
| Medium |
50% triangles |
| Far |
25% or billboard |
7. Anti-Patterns
| ❌ Don't |
✅ Do |
| Mesh colliders everywhere |
Simple shapes |
| Real-time shadows on mobile |
Baked or blob shadows |
| One LOD for all distances |
Distance-based LOD |
| Unoptimized shaders |
Profile and simplify |
Remember: 3D is about illusion. Create the impression of detail, not the detail itself.
When to Use
3D game development principles. Rendering, shaders, physics, cameras.
Covers: 3D Game Development, Rendering Pipeline, Stages, Optimization Principles, Shader Principles.
1---2name: 3d-games3description: 3D game development principles. Rendering, shaders, physics, cameras.4allowed-tools: Read, Write, Edit, Glob, Grep5risk: safe6source: community7license: MIT8metadata:9 source: https://skillmd.com/skills/jantoniofc/3d-games10---1112# 3D Game Development1314> Principles for 3D game systems.1516---1718## 1. Rendering Pipeline1920### Stages2122```231. Vertex Processing → Transform geometry242. Rasterization → Convert to pixels253. Fragment Processing → Color pixels264. Output → To screen27```2829### Optimization Principles3031| Technique | Purpose |32|-----------|---------|33| **Frustum culling** | Don't render off-screen |34| **Occlusion culling** | Don't render hidden |35| **LOD** | Less detail at distance |36| **Batching** | Combine draw calls |3738---3940## 2. Shader Principles4142### Shader Types4344| Type | Purpose |45|------|---------|46| **Vertex** | Position, normals |47| **Fragment/Pixel** | Color, lighting |48| **Compute** | General computation |4950### When to Write Custom Shaders5152- Special effects (water, fire, portals)53- Stylized rendering (toon, sketch)54- Performance optimization55- Unique visual identity5657---5859## 3. 3D Physics6061### Collision Shapes6263| Shape | Use Case |64|-------|----------|65| **Box** | Buildings, crates |66| **Sphere** | Balls, quick checks |67| **Capsule** | Characters |68| **Mesh** | Terrain (expensive) |6970### Principles7172- Simple colliders, complex visuals73- Layer-based filtering74- Raycasting for line-of-sight7576---7778## 4. Camera Systems7980### Camera Types8182| Type | Use |83|------|-----|84| **Third-person** | Action, adventure |85| **First-person** | Immersive, FPS |86| **Isometric** | Strategy, RPG |87| **Orbital** | Inspection, editors |8889### Camera Feel9091- Smooth following (lerp)92- Collision avoidance93- Look-ahead for movement94- FOV changes for speed9596---9798## 5. Lighting99100### Light Types101102| Type | Use |103|------|-----|104| **Directional** | Sun, moon |105| **Point** | Lamps, torches |106| **Spot** | Flashlight, stage |107| **Ambient** | Base illumination |108109### Performance Consideration110111- Real-time shadows are expensive112- Bake when possible113- Shadow cascades for large worlds114115---116117## 6. Level of Detail (LOD)118119### LOD Strategy120121| Distance | Model |122|----------|-------|123| Near | Full detail |124| Medium | 50% triangles |125| Far | 25% or billboard |126127---128129## 7. Anti-Patterns130131| ❌ Don't | ✅ Do |132|----------|-------|133| Mesh colliders everywhere | Simple shapes |134| Real-time shadows on mobile | Baked or blob shadows |135| One LOD for all distances | Distance-based LOD |136| Unoptimized shaders | Profile and simplify |137138---139140> **Remember:** 3D is about illusion. Create the impression of detail, not the detail itself.141142## When to Use1431443D game development principles. Rendering, shaders, physics, cameras.145146Covers: 3D Game Development, Rendering Pipeline, Stages, Optimization Principles, Shader Principles.