ABOUT PORTFOLIO GAMES DEVLOG DOCS TOOLS CONTACT
HOME > DOCS > Shader / URP > 시간 함수(Sine)와 프레넬, 스캔라인을 결합한 사이버펑크 홀로그램 글리치 셰이더Hologram Glitch Shader Combining Sine Scanlines and Fresnel Rim Lighting
Shader / URP Intermediate Unity 2021.3+ / Unity 6 (URP)

시간 함수(Sine)와 프레넬, 스캔라인을 결합한 사이버펑크 홀로그램 글리치 셰이더Hologram Glitch Shader Combining Sine Scanlines and Fresnel Rim Lighting

Y축 월드/스크린 스캔라인 줄무늬 애니메이션과 림 프레넬 발광, 노이즈 기반 버텍스 오프셋 글리치를 결합한 반투명 홀로그램 셰이더.A translucent hologram shader combining vertical scanline animations, Fresnel rim emission, and optional vertex offset glitching in URP.

#Shader #URP #Hologram #SciFi #VFX
핵심 개념홀로그램 표현의 핵심 요소는 반투명한 내부, 선명한 외곽 발광(Fresnel), 그리고 수직으로 흐르는 수평 주사선(Scanline)입니다. sin(positionWS.y * frequency + _Time.y * speed)로 주기적인 줄무늬 값을 계산하여 색상 강도와 알파 채널에 반영합니다.
Core ConceptHologram visuals rely on a translucent interior, a bright silhouette rim (Fresnel), and scrolling horizontal scanlines. Evaluating sin(positionWS.y * frequency + _Time.y * speed) generates a periodic band pattern that modulates both emission intensity and alpha opacity.

1. 스캔라인 및 프레넬 조합 프래그먼트 셰이더1. Scanline and Fresnel Fragment Shader Logic

HologramScanline.hlsl
float scanline = sin(input.positionWS.y * _ScanlineFreq + _Time.y * _ScanlineSpeed);
scanline = scanline * 0.5 + 0.5;

float fresnel = 1.0 - saturate(dot(normalize(input.normalWS), normalize(viewDirWS)));
fresnel = pow(fresnel, _FresnelPower);

half4 finalColor = _HoloColor * (fresnel + scanline * _ScanlineIntensity);
finalColor.a = saturate(fresnel + scanline * 0.3) * _Alpha;

2. 실무 적용 및 주의사항2. Practical Considerations and Caveats

  • 내부 폴리곤 비침 방지(Depth Prepass): 복잡한 3D 캐릭터를 반투명 홀로그램으로 렌더링할 때 눈이나 입 안쪽 메시가 겹쳐 보인다면, ColorMask 0과 ZWrite On을 설정한 Depth-Only 패스를 먼저 실행해 전면 픽셀만 그려지도록 제한할 수 있습니다.
  • 버텍스 글리치 오프셋 추가: 버텍스 셰이더에서 step(0.98, frac(sin(_Time.y * 43.0)))와 같은 간헐적 계단 함수를 이용해 positionOS.x 좌표를 순간적으로 흔들어 주면 통신 불량과 같은 노이즈 효과를 연출할 수 있습니다.
  • Preventing Internal Polygon Overlap (Depth Prepass): When rendering complex 3D characters as translucent holograms, internal geometry such as eyes or mouth cavities may show through. Adding a preceding Depth-Only pass with ColorMask 0 and ZWrite On restricts rendering to the frontmost surface.
  • Adding Vertex Glitch Offsets: Applying an intermittent step function such as step(0.98, frac(sin(_Time.y * 43.0))) to offset positionOS.x in the vertex shader produces brief horizontal jitter resembling signal interference.

사인파 주사선 연산과 프레넬 내적 공식을 조합하면 별도의 텍스처 샘플링 없이도 가벼운 연산만으로 홀로그램 머티리얼을 구성할 수 있습니다.

Combining sine-wave scanlines with Fresnel dot-product calculations produces a lightweight procedural hologram material without requiring extra texture lookups.

참고자료 & 관련 링크