콘텐츠로 이동

Unity URP Volume & Post Processing

URP의 포스트 프로세싱은 Volume 컴포넌트로 구성됩니다. Global Volume은 씬 전체에, Local Volume은 콜라이더 영역 내에 적용됩니다.

Camera Inspector → Rendering → Post Processing 활성화 필수.

Volume 컴포넌트에 VolumeProfile 에셋을 연결합니다.

Volume Profile:
✅ Bloom
Threshold: 1.0, Intensity: 0.5, Scatter: 0.7
✅ Depth of Field (Bokeh)
Focus Distance: 10, Focal Length: 50
✅ Color Grading (ACES)
Contrast: 10, Saturation: -5
✅ Vignette
Intensity: 0.3
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
Volume _volume;
Bloom _bloom;
void Start() {
_volume = GetComponent<Volume>();
_volume.profile.TryGet(out _bloom);
}
// 피격 시 Bloom 강조
IEnumerator HitEffect() {
float t = 0f;
while (t < 0.5f) {
t += Time.deltaTime;
_bloom.intensity.value = Mathf.Lerp(0.5f, 3f, t * 4f);
yield return null;
}
_bloom.intensity.value = 0.5f;
}
void CreateFogVolume(Vector3 center, float radius) {
var go = new GameObject("FogVolume");
go.transform.position = center;
var sphere = go.AddComponent<SphereCollider>();
sphere.radius = radius;
sphere.isTrigger = true;
var volume = go.AddComponent<Volume>();
volume.isGlobal = false;
volume.blendDistance = 5f;
volume.weight = 1f;
var profile = ScriptableObject.CreateInstance<VolumeProfile>();
var fog = profile.Add<Fog>();
fog.enabled.value = true;
fog.color.value = new Color(0.7f, 0.7f, 0.8f);
fog.density.value = 0.05f;
volume.profile = profile;
}

URP에서 커스텀 효과를 추가합니다.

// 1. VolumeComponent 정의
[Serializable, VolumeComponentMenuForRenderPipeline(
"Custom/Scanlines", typeof(UniversalRenderPipeline))]
public class ScanlinesEffect : VolumeComponent, IPostProcessComponent {
public ClampedFloatParameter intensity = new(0f, 0f, 1f);
public bool IsActive() => intensity.value > 0f;
public bool IsTileCompatible() => true;
}
// 2. ScriptableRendererFeature 구현
public class ScanlinesFeature : ScriptableRendererFeature {
ScanlinesPass _pass;
public override void Create() => _pass = new ScanlinesPass();
public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData data)
=> renderer.EnqueuePass(_pass);
}
// 3. URP Renderer Asset에 Feature 추가 (에디터)
IEnumerator FadeToBlack(float duration) {
if (!_volume.profile.TryGet<ColorAdjustments>(out var ca)) yield break;
float t = 0f;
while (t < duration) {
t += Time.deltaTime;
ca.postExposure.value = Mathf.Lerp(0f, -10f, t / duration);
yield return null;
}
}
이펙트비용모바일 권장
Bloom중간✅ (낮은 Scatter)
Depth of Field높음
Motion Blur높음
Color Grading낮음
Chromatic Aberration낮음✅ (낮은 강도)
  • Camera의 Post Processing 활성화 + Volume Profile로 구성
  • 런타임 블렌딩: profile.TryGet<T>()param.value 수정
  • Local Volume + 콜라이더로 구역별 다른 분위기 연출
  • 커스텀 이펙트는 VolumeComponent + ScriptableRendererFeature로 URP에 통합