Files
2nd/10_Wiki/Topic_Programming/AI_and_ML/LOD.md
T
Antigravity Agent 9148c358d0 docs(10_Wiki): 위키 전체 재구성 — Topic_* 폴더를 4개 카테고리로 통합 + 대규모 중복 제거
Topic_Agent/Topic_Blog/Topics/Topics_Biz/Topics_Meeting/Topics_Rag의 마크다운 지식 문서를
Topic_General/Topic_Programming/Topic_Graphic/Topic_Business 4개 카테고리로 재분류.

- 중복 제거: frontmatter의 status:duplicate/merged + duplicate_of/redirect_to 필드로
  자기 자신을 중복으로 선언한 리다이렉트 stub 1032개 제거, 완전 동일 내용 파일 472개 제거,
  동일 파일명·다른 내용 충돌 시 더 큰(완전한) 버전만 유지(162개 제거) — 총 1639개 중복 제거.
- 분류: 폴더 단위로 명확한 항목(AI_and_ML/Coding/Architecture 등 → Programming,
  Comfyui/Visual_Effects → Graphic, Topics_Biz/Topics_Meeting/사업 등 → Business,
  Poetic_Blog_Writing/창의성/Game_Design 등 → General)은 폴더 우선순위로,
  나머지 혼재 폴더(Topic_Agent/Topic_Blog/Topics 루트/Thinking & Reasoning/Other/UI_UX_Assets)는
  title/tags 키워드 스코어링으로 파일 단위 분류(불명확한 경우 General로 폴백).
  원본 폴더명은 "From_*" 서브폴더로 보존해 추적 가능성 유지.
- 최종 배치: Programming 2784 / General 1608 / Graphic 285 / Business 249 = 4926개 문서.
- 에이전트 운영 상태(.astra/.agent/.obsidian/sessions/memory/_company/docs/lessons/_shared/src)는
  지식 콘텐츠가 아니므로 재분류 대상에서 제외하고 원위치 유지.
- Topics/Topic_email(상위 보호 폴더 Topic_email과 파일명 100% 중복) 삭제 — 보호 폴더 자체는 미변경.
- 완전히 비게 된 Topic_Agent/Topic_Blog/Topics_Biz/Topics_Rag 폴더 제거.
2026-07-05 00:33:48 +09:00

4.8 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-lod LOD 10_Wiki/Topics verified self
Level of Detail
Mesh LOD
Mipmap
Nanite
none A 0.9 applied
3d
graphics
rendering
gamedev
optimization
unreal
unity
2026-05-10 pending
language framework
cpp unreal

LOD (Level of Detail)

매 한 줄

"매 멀면 단순, 가까우면 정밀". 거리/스크린 사이즈 기반으로 mesh, texture, shader 의 디테일을 단계적으로 낮춰 GPU 비용을 절감. 2026 현재 Unreal Nanite 가 mesh LOD 를 자동화하면서 표준이 변하는 중.

매 핵심

매 종류

  1. Mesh LOD (geometric): 폴리곤 수 다르게 (LOD0=원본, LOD3=단순화).
  2. Texture LOD (mipmap): 1/2, 1/4, 1/8 ... 미리 down-sample.
  3. Shader LOD: 거리 따라 PBR → unlit, 그림자 off.
  4. Imposter / Billboard: 매우 멀면 평면에 렌더된 이미지.
  5. Virtualized geometry (Nanite): per-pixel cluster 선택, 명시적 LOD 불필요.

매 전환 기준

  • 화면 면적 (screen-space pixel size).
  • 거리 (camera 와 object).
  • 시야각 / fov.
  • Hysteresis (왔다갔다 깜빡임 방지).

매 알고리즘

  • Mesh 단순화: Quadric Edge Collapse (Garland-Heckbert), Meshoptimizer.
  • Mipmap 생성: trilinear, anisotropic.
  • HLOD: 멀리 있는 여러 object 를 하나의 mesh 로 합침.

💻 패턴

Unity LODGroup

var lodGroup = gameObject.AddComponent<LODGroup>();
LOD[] lods = new LOD[] {
    new LOD(0.6f, new[] { lod0Renderer }),  // > 60% screen
    new LOD(0.3f, new[] { lod1Renderer }),
    new LOD(0.1f, new[] { lod2Renderer }),
    new LOD(0.01f, new[] { billboardRenderer }),
};
lodGroup.SetLODs(lods);
lodGroup.RecalculateBounds();

Unreal: StaticMesh LOD 자동 생성

// Editor 에서: StaticMesh -> LOD Settings -> Auto Compute
// 또는 Python:
mesh.set_editor_property("lod_group", "LargeProp")
mesh.build_from_mesh_descriptions(lod_descs)

meshoptimizer (cross-engine)

#include "meshoptimizer.h"
size_t target = (size_t)(index_count * 0.25f);  // 25%
float error;
size_t new_count = meshopt_simplify(
    new_indices, indices, index_count,
    &vertices[0].x, vertex_count, sizeof(Vertex),
    target, /*target_error*/ 0.05f, /*options*/ 0, &error);

Three.js LOD

import { LOD, Mesh } from "three";
const lod = new LOD();
lod.addLevel(meshHigh, 0);
lod.addLevel(meshMid, 50);
lod.addLevel(meshLow, 200);
lod.addLevel(billboard, 500);
scene.add(lod);
// 매 프레임 자동 update from camera distance

Mipmap 생성 (GL)

glBindTexture(GL_TEXTURE_2D, tex);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
glGenerateMipmap(GL_TEXTURE_2D);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);

Distance-based shader LOD (HLSL pseudo)

float dist = length(WorldPos - CameraPos);
if (dist < 50)        col = FullPBR(...);
else if (dist < 200)  col = SimplifiedPBR(...);
else                  col = AlbedoOnly(...);

Hysteresis 적용

float threshold = 50f;
float hyst = 5f;
if (state == LOD0 && dist > threshold + hyst) state = LOD1;
else if (state == LOD1 && dist < threshold - hyst) state = LOD0;

매 결정 기준

시나리오 전략
오픈월드 무수한 풀/돌 HLOD + imposter
캐릭터 (animation 있음) manual LOD0-2, skinning weight 보존
Unreal 5 hi-poly Nanite (자동)
모바일 적극적 LOD + mipmap, draw call 우선
VR (스테레오) 양 눈 모두 비싸니 LOD 더 공격적

기본값: Unreal 5 → Nanite 켜고 끝. 다른 엔진 → mesh LOD 3-4단계 + mipmap.

🔗 Graph

🤖 LLM 활용

언제: 폴리곤 많은 scene, 모바일/VR, 카메라 distance 변화 큼, 같은 prop 다수 instancing. 언제 X: UI/2D, scene 전체가 가까운 카메라 (LOD 전환 안 일어남).

안티패턴

  • LOD 전환 popping: 단계 차이 크고 hysteresis 없음 → 깜빡거림.
  • Skinning 메쉬 강제 단순화: deformation 깨짐, 캐릭터는 수작업.
  • Mipmap off: aliasing + bandwidth 폭증.
  • 너무 많은 LOD level: 메모리 낭비, 4단계 정도가 sweet spot.
  • Nanite 인 척하면서 모든 mesh translucent: Nanite 는 opaque 위주.

🧪 검증 / 중복

  • Unreal 5 Nanite docs, Unity LODGroup, meshoptimizer (zeux).
  • Garland & Heckbert 1997 (Quadric Error Metrics).
  • 신뢰도 A.

🕓 Changelog

날짜 변경
2026-05-08 Phase 1
2026-05-10 Manual cleanup — Nanite 반영, Unity/Unreal/Three.js/meshopt 패턴