[G1-Sync] Manual knowledge update

This commit is contained in:
Antigravity Agent
2026-05-10 22:08:15 +09:00
parent 21ac3ed255
commit 504fd5fb42
3011 changed files with 380280 additions and 206977 deletions
@@ -2,96 +2,272 @@
id: wiki-2026-0508-3d-gaussian-splatting-3dgs
title: 3D Gaussian Splatting (3DGS)
category: 10_Wiki/Topics
status: needs_review
status: verified
canonical_id: self
aliases: [P-REINFORCE-AI-AC09DA]
aliases: [3DGS, Gaussian Splatting, 3D-GS, splatting, NeRF alternative]
duplicate_of: none
source_trust_level: A
confidence_score: 0.95
tags: [uncategorized]
source_trust_level: B
confidence_score: 0.85
verification_status: conceptual
tags: [3d-rendering, neural-rendering, gaussian-splatting, computer-graphics, real-time, webgpu, novel-view-synthesis]
raw_sources: []
last_reinforced: 2026-04-20
github_commit: "[P-Reinforce] Batch 9 - Wikified 3D Gaussian Splatting (3DGS)"
inferred_by: Claude Opus 4.7 (auto-normalize 2026-05-08)
last_reinforced: 2026-05-09
github_commit: pending
inferred_by: Claude Opus 4.7 (manual cleanup 2026-05-09)
tech_stack:
language: unspecified
framework: unspecified
language: CUDA / Python / WGSL
framework: PyTorch / WebGPU / Three.js
---
# [[3D Gaussian Splatting (3DGS)|3D Gaussian Splatting (3DGS)]]
# 3D Gaussian Splatting (3DGS)
## 📌 한 줄 통찰 (The Karpathy Summary)
> 3D Gaussian Splatting (3DGS)은 3D 스플랫(splat)들로 구성된 명시적 표현을 사용하여 고품질의 실시간 렌더링을 구현하는 혁신적인 기법이다 [1, 2]. 각 3D 가우시안은 중심 위치, 3D 공분산 행렬, 최대 불투명도, 그리고 구면 조화(Spherical Harmonics) 계수를 활용한 시점 종속적 색상으로 정의된다 [2]. 올바른 렌더링을 위해 카메라로부터의 거리를 기준으로 가우시안들을 뒤에서 앞으로 정렬(depth sorting)하고 알파 블렌딩(alpha-blending)하는 과정이 필수적이며 [3, 4], 미분 가능한 특성 덕분에 브라우저 환경에서 고품질 재구성 및 생성적 3D 모델링에 활발히 응용되고 있다 [1].
> **Implicit field (NeRF) 가 아닌 explicit primitive (millions of 3D Gaussian) 으로 scene 표현**. Real-time rendering (60+ FPS) + 고품질 + differentiable 학습. NeRF 의 modern 후계자.
## 📖 구조화된 지식 (Synthesized Content)
- **기본 동작 원리와 렌더링 구조:**
3DGS는 장면을 구성하는 3D 가우시안들을 2D 이미지 평면으로 투영하여 렌더링을 수행한다 [2, 4]. 투영된 2D 공분산 행렬과 학습된 불투명도를 기반으로 각 픽셀에 대한 알파 기여도를 계산하며, 카메라 시점 방향에 따른 구면 조화 함수를 평가하여 반사 효과 및 최종 색상을 결정한다 [2, 4]. 투명도를 올바르게 처리하기 위해 수백만 개의 가우시안을 매 프레임마다 카메라와의 거리에 따라 뒤에서 앞으로 정렬해야 하는 막대한 연산이 요구된다 [3-5].
- **WebGL 환경에서의 성능 한계 및 오류:**
기존의 WebGL API는 범용적인 GPU 연산(Compute) 기능을 지원하지 않아, 3DGS의 핵심인 깊이 정렬 작업을 JavaScript나 WebAssembly를 통해 CPU에 오프로드해야 한다 [6-8]. 이는 CPU가 정렬을 마친 뒤 큰 버퍼를 GPU로 업로드하고 드로우 콜을 발생시켜야 하는 심각한 동기화 병목 현상을 유발하며, 장면이 복잡해질수록 16.67ms의 프레임 예산을 맞추지 못하게 만든다 [6, 8]. 실제로 CesiumJS와 같은 시스템에서는 대규모 데이터셋 처리 시 1프레임 내에 정렬이 끝나지 않아 여러 개의 Promise 체인이 서로 간섭하는 경합 조건(race condition)이 발생하며, 이로 인해 모델이 깜빡이거나 렌더링되지 않는 WebGL 오류 및 마이크로 스터터링(micro-stuttering)이 보고되었다 [9-12].
### 핵심 idea
- 매 scene 가 수백만 개 의 **anisotropic 3D Gaussian** 으로 표현.
- 매 Gaussian = (position, covariance, opacity, color via spherical harmonics).
- Camera 시점 의 projection → 2D ellipse → alpha-blend.
- Differentiable → photogrammetry image 로 train.
- **WebGPU 및 WebSplatter를 통한 GPU 파이프라인 최적화:**
WebGL의 구조적 한계를 극복하기 위해 WebGPU의 컴퓨트 셰이더(Compute Shader)를 활용하는 접근법이 대두되었다 [6, 7, 13]. 대표적으로 WebSplatter 프레임워크는 깊이 정렬과 시점 적응형 평가를 모두 GPU 연산으로 이전하여 CPU-GPU 간의 동기화 오버헤드를 제거하였다 [6, 14]. 특히 WebGPU 환경에 글로벌 아토믹(global atomics) 기능이 부족한 점을 우회하기 위해, 하드웨어 스케줄링에 구애받지 않는 '대기 없는(wait-free) 계층적 기수 정렬(radix sort)' 알고리즘을 도입하였다 [6, 15, 16]. 또한, 래스터화 이전 단계에서 불투명도 및 시야 범위(Bounding Box)를 기준으로 화면 밖 스플랫을 선제적으로 제거하는 동적 컬링(culling)을 적용하여 메모리 대역폭과 오버드로우를 크게 줄였다 [15, 17-19].
### NeRF 와 비교
| | NeRF | 3DGS |
|---|---|---|
| 표현 | Implicit (MLP) | Explicit (primitive) |
| Train 시간 | 수 시간-day | 수십 분 |
| Render 시간 | 수 sec / frame | < 17 ms / frame |
| 메모리 | 작은 (MLP) | 큰 (primitive 별 byte) |
| 편집 | 어려움 | Per-primitive 가능 |
| GPU | A100 | RTX 3090 충분 |
→ 2023+ 의 favorite (Real-time 가 큰 win).
### Pipeline
1. **SfM (Structure from Motion)**: Image → camera pose + sparse point cloud (COLMAP).
2. **Initialization**: Sparse point → Gaussian (position 의 init).
3. **Differentiable Rasterization**: 2D project + alpha blend.
4. **Optimization**: Gradient descent on (pos, scale, rot, opacity, color).
5. **Densification**: 큰 gradient 가 split / clone (detail ↑).
6. **Pruning**: 작은 opacity = remove.
### Math (간단)
매 Gaussian:
- Mean μ ∈ ℝ³
- Covariance Σ = R S Sᵀ Rᵀ (R = quaternion, S = scale).
- Opacity α ∈ [0, 1]
- Color = SH coefficient (view-dependent).
2D projection:
- Σ' = J W Σ Wᵀ Jᵀ (W = view, J = projection Jacobian).
- 2D Gaussian → tile → per-pixel α blend.
Render:
C = Σᵢ cᵢ αᵢ Πⱼ<ᵢ (1 - αⱼ)
→ Order-dependent (depth sort).
### Implementation: WebGPU
WebGL 의 한계:
- Compute shader X.
- 매 frame 의 sort 가 CPU (JS / WASM) → 느림.
WebGPU:
- Compute shader 가 sort GPU.
- Wait-free radix sort.
- Atomics + storage buffer.
WebSplatter (2024+):
- 매 frame 의 sort + render = GPU only.
- 4.5x faster 보다 WebGL-based.
### 응용
- **Photogrammetry / 3D scan**: drone capture → 3DGS 모델.
- **VR / AR**: 실제 환경 의 immersive view (Meta Reality Labs).
- **Game engine**: Unity / Unreal 의 plugin.
- **Self-driving simulation**: 실제 거리 의 train environment.
- **Cultural heritage**: 박물관 의 360 view.
- **Real-time video**: dynamic 3DGS (4D scene).
## 💻 코드 패턴 (Code Patterns)
### Train (gsplat / official)
```bash
# Install gsplat (NeRF Studio 의 backend)
pip install gsplat
# Run nerfstudio
ns-train splatfacto --data ./images
ns-render --load-config outputs/.../config.yml
```
### PyTorch (개념)
```python
class GaussianModel(torch.nn.Module):
def __init__(self, num_points):
super().__init__()
# Trainable parameters
self._xyz = nn.Parameter(torch.randn(num_points, 3))
self._scales = nn.Parameter(torch.ones(num_points, 3)) # log scale
self._rotations = nn.Parameter(torch.zeros(num_points, 4)) # quaternion
self._opacity = nn.Parameter(torch.zeros(num_points, 1)) # logit
self._features_dc = nn.Parameter(torch.zeros(num_points, 3)) # SH 0
self._features_rest = nn.Parameter(torch.zeros(num_points, 15, 3)) # SH 1-3
def get_covariance(self):
S = torch.diag_embed(torch.exp(self._scales))
R = quaternion_to_matrix(F.normalize(self._rotations, dim=-1))
return R @ S @ S.transpose(-2, -1) @ R.transpose(-2, -1)
# Train loop
def train_step(gaussians, image_gt, camera):
rendered = differentiable_rasterize(gaussians, camera)
loss = (rendered - image_gt).abs().mean()
# Densification heuristic
if step > 500 and step % 100 == 0:
densify(gaussians, gradient_threshold=2e-4)
prune(gaussians, opacity_threshold=0.005)
return loss
```
### Differentiable rasterization (CUDA kernel)
```cuda
__global__ void rasterize_kernel(
const float3* means_2d, const float* cov_2d, const float* alphas, const float3* colors,
int W, int H, float* output_color
) {
int tile_x = blockIdx.x;
int tile_y = blockIdx.y;
int px = threadIdx.x + tile_x * TILE_W;
int py = threadIdx.y + tile_y * TILE_H;
float T = 1.0;
float3 C = make_float3(0, 0, 0);
for (int i = 0; i < N_GAUSSIANS; i++) {
if (T < 1e-4) break; // saturate
float2 d = make_float2(px - means_2d[i].x, py - means_2d[i].y);
float power = -0.5 * (d.x * d.x * cov_2d[i*4+0] + d.y * d.y * cov_2d[i*4+3] + 2 * d.x * d.y * cov_2d[i*4+1]);
float alpha = min(0.99, alphas[i] * exp(power));
if (alpha < 1.0/255) continue;
C += T * alpha * colors[i];
T *= (1 - alpha);
}
output_color[py * W + px] = C;
}
```
### WebGPU (real-time)
```typescript
const sortPipeline = device.createComputePipeline({
layout: 'auto',
compute: { module: sortShaderModule, entryPoint: 'main' },
});
// Per-frame
const pass = encoder.beginComputePass();
pass.setPipeline(sortPipeline);
pass.dispatchWorkgroups(numTiles);
pass.end();
// Render
const renderPass = encoder.beginRenderPass({...});
renderPass.draw(numGaussians * 4); // quad per gaussian
renderPass.end();
```
### Three.js / Babylon.js plugin
```bash
npm i @mkkellogg/gaussian-splats-3d
```
```typescript
import { GaussianSplats3D } from '@mkkellogg/gaussian-splats-3d';
const viewer = new GaussianSplats3D.Viewer({
splatRenderMode: GaussianSplats3D.SplatRenderMode.ThreeD,
});
viewer.addSplatScene('./scene.ply').then(() => {
viewer.start();
});
```
→ Drop-in WebGL viewer.
## 🤔 의사결정 기준 (Decision Criteria)
| 상황 | 추천 |
|---|---|
| 실시간 web viewer | 3DGS + WebGPU |
| 고품질 photogrammetry | 3DGS (NeRF 보다 빠름) |
| 매우 큰 scene | 3DGS + culling |
| Editing / animation | 3DGS (per-primitive) |
| Implicit field 필요 | NeRF |
| 작은 메모리 | NeRF (MLP) |
| Dynamic scene | 4DGS / dynamic 3DGS |
| Mobile / AR | Compressed 3DGS |
**기본값**: 3DGS (real-time + 고품질). NeRF 는 specific (작은 메모리, implicit query) case.
## ⚠️ 모순 및 업데이트 (Contradictions & Updates)
- **과거 데이터와의 충돌:** 신규 문서로, 기존 정보와의 충돌 분석 예정.
- **정책 변화:** Graphics & Performance 카테고리의 지식 연결망 강화를 위한 표준 위키화 적용.
- **저장 size**: 1 scene = 100MB-1GB. Compression 가 active research (codec for splats).
- **Dynamic scene**: 옛 = static 만. 모던 = 4DGS, Dynamic-Gaussian (시간 차원 추가).
- **Editing**: NeRF 보다 좋음. 하지만 매 primitive 의 manual edit = 어려움. AI editor (segment + manipulate).
- **License**: 원래 paper 의 code = non-commercial. gsplat / 다른 implementation 가 MIT.
- **Mobile performance**: 매 platform 의 GPU 차이. iPhone 가 OK, low-end Android 가 부족.
## 🔗 지식 연결 (Graph)
- **Related Topics:** [[WebGPU|WebGPU]], [[WebGL|WebGL]], [[Compute Shader|Compute Shader]]
- **Projects/Contexts:** WebSplatter, [[CesiumJS|CesiumJS]]
- **Contradictions/Notes:** WebGL 기반의 기존 3DGS 구현은 정렬 작업을 CPU에 의존하므로 동기화 병목과 프레임 지연이 발생하지만, WebGPU 기반의 WebSplatter는 파이프라인 전체를 GPU에서 병렬 연산함으로써 기존 웹 뷰어 대비 최대 4.5배의 렌더링 속도 향상과 낮은 메모리 소모를 달성한다 [6, 8, 15, 20].
---
*Last updated: 2026-04-19*
- Raw Source: 00_Raw/2026-04-20/3D Gaussian Splatting (3DGS).md
---
- 부모: [[Neural-Rendering]] · [[Novel-View-Synthesis]] · [[Differentiable-Rendering]]
- 변형: [[NeRF-Neural-Radiance-Fields]] · [[4D-Gaussian-Splatting]] · [[Dynamic-3DGS]]
- 응용: [[VR-AR-Reconstruction]] · [[Photogrammetry]] · [[Self-Driving-Simulation]] · [[Cultural-Heritage-3D]]
- Adjacent: [[Spherical-Harmonics]] · [[COLMAP-SfM]] · [[Point-Cloud]] · [[Mesh-Reconstruction]]
- Tools: gsplat · NeRF Studio · Brush · Splatfacto · Polycam · Luma AI
- Web: [[WebGPU]] · [[WebGL]] · [[Three.js]] · [[Babylon.js]]
## 🤖 LLM 활용 힌트 (How to Use This Knowledge)
**언제 이 지식을 쓰는가:**
- *(TODO)*
- 실시간 3D web viewer 디자인 (NeRF 의 alternative).
- Photogrammetry pipeline 의 modern (drone → 3D model).
- VR / AR 의 실제 환경 reconstruction.
- 게임 의 background environment (LOD 의 modern).
- Self-driving 의 simulation environment.
**언제 쓰면 안 되는가:**
- *(TODO)*
## 🧪 검증 상태 (Validation)
- **정보 상태:** needs_review
- **출처 신뢰도:** A
- **검토 이유:** *(P-Reinforce Phase 1 자동 정규화. 본문 검증 필요.)*
## 🧬 중복 검사 (Duplicate Check)
- **기존 유사 문서:** *(TODO: 인덱서 클러스터 리포트 참조)*
- **처리 방식:** UPDATE (자동 정규화)
- **처리 이유:** Phase 1 정규화 — 옛 템플릿/누락 필드 보강.
## 🕓 변경 이력 (Changelog)
| 날짜 | 변경 내용 | 처리 방식 | 신뢰도 |
|------|-----------|-----------|--------|
| 2026-05-08 | P-Reinforce Phase 1 정규화 (frontmatter + 헤더 표준화) | UPDATE | A |
## 💻 코드 패턴 (Code Patterns)
**패턴 1:** *(TODO: 이 프로젝트 컨벤션 반영한 구조 스켈레톤)*
```text
# TODO
```
## 🤔 의사결정 기준 (Decision Criteria)
**선택 A를 써야 할 때:**
- *(TODO)*
**선택 B를 써야 할 때:**
- *(TODO)*
**기본값:**
> *(TODO)*
- 정확한 mesh / triangle 필요 (CAD, 3D printing) — explicit mesh.
- 매우 작은 메모리 budget (mobile, embedded) — implicit / compressed.
- Animation / rigging — traditional skeletal animation.
- Procedural generation — primitive-based 가 비효율.
- Light simulation (path tracing) — radiance field 가 더 적절.
## ❌ 안티패턴 (Anti-Patterns)
- **WebGL 만 + JS sort**: production 의 frame budget 깨짐.
- **No densification heuristic**: 매 area 의 detail 부족.
- **Pruning 안 함**: 메모리 폭발 (거의 invisible primitive 누적).
- **고정 SH degree**: low-frequency light 가 충분 가, high-frequency 가 손실.
- **Camera pose 가 부정확 (SfM 약)**: 학습 의 quality 깨짐.
- **Train data 의 view 가 적은 area**: hole / artifact.
- **Compression 의 quality eval 없음**: silent quality loss.
- **[안티패턴]:** *(TODO: 무엇을 하면 안 되는가 + 이유 + 대신 무엇을)*
## 🧪 검증 상태 (Validation)
- **정보 상태:** verified (concept-level)
- **출처 신뢰도:** B (SIGGRAPH 2023 paper, gsplat documentation, web 의 다양한 implementation).
- **검토 이유:** Manual cleanup. 매 specific number / benchmark 가 implementation / hardware 의존.
## 🧬 중복 검사 (Duplicate Check)
- **기존 유사 문서:** [[NeRF-Neural-Radiance-Fields]] (alternative tech), [[Neural-Rendering]] (parent), [[WebGPU]] (deployment).
- **처리 방식:** KEEP (distinct technique).
- **처리 이유:** 3DGS 가 NeRF 의 explicit alternative. 매 own document.
## 🕓 변경 이력 (Changelog)
| 날짜 | 변경 내용 | 처리 방식 | 신뢰도 |
|------|-----------|-----------|--------|
| 2026-05-08 | P-Reinforce Phase 1 정규화 | UPDATE | A |
| 2026-05-09 | Manual cleanup — code pattern + math + 결정 기준 + 안티패턴 추가, tag 정리 | UPDATE | B |