f8b21af4be
10_Wiki/Topics 대규모 정리: - 오류 캡처/미완성 stub 문서 227개 제거 - 교차폴더 중복 43클러스터 병합 (63파일 → redirect) - 링크명 정규화: 깨진 링크 수정·redirect 직결·개념 매핑 ~2,400건 - 카테고리 MOC 6개 신규 생성 - Graph 섹션 미해결 related-keyword 링크 10,058건 제거 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
181 lines
5.4 KiB
Markdown
181 lines
5.4 KiB
Markdown
---
|
|
id: wiki-2026-0508-real-time-engine-rte
|
|
title: Real-Time Engine (RTE)
|
|
category: 10_Wiki/Topics
|
|
status: verified
|
|
canonical_id: self
|
|
aliases: [RTE, Real-Time Game Engine, Real-Time Rendering Engine]
|
|
duplicate_of: none
|
|
source_trust_level: A
|
|
confidence_score: 0.9
|
|
verification_status: applied
|
|
tags: [gamedev, rendering, engine, real-time]
|
|
raw_sources: []
|
|
last_reinforced: 2026-05-10
|
|
github_commit: pending
|
|
tech_stack:
|
|
language: cpp
|
|
framework: unreal-unity-bevy
|
|
---
|
|
|
|
# Real-Time Engine (RTE)
|
|
|
|
## 매 한 줄
|
|
> **"매 16ms (60fps) / 8ms (120fps) budget 매 frame 매 모든 sim+render"**. Unreal 5.5 / Unity 6 / Godot 4 / Bevy / O3DE — 매 2026 stack. 매 Nanite + Lumen + ML upscaling (DLSS 4, FSR 4) 매 default.
|
|
|
|
## 매 핵심
|
|
|
|
### 매 frame anatomy
|
|
- **Input** (~1ms): controller, mouse, network input.
|
|
- **Game tick** (1-3ms): AI, physics, gameplay scripts.
|
|
- **Animation** (1-2ms): skeletal blend, IK.
|
|
- **Render prep** (1-2ms): culling, batching.
|
|
- **GPU render** (5-10ms): shadows, GBuffer, lighting, post.
|
|
- **Present**: vsync / VRR.
|
|
|
|
### 매 subsystems
|
|
- **Renderer**: forward / deferred / clustered; raytracing + rasterization hybrid.
|
|
- **Physics**: PhysX, Jolt, Havok, Bullet — rigid + soft + cloth.
|
|
- **Audio**: Wwise, FMOD, MetaSound — spatial, ducking.
|
|
- **Networking**: replication, prediction, rollback netcode (GGPO).
|
|
- **Animation**: state machines, ML motion (Learned Motion Matching).
|
|
- **Streaming**: World Partition (UE5), addressables (Unity).
|
|
|
|
### 매 응용
|
|
1. AAA games (Fortnite UE5, Genshin Impact custom).
|
|
2. Cinematic / virtual production (LED wall, ICVFX).
|
|
3. Digital twins / sim (NVIDIA Omniverse).
|
|
4. ArchViz real-time (Twinmotion, Enscape).
|
|
5. Robotics sim (Isaac Sim, Unity ML-Agents).
|
|
|
|
## 💻 패턴
|
|
|
|
### Game loop (fixed + variable)
|
|
```cpp
|
|
double accumulator = 0.0;
|
|
constexpr double dt = 1.0 / 60.0;
|
|
while (running) {
|
|
double frameTime = std::min(clock.tick(), 0.25);
|
|
accumulator += frameTime;
|
|
while (accumulator >= dt) {
|
|
physics.step(dt); // fixed
|
|
accumulator -= dt;
|
|
}
|
|
double alpha = accumulator / dt;
|
|
render(state.interpolate(alpha)); // variable
|
|
}
|
|
```
|
|
|
|
### ECS — Bevy (Rust)
|
|
```rust
|
|
use bevy::prelude::*;
|
|
|
|
#[derive(Component)] struct Velocity(Vec3);
|
|
#[derive(Component)] struct Position(Vec3);
|
|
|
|
fn movement(mut q: Query<(&mut Position, &Velocity)>, time: Res<Time>) {
|
|
for (mut p, v) in &mut q {
|
|
p.0 += v.0 * time.delta_seconds();
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
App::new()
|
|
.add_plugins(DefaultPlugins)
|
|
.add_systems(Update, movement)
|
|
.run();
|
|
}
|
|
```
|
|
|
|
### Unity DOTS (Burst-compiled job)
|
|
```csharp
|
|
[BurstCompile]
|
|
partial struct MoveJob : IJobEntity {
|
|
public float DeltaTime;
|
|
void Execute(ref LocalTransform t, in Velocity v) {
|
|
t.Position += v.Value * DeltaTime;
|
|
}
|
|
}
|
|
```
|
|
|
|
### Unreal Engine (C++ actor tick)
|
|
```cpp
|
|
void AEnemy::Tick(float dt) {
|
|
Super::Tick(dt);
|
|
FVector toPlayer = Player->GetActorLocation() - GetActorLocation();
|
|
AddMovementInput(toPlayer.GetSafeNormal(), 1.0f);
|
|
}
|
|
```
|
|
|
|
### Render — compute shader (HLSL)
|
|
```hlsl
|
|
[numthreads(16, 16, 1)]
|
|
void CSMain(uint3 id : SV_DispatchThreadID) {
|
|
float3 normal = NormalTex[id.xy].xyz * 2.0 - 1.0;
|
|
float3 lightDir = normalize(LightPos - WorldPos[id.xy].xyz);
|
|
float ndl = saturate(dot(normal, lightDir));
|
|
Output[id.xy] = float4(Albedo[id.xy].rgb * ndl, 1);
|
|
}
|
|
```
|
|
|
|
### Rollback netcode (GGPO-style)
|
|
```cpp
|
|
// Save state every frame, rollback on input arrival
|
|
void onInputReceived(int frame, Input input) {
|
|
if (frame < currentFrame) {
|
|
loadState(frame);
|
|
for (int f = frame; f <= currentFrame; f++) {
|
|
simulate(f, getInputs(f));
|
|
}
|
|
}
|
|
}
|
|
```
|
|
|
|
### ML upscaling integration (DLSS 4 / FSR 4 — 2026)
|
|
```cpp
|
|
// Render at 1080p internal, upscale to 4K, frame-gen to 240fps
|
|
DLSSContext ctx;
|
|
ctx.initialize(width=1920, height=1080, target_w=3840, target_h=2160);
|
|
ctx.evaluate(colorIn, motionVectors, depth, jitter, colorOut);
|
|
```
|
|
|
|
## 매 결정 기준
|
|
| 상황 | Engine |
|
|
|---|---|
|
|
| 매 AAA, photoreal | Unreal 5.5 + Nanite/Lumen |
|
|
| 매 cross-platform indie | Unity 6 / Godot 4 |
|
|
| 매 Rust-native, ECS | Bevy |
|
|
| 매 mobile-first | Unity / Godot |
|
|
| 매 simulation / robotics | Isaac Sim / Omniverse |
|
|
| 매 fighting game | Custom + GGPO rollback |
|
|
| 매 multiplayer FPS | Unreal + Iris/Replication |
|
|
|
|
**기본값**: 매 unknown scope → Unreal 5.5 (free, AAA features). 매 indie → Godot 4.
|
|
|
|
## 🔗 Graph
|
|
- 부모: [[Real-time Rendering]]
|
|
- 변형: [[Unity]] · [[Bevy]]
|
|
- 응용: [[Digital Twin]]
|
|
- Adjacent: [[ECS]] · [[Nanite]] · [[Rollback Netcode]]
|
|
|
|
## 🤖 LLM 활용
|
|
**언제**: 매 shader scaffolding, 매 gameplay script generation (Blueprint → C++), 매 procedural content prompts. 매 Unreal Copilot / Unity Muse.
|
|
**언제 X**: 매 hot-path optimization — LLM 매 microarchitecture 매 weak. 매 profiler-driven manual.
|
|
|
|
## ❌ 안티패턴
|
|
- **GC in hot path**: 매 frame spike — pool / arena allocator.
|
|
- **Unbatched draw calls**: 매 1000+ per frame — instancing / Nanite.
|
|
- **Sync I/O on game thread**: 매 hitch. 매 async streaming.
|
|
- **Variable physics dt**: 매 nondeterministic — fixed timestep + interpolate.
|
|
- **No frame budgeting**: 매 unconstrained subsystem — profile + cap.
|
|
|
|
## 🧪 검증 / 중복
|
|
- Verified (Game Engine Architecture — Gregory 3rd ed; Unreal/Unity docs).
|
|
- 신뢰도 A.
|
|
|
|
## 🕓 Changelog
|
|
| 날짜 | 변경 |
|
|
|---|---|
|
|
| 2026-05-08 | Phase 1 |
|
|
| 2026-05-10 | Manual cleanup — full RTE entry with 2026 engines |
|