유니티 엔진 (Unity Engine)

[Unity] Renderer.staticShadowCaster 의 의미. LightMap 굽는데 영향이 있나? Static 플래그와는 무슨 관계일까? 에 대한 짧은 결론.

원소랑 2024. 5. 3. 15:07
728x90

 

유니티 엔진에서 Mesh Renderer, Line Renderer 등 Renderer 를 상속받은 컴포넌트에 Static Shadow Caster 라는 플래그가 있다. Lighting 헤더 아래에 Cast Shadows, Contribute Global Illumination 사이에 떡 하니 (Cast Shadow를 On 으로 했을 때만 등장) 위치해 있어서 굉장히 중요해보이는 플래그인데,

 

Static Shadow Caster 에 마우스를 롤오버 해서 설명을 보면 이렇다.

 

Static Shadow Caster
When enabled, Unity considers this renderer as being static for the sake of shadow rendering. If the SRP implements cached shadow maps, this field indicates to the render pipeline what renderers are considered static and what renderers are considered dynamic.

한글 해석.
활성화된 경우 Unity는 그림자 렌더링을 위해 이 렌더러를 정적인 것(static)으로 간주합니다. SRP가 캐시된 그림자 맵(Cached shadow maps)을 구현하는 경우 이 필드는 어떤 렌더러를 정적인 것으로 간주하고 어떤 렌더러를 동적인 것으로 간주하는지 렌더링 파이프라인에 나타냅니다.

 

요약하면, "SRP 에서 Cached shadow maps처리할 때 shadow caster가 static/dynamic 인지 체크하기 위한 플래그" 라는 뜻.

 

검색을 하다가 Unity Forum 에서 관련 글을 찾아서 봄.

 

 

결론은,

체크 하든 안 하든 정적 LightMap 을 굽는데 영향은 없고, 체크 해도 안 해도 Cached shadow maps 생성할 때만 참조하기 때문에 그 외에는 의미 없는 플래그. GameObject 의 Static 플래그와도 무관하다.

 

연관 문서

Renderer.staticShadowCaster

https://docs.unity3d.com/kr/2022.3/ScriptReference/Renderer-staticShadowCaster.html

 

Renderer-staticShadowCaster - Unity 스크립팅 API

Is this renderer a static shadow caster?

docs.unity3d.com

 

https://forum.unity.com/threads/why-is-static-shadow-caster-separate-from-other-static-flags-should-i-enable-it.1389288/

 

Question - Why is "Static Shadow Caster" separate from other static flags? Should I enable it?

It looks like the setting "Static Shadow Caster" on a renderer should be enabled when using lighting not set to update every frame, but rather with...

forum.unity.com

 

https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@11.0/manual/Shadows-in-HDRP.html

 

Shadows in the High Definition Render Pipeline | High Definition RP | 11.0.0

Shadows in the High Definition Render Pipeline The High Definition Render Pipeline’s Lights can cast shadows from one GameObject onto another. They emphasize the position and scale of GameObjects, which adds a degree of depth and realism to a Scene that

docs.unity3d.com


게임 개발에 필수적인 내용을 담는 명서들을 소개합니다.

 

<유니티 교과서 개정6판>(유니티 최신 버전)
https://link.coupang.com/a/bz23dY

 

유니티 교과서 개정6판

COUPANG

www.coupang.com

 

<대마왕의 유니티 URP 셰이더 그래프 스타트업>

https://link.coupang.com/a/bs8qyC

 

대마왕의 유니티 URP 셰이더 그래프 스타트업

COUPANG

www.coupang.com


<리얼-타임 렌더링(REAL-TIME RENDERING) 4/e>
https://link.coupang.com/a/8VWas

 

리얼-타임 렌더링 4/e

COUPANG

www.coupang.com

 

<이득우의 게임 수학:39가지 예제로 배운다! 메타버스를 구성하는 게임 수학의 모든 것>
https://link.coupang.com/a/9BqLd

 

이득우의 게임 수학:39가지 예제로 배운다! 메타버스를 구성하는 게임 수학의 모든 것

COUPANG

www.coupang.com

 

유니티 에셋 스토어 링크
https://assetstore.unity.com?aid=1011lvz7h

 

에셋스토어

여러분의 작업에 필요한 베스트 에셋을 찾아보세요. 유니티 에셋스토어가 2D, 3D 모델, SDK, 템플릿, 툴 등 여러분의 콘텐츠 제작에 날개를 달아줄 다양한 에셋을 제공합니다.

assetstore.unity.com

(링크를 통해 도서/에셋 구입시 일정액의 수수료를 지급받습니다.)


 

728x90
반응형