본문 바로가기
개발/Unity

유니티 - 스포트 라이트가 오브젝트를 관통하는 문제 해결하기 (How to Fix the Spot Light Through the GameObject)

by 피로물든딸기 2022. 8. 31.
반응형

Unity 전체 링크

 

유니티에서 스폿 광원을 이용하면 아래와 같이 원뿔 모양의 영역이 생긴다.

 

그런데 광원과 벽 사이에 오브젝트가 있으면, 오브젝트에도 빛이 렌더링되고, 벽에도 그대로 빛이 나온다.

즉, Spot Light오브젝트를 그대로 패스하여 통과하는 것처럼 보인다.

 

이상적인 상황은 게임오브젝트 큐브가 빛을 가려서 그림자가 만들어져야 한다.


해결방법은 매우 간단하다.

 

Light 설정에서 Shadow 설정을 아래와 같이 해주면 된다.

 

Shadow Type은 Soft / Hard 모두 동일하다.

위의 문제는 No Shadow일 때 발생하는 현상이다.

 

Strength를 조절함에 따라 오브젝트를 관통하는 현상이 줄어드는 것을 볼 수 있다.

 

Unity Plus:

 

Easy 2D, 3D, VR, & AR software for cross-platform development of games and mobile apps. - Unity Store

Have a 2D, 3D, VR, or AR project that needs cross-platform functionality? We can help. Take a look at the easy-to-use Unity Plus real-time dev platform!

store.unity.com

 

Unity Pro:

 

Unity Pro

The complete solutions for professionals to create and operate.

unity.com

 

Unity 프리미엄 학습:

 

Unity Learn

Advance your Unity skills with live sessions and over 750 hours of on-demand learning content designed for creators at every skill level.

unity.com

반응형

댓글