07. Decal Rendering

DV·2024년 5월 12일

DirectX_3D

목록 보기
8/13

📒Decal (Projection)


: VolumeMesh가 교차하는 다른 Object에 Texture 투영

  • Deffered Rendering 사용
  • ex) 발자국 자국, 총알 자국, 문신

📌Setting

  • Shader domain : Decal domain 추가
    • 렌더링 시점: Deffered 이후, Lighting 이전
  • Render Target (MRT): Decal MRT 생성
  • DepthStencil State: NoTest NoWrite
  • culling: CULL-FRONT
    • VolumeMesh 안으로 카메라가 들어갔을 때도 렌더링되어야 함
    • Lighting을 CULL-FRONT한 것과 같은 이유

📌Shading

: VolumeMesh와 교차하는 면의 PixelShader만 호출되어야 함

  • PointLight의 Shading 접근법과 유사
  • VolumeMesh의 내부 판단
    1. Texture Sampling 값 보정
      • -0.5 ~ +0.5 ➡️ ~ -1.0 ~ +1.0
    2. 보정한 값으로 UV sampling
      • 표면의 normal이 Y축을 향하도록 바닥에 깔려있으므로 XZ축 사용

📒Additional Decal MRT Op


📌Emissive Texture

: 자체적으로 발광하는 텍스처

  • Blend State
    • 상황:
      • Color는 AlphaBlend 필요
      • Light(Emissive Tex)는 OneOneBlend 필요
    • Decal 전용 Blend State 생성
      • BLEND_DESC.IndependentBlend = Enable
      • Render Target마다 독립적으로 Blend State 설정하는 플래그
  • Emissive Tex 처리: Merge

📌Normal Map

: Normal Map 등을 사용해서 표면 거칠기 덮어씌우기 가능

0개의 댓글