---
id: wiki-2026-0508-실시간-엔진-real-time-engine
title: 실시간 엔진 (Real-Time Engine)
category: 10_Wiki/Topics
status: verified
canonical_id: self
aliases: [Real-Time Engine, RTE, Game Engine, Realtime Rendering]
duplicate_of: none
source_trust_level: A
confidence_score: 0.9
verification_status: applied
tags: [game-engine, realtime, rendering, simulation]
raw_sources: []
last_reinforced: 2026-05-10
github_commit: pending
tech_stack:
  language: cpp
  framework: unreal-unity-godot
---

# 실시간 엔진 (Real-Time Engine)

## 매 한 줄
> **"매 RTE 는 매 매 프레임 (16.67ms @ 60Hz, 매 8.33ms @ 120Hz) 안에 매 simulation + render 매 완료해야 한다 — 매 deadline 매 hard"**. Gregory 의 매 *Game Engine Architecture* 가 매 canonical reference. 매 2026 modern engines: Unreal Engine 5.5 (Nanite, Lumen, MetaHuman), Unity 6 (HDRP, ECS/DOTS), Godot 4.4, Bevy (Rust ECS).

## 매 핵심

### 매 frame budget breakdown (60 Hz)
- Input poll: <1 ms
- Game logic / scripting: 2-4 ms
- Physics: 2-4 ms
- Animation / IK: 1-3 ms
- Render submit (CPU): 1-3 ms
- GPU render: 4-10 ms
- Total: <16.67 ms

### 매 core subsystems
- **Renderer**: scene graph, culling, rasterizer / RT.
- **Physics**: rigid body, soft body, character controller.
- **Audio**: 3D positional, mixing, DSP.
- **Animation**: skeletal, blend tree, state machine.
- **Networking**: client prediction, lag compensation.
- **Scripting / ECS**: gameplay code.
- **Asset pipeline**: import, baking, streaming.

### 매 응용
1. 매 game (AAA / indie / mobile).
2. 매 architecture viz / digital twin.
3. 매 VR / AR experience.
4. 매 simulation training.

## 💻 패턴

### Fixed timestep + interpolation (Glenn Fiedler)
```cpp
double accumulator = 0, t = 0;
const double dt = 1.0 / 60.0;
double prevTime = now();
while (running) {
    double curr = now();
    accumulator += curr - prevTime;
    prevTime = curr;
    while (accumulator >= dt) {
        physics.step(dt);
        accumulator -= dt;
    }
    double alpha = accumulator / dt;
    renderer.render(state.lerp(prev, alpha));
}
```

### ECS (Bevy 0.15, Rust)
```rust
#[derive(Component)] struct Position(Vec3);
#[derive(Component)] struct Velocity(Vec3);

fn movement(time: Res<Time>, mut q: Query<(&mut Position, &Velocity)>) {
    for (mut pos, vel) in &mut q {
        pos.0 += vel.0 * time.delta_seconds();
    }
}

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_systems(Update, movement)
        .run();
}
```

### Frustum culling (renderer)
```cpp
void cull(const Camera& cam, const std::vector<Renderable>& objs,
          std::vector<Renderable>& visible) {
    Frustum f = cam.frustum();
    for (const auto& o : objs)
        if (f.intersects(o.bounds)) visible.push_back(o);
}
```

### Spatial hash for broadphase
```cpp
class SpatialHash {
    std::unordered_map<int64_t, std::vector<EntityId>> cells;
    static constexpr float cellSize = 4.0f;
    static int64_t key(Vec3 p) {
        return ((int64_t)(p.x / cellSize) << 40)
             ^ ((int64_t)(p.y / cellSize) << 20)
             ^  (int64_t)(p.z / cellSize);
    }
public:
    void insert(EntityId id, Vec3 p) { cells[key(p)].push_back(id); }
    std::vector<EntityId> query(Vec3 p) { return cells[key(p)]; }
};
```

### Client prediction + reconciliation (netcode)
```typescript
class Client {
  pending: Input[] = [];
  onInput(i: Input) {
    this.applyLocal(i);
    this.send(i);
    this.pending.push(i);
  }
  onServerSnapshot(s: Snapshot) {
    this.state = s.state;
    this.pending = this.pending.filter(i => i.seq > s.lastAcked);
    for (const i of this.pending) this.applyLocal(i);
  }
}
```

### Unreal Lumen / Nanite usage (high-level config)
```cpp
// Project Settings → Rendering
// - Dynamic Global Illumination Method: Lumen
// - Reflection Method: Lumen
// - Shadow Method: Virtual Shadow Maps
// - Generate Mesh Distance Fields: enabled
// - Nanite-enabled meshes: import with "Build Nanite" checked
```

## 매 결정 기준
| Use case | Engine |
|---|---|
| 매 AAA / cinematic | Unreal Engine 5.5 |
| 매 mobile / 2D / cross-platform | Unity 6 |
| 매 open source / lightweight | Godot 4.4 |
| 매 data-oriented / Rust | Bevy |
| 매 web | three.js / Babylon.js |
| 매 simulation (no rendering) | custom + physics lib |

**기본값**: 매 Unreal 5.5 (high fidelity) / Unity 6 (productivity).

## 🔗 Graph
- 부모: [[Computer Graphics]]
- 변형: [[실시간 엔진 (RTE)]] (alias)
- 응용: [[Unity]] · [[Bevy]]
- Adjacent: [[ECS]] · [[Game Loop]] · [[Frustum Culling]]

## 🤖 LLM 활용
**언제**: 매 ECS architecture design / 매 shader explanation / 매 netcode pattern.
**언제 X**: 매 production shader / 매 critical-path code — 매 profile 기반 review.

## ❌ 안티패턴
- **Variable timestep physics**: 매 instability + 매 nondeterminism.
- **Single-threaded mainloop**: 매 modern multi-core 미활용.
- **No frame budget**: 매 random stutter / spike.
- **OOP-heavy hot path**: 매 cache miss / 매 ECS 매 미적용.

## 🧪 검증 / 중복
- Verified (Gregory, *Game Engine Architecture 4e*; Akenine-Möller et al., *Real-Time Rendering 5e*; Fiedler, *Fix Your Timestep*).
- 신뢰도 A.

## 🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — fixed-timestep / ECS / culling / netcode 패턴 추가 |
