GameChoi
Choi Programming
GameChoi
전체 방문자
오늘
어제
  • 분류 전체보기 (468)
    • C++ Algorithm & Study (184)
      • C++ & Algorithm Strategies (45)
      • Game Math & DirectX 11 (72)
      • Server + UE5 (29)
      • Lyra Clone Coding (37)
    • Create Game (284)
      • [Window API] Game Client & .. (55)
      • [DirectX] DirectX 2D & 3D (155)
      • [UE5] BLUEPRINT & C++ (74)
    • odds and ends (0)
      • English (0)

블로그 메뉴

  • 홈
  • 태그
  • 방명록

공지사항

인기 글

태그

  • Player State
  • Game Room
  • UE5
  • core
  • Direct11
  • protobuf
  • server
  • Player Move Packet
  • c++
  • Other Character
  • Network Worker
  • RPG Game
  • GAME Client
  • Game Server
  • Algorithm Strategies
  • client
  • session
  • Destination Move Packet
  • Direct3D
  • job queue

최근 댓글

최근 글

티스토리

hELLO · Designed By 정상우.
GameChoi

Choi Programming

[Direct11] 14. Lighting System - Directional & Point & Spot Light
C++ Algorithm & Study/Game Math & DirectX 11

[Direct11] 14. Lighting System - Directional & Point & Spot Light

2023. 6. 15. 18:46

1. Lighting System

1.1 Lighting System

1.1.1 Directional Light

 - 지향광이라고 하는 평행광은 아주 멀리 있는 광원에서 오는 빛을 본뜬 것

   - 광원이 아주 멀리 있다면 모든 입사광선이 서로 평행하다고 간주할 수 있음

     - 평행광원은 빛이 나아가는 방향을 뜻하는 하나의 벡터로 정의

       - 광선들이 평행이라는 것은 모든 광선의 방향이 동일하다는 뜻이므로 하나의 벡터로 충분

       - 평행광의 빛 벡터는 광선이 나아가는 방향의 반대 방향, 실제 세상에서 지향광원의 대표적인 예는 바로 태양

void ComputeDirectionalLight(Material mat, DirectionalLight L, float3 normal, float3 toEye,
                             out float4 ambient, out float4 diffuse, out float4 spec)

1.1.2 Point Light

 - 점광의 대표적인 예는 전구, 빛을 구면상의 모든 방향으로 내뿜음

   - 점광의 빛 벡터는 빛이 나아가는 방향의 반대

     - 빛의 세기는 역제곱 법칙에 근거한 거리의 함수로서 약해짐

     - 광원과의 거리가 광원의 범위보다 큰 점은 그 광원으로 부터 빛을 전혀 받지 않음

       - 빛을 특정 지역에 국한시키고자 할 때 유용, 조명을 위한 셰이더의 최적화에도 유리

void ComputePointLight(Material mat, PointLight L, float3 pos, float3 normal, float3 toEye,
				   out float4 ambient, out float4 diffuse, out float4 spec)

1.1.3 Spot Light

 - 점적광의 대표적인 예는 손전등, 위치Q에서 d방향으로 뻗어 나가는 원뿔 형태의 빛

   - 점적광 방정식은 점광 방정식에 점적광 원뿔을 기준, 한 점의 위치에 따른 빛의 감쇠를 흉내내는 점적광 계수를 곱한 것

void ComputeSpotLight(Material mat, SpotLight L, float3 pos, float3 normal, float3 toEye,
				  out float4 ambient, out float4 diffuse, out float4 spec)
저작자표시 (새창열림)

'C++ Algorithm & Study > Game Math & DirectX 11' 카테고리의 다른 글

[Direct11] 16. Direct3D Texture  (0) 2023.06.16
[Direct11] 15. EX App Program - Light System  (0) 2023.06.15
[Direct11] 13. Lighting System - Diffuse & Ambient & Specular Light  (0) 2023.06.15
[Direct11] 12. EX App Program - Hills  (1) 2023.06.14
[Direct11] 11. EX App Program - Color Box  (0) 2023.06.14
    'C++ Algorithm & Study/Game Math & DirectX 11' 카테고리의 다른 글
    • [Direct11] 16. Direct3D Texture
    • [Direct11] 15. EX App Program - Light System
    • [Direct11] 13. Lighting System - Diffuse & Ambient & Specular Light
    • [Direct11] 12. EX App Program - Hills
    GameChoi
    GameChoi

    티스토리툴바