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>
153 lines
5.3 KiB
Markdown
153 lines
5.3 KiB
Markdown
---
|
|
id: wiki-2026-0508-guilty-gear-xrd-rendering-pipeli
|
|
title: Guilty Gear Xrd Rendering Pipeline
|
|
category: 10_Wiki/Topics
|
|
status: verified
|
|
canonical_id: self
|
|
aliases: [Xrd Toon Shading, Arc System Works Anime Render, Guilty Gear Cel Shading]
|
|
duplicate_of: none
|
|
source_trust_level: A
|
|
confidence_score: 0.9
|
|
verification_status: applied
|
|
tags: [graphics, cel-shading, npr, anime, arc-system-works]
|
|
raw_sources: []
|
|
last_reinforced: 2026-05-10
|
|
github_commit: pending
|
|
tech_stack:
|
|
language: hlsl
|
|
framework: unreal-engine
|
|
---
|
|
|
|
# Guilty Gear Xrd Rendering Pipeline
|
|
|
|
## 매 한 줄
|
|
> **"매 3D model 을 매 2D anime 처럼 보이게 매 render — 매 artist control 이 매 algorithm 보다 매 우선."**. Arc System Works (Junya C. Motomura, GDC 2014) 의 매 Xrd 파이프라인은 매 NPR (non-photorealistic rendering) 의 매 landmark. 매 hand-painted normal + custom shadow + ink line + post-processing 의 매 stack.
|
|
|
|
## 매 핵심
|
|
|
|
### 매 Pipeline stage
|
|
1. **Modeling**: 매 low-poly model + 매 hand-tuned vertex normal.
|
|
2. **Base color shading**: 매 ramp texture (1D LUT) — 매 toon step.
|
|
3. **Custom shadow direction**: 매 light vector 무시 + 매 artist 가 매 manual paint.
|
|
4. **Outline (ink line)**: 매 inverted hull / 매 post-process edge.
|
|
5. **Specular & rim**: 매 hand-placed highlight texture.
|
|
6. **Post-processing**: 매 chromatic aberration, 매 bloom, 매 color grading.
|
|
|
|
### 매 Vertex normal trick
|
|
- 매 face 의 매 normal 을 매 sphere 로 매 매뉴얼 average — 매 2D 에서 매 깔끔한 shadow shape.
|
|
- 매 hair 는 매 normal 을 매 head 의 매 center 로 매 향하게 — 매 anisotropic specular 의 매 illusion.
|
|
|
|
### 매 Ramp texture
|
|
- 1D texture, 매 N·L → matrix lookup. 매 step 2-3 단계 — 매 hard edge.
|
|
- 매 character 별 매 다른 ramp — 매 다른 mood.
|
|
|
|
### 매 Outline
|
|
- **Backface inverted hull**: 매 model 을 매 normal 방향 outward extrude + cull front. 매 cheap, 매 thickness 균일.
|
|
- **Vertex color mask**: 매 detail line 의 매 thickness 제어.
|
|
|
|
### 매 응용
|
|
1. Anime fighting game (Dragon Ball FighterZ, Granblue Versus 도 매 변형).
|
|
2. Mobile RPG (Genshin Impact 의 매 cel).
|
|
3. VTuber rendering.
|
|
|
|
## 💻 패턴
|
|
|
|
### Toon shader (HLSL)
|
|
```hlsl
|
|
float NdotL = saturate(dot(normalize(worldNormal), lightDir));
|
|
float ramp = tex2D(_RampTex, float2(NdotL, 0.5)).r;
|
|
float3 base = tex2D(_MainTex, uv).rgb;
|
|
float3 col = base * lerp(_ShadowColor, 1.0, ramp);
|
|
return float4(col, 1);
|
|
```
|
|
|
|
### Inverted hull outline
|
|
```hlsl
|
|
// Vertex pass — render with cull = Front
|
|
float3 normalWS = TransformObjectToWorldNormal(IN.normal);
|
|
float3 posWS = TransformObjectToWorld(IN.positionOS) + normalWS * _OutlineWidth;
|
|
OUT.positionCS = TransformWorldToHClip(posWS);
|
|
OUT.color = _OutlineColor;
|
|
```
|
|
|
|
### Custom shadow direction (face)
|
|
```hlsl
|
|
// Replace light dir with artist-specified vector for face
|
|
float3 fixedLight = mul((float3x3)unity_ObjectToWorld, _FaceLightDir);
|
|
float NdotL = dot(worldNormal, normalize(fixedLight));
|
|
```
|
|
|
|
### Hair tangent trick
|
|
```hlsl
|
|
// Hair anisotropic — tangent points along hair flow
|
|
float3 H = normalize(viewDir + lightDir);
|
|
float TdotH = dot(hairTangent, H);
|
|
float spec = pow(1.0 - TdotH * TdotH, _HairGloss);
|
|
```
|
|
|
|
### Edge detect post (Sobel on depth+normal)
|
|
```hlsl
|
|
float3 nC = SampleNormal(uv);
|
|
float dC = SampleDepth(uv);
|
|
float edge = 0;
|
|
[unroll] for (int i = 0; i < 4; ++i) {
|
|
float3 nS = SampleNormal(uv + offset[i] * _TexelSize);
|
|
float dS = SampleDepth(uv + offset[i] * _TexelSize);
|
|
edge += saturate(1.0 - dot(nC, nS)) + abs(dC - dS) * _DepthWeight;
|
|
}
|
|
return lerp(sceneColor, _EdgeColor, saturate(edge - _Threshold));
|
|
```
|
|
|
|
### Ramp texture authoring (Python)
|
|
```python
|
|
import numpy as np
|
|
from PIL import Image
|
|
ramp = np.zeros((1, 256, 3), dtype=np.uint8)
|
|
ramp[0, :64] = (60, 50, 80) # deep shadow
|
|
ramp[0, 64:160] = (140, 130, 150) # mid
|
|
ramp[0, 160:] = (250, 245, 240) # lit
|
|
Image.fromarray(ramp).save('toon_ramp.png')
|
|
```
|
|
|
|
### Specular hand-placed mask
|
|
```hlsl
|
|
// Per-pixel mask painted by artist — multiplies spec
|
|
float specMask = tex2D(_SpecMaskTex, uv).r;
|
|
float3 spec = pow(saturate(dot(N, H)), _Power) * specMask * _SpecColor;
|
|
```
|
|
|
|
## 매 결정 기준
|
|
| 효과 | Approach |
|
|
|---|---|
|
|
| 매 hard cel shadow | Ramp 1D texture + step |
|
|
| 매 face shadow control | Custom light vector |
|
|
| 매 cheap outline | Inverted hull (backface) |
|
|
| 매 detail outline | Post-process Sobel on N+depth |
|
|
| 매 anime hair | Tangent-based aniso + ramp |
|
|
| 매 emotional rim | Hand-placed highlight mask |
|
|
|
|
**기본값**: ramp + inverted hull + face light override. 매 modern (Unreal/Unity) 모두 매 stable.
|
|
|
|
## 🔗 Graph
|
|
- 부모: [[Computer Graphics]]
|
|
|
|
## 🤖 LLM 활용
|
|
**언제**: 매 anime / cel-shading 재현, 매 NPR 학습, 매 outline / shadow 의 매 trick 분석.
|
|
**언제 X**: 매 photorealistic — 매 PBR 파이프라인.
|
|
|
|
## ❌ 안티패턴
|
|
- **Auto-generated normal**: 매 anime look 의 매 핵심 — 매 hand-tune 필수.
|
|
- **Light dir 만 의존**: 매 face 매 dirty shadow.
|
|
- **Outline 두께 globally same**: 매 detail loss — 매 vertex color mask.
|
|
- **Bloom 만 의존한 mood**: 매 ramp / grading 이 매 base.
|
|
|
|
## 🧪 검증 / 중복
|
|
- Verified (Junya C. Motomura, "Guilty Gear Xrd's Art Style", GDC 2014).
|
|
- 신뢰도 A.
|
|
|
|
## 🕓 Changelog
|
|
| 날짜 | 변경 |
|
|
|---|---|
|
|
| 2026-05-08 | Phase 1 |
|
|
| 2026-05-10 | Manual cleanup — 매 Xrd pipeline + HLSL 패턴 |
|