--- id: wiki-2026-0508-3d-gaussian-splatting-3dgs title: 3D Gaussian Splatting (3DGS) category: 10_Wiki/Topics status: verified canonical_id: self aliases: [3DGS, Gaussian Splatting, 3D-GS, splatting, NeRF alternative] duplicate_of: none 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-05-09 github_commit: pending inferred_by: Claude Opus 4.7 (manual cleanup 2026-05-09) tech_stack: language: CUDA / Python / WGSL framework: PyTorch / WebGPU / Three.js --- # 3D Gaussian Splatting (3DGS) ## πŸ“Œ ν•œ 쀄 톡찰 (The Karpathy Summary) > **Implicit field (NeRF) κ°€ μ•„λ‹Œ explicit primitive (millions of 3D Gaussian) 으둜 scene ν‘œν˜„**. Real-time rendering (60+ FPS) + κ³ ν’ˆμ§ˆ + differentiable ν•™μŠ΅. NeRF 의 modern ν›„κ³„μž. ## πŸ“– κ΅¬μ‘°ν™”λœ 지식 (Synthesized Content) ### 핡심 idea - λ§€ scene κ°€ 수백만 개 의 **anisotropic 3D Gaussian** 으둜 ν‘œν˜„. - λ§€ Gaussian = (position, covariance, opacity, color via spherical harmonics). - Camera μ‹œμ  의 projection β†’ 2D ellipse β†’ alpha-blend. - Differentiable β†’ photogrammetry image 둜 train. ### 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) - **μ €μž₯ 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) - Adjacent: [[Point-Cloud]] - Tools: gsplat Β· NeRF Studio Β· Brush Β· Splatfacto Β· Polycam Β· Luma AI - Web: [[WebGPU]] Β· [[WebGL]] Β· [[Three.js]] Β· [[Babylonjs]] ## πŸ€– LLM ν™œμš© 힌트 (How to Use This Knowledge) **μ–Έμ œ 이 지식을 μ“°λŠ”κ°€:** - μ‹€μ‹œκ°„ 3D web viewer λ””μžμΈ (NeRF 의 alternative). - Photogrammetry pipeline 의 modern (drone β†’ 3D model). - VR / AR 의 μ‹€μ œ ν™˜κ²½ reconstruction. - κ²Œμž„ 의 background environment (LOD 의 modern). - Self-driving 의 simulation environment. **μ–Έμ œ μ“°λ©΄ μ•ˆ λ˜λŠ”κ°€:** - μ •ν™•ν•œ 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. ## πŸ§ͺ 검증 μƒνƒœ (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 | ## πŸ”— κ΄€λ ¨ λ¬Έμ„œ (μžλ™ μ—°κ²°) - [[Aerospace Flight Simulation]]