Files
2nd/10_Wiki/Topics/Architecture/실시간_엔진_(Real-Time_Engine).md
T
koriweb d8a80f6272 chore(wiki): dangling 링크 canonical 정규화 (768파일/1200건)
이름만 다른(표기 변형) [[위키링크]]를 대상 문서의 canonical 제목으로 치환해
끊겼던 1,200개 링크를 연결. 제목/파일명 정규화 일치만 적용하고 별칭 매칭은
과병합 위험으로 제외(애매성 가드). 원본은 _link_reconcile_backup/ 에 백업.
도구: Datacollect/scripts/link_reconcile_apply.mjs

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-08 12:24:15 +09:00

5.3 KiB

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

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)

#[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)

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

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)

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)

// 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

🤖 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 패턴 추가