• RuntimesUnity
  • how to use Tint Black in 2D Renderer Light( Unity 2022.3)

유니티 2020 버전에서 스파인의 4.1 버전으로 동작했을 때, 2D Light 에 Tink Black 을 사용할 수 있었다.

하지만 2021 이후 2D Renderer 가 변경되면서 더이상 Tink Black을 사용할 수 없게 되었습니다.
(정확하게 말하면 기존에 사용하던 URP Spine Lit 쉐이더가 핑크색으로 보입니다.)

유니티 2021 이후 변경된 랜더 환경에서 사용하는 2D Renderer 쉐이더를 수정하면 2D 라이팅은 들어가지만 Tint Black이 적용되지 않아 알파 애니메이션이 검정색으로 보여 큰 문제입니다. 수정 방법이 필요해요!

in eng.

When operating with version 4.1 of Spine in Unity 2020, Tink Black could be used in 2D Light.

However, with changes to the 2D Renderer after 2021, Tink Black can no longer be used.
(To be precise, the previously used URP Spine Lit shader appears pink.)

If you modify the 2D Renderer shader used in the render environment that has changed after Unity 2021, 2D lighting is included, but Tint Black is not applied, so the alpha animation appears black, which is a major problem.

    Related Discussions
    ...

    유니티 2021 이후 버전에서 2D 라이트와 함께 Tint Black 기능을 사용하려면, 최신 spine-unity 런타임을 사용해야 합니다. 최신 버전에서는 모든 Spine URP 쉐이더(2D 및 3D 쉐이더)와 표준 파이프라인 Spine/Sprite 쉐이더에서 Tint Black 기능을 지원합니다. 이 기능은 Inspector의 Tint Black 재질 파라미터를 통해 활성화할 수 있습니다. 단, 이 기능을 사용하기 위해서는 spine-unity 런타임의 최신 버전(패키지 버전 4.1.12, 2023-05-31 이후)이 필요하며, 이는 spine-unity 다운로드 페이지에서 받을 수 있습니다.

    URP Spine Lit 쉐이더가 핑크색으로 보이는 문제는 쉐이더가 제대로 업데이트되지 않았거나, 프로젝트가 새로운 런타임 버전으로 올바르게 업데이트되지 않았을 때 발생할 수 있습니다. 따라서, spine-unity 런타임을 최신 버전으로 업데이트하고, 프로젝트의 모든 Spine 관련 쉐이더가 최신 상태인지 확인해야 합니다.

    eunjoo This is not directly related to your question, but the Spine forum has a translate button available, so you do not need to post in English as well, just post in your native language.

    While Spinebot has already recommended that you use the latest spine-unity runtime, it is always helpful to let us know which version of spine-unity runtime you are currently using.

      eunjoo However, with changes to the 2D Renderer after 2021, Tink Black can no longer be used.
      (To be precise, the previously used URP Spine Lit shader appears pink.)

      Using 3D Shaders with 2D Renderer was never supported. You always have to use URP/2D shaders when using a URP 2D Renderer. Mixing 2D Renderer with Built-In-RP or URP 3D shaders might look correct in the Unity Editor but may break down in builds or lead to other undefined behaviour.

      See the documentation:
      https://esotericsoftware.com/spine-unity#URP-Shaders---Extension-UPM-Package

        Misaki 고마워요! 덕분에 편하게 작성할 수 있겠어요.

        Harald 스파인 봇과 해럴드가 말해준대로 스파인 4.1 런타임을 적용하고 테스트를 하고 있습니다.

        Spine/Sprite 쉐이더에서
        Lit Universal2D 라이트 모드, PMA Vertex,Straight Texture 블랜드 모드
        Tint Black 을 체크하고 사용해보았습니다.

        아래 이미지대로 1. 에디터에서 이미지가 정상적으로 보이지 않습니다.

        1. 볼터치 이미지가 깔끔하게 들어가지 않습니다. (알파가 들어간 애니메이션을 수행할 때 깨끗하게 투명해지는게 아니라 검은색으로 빠집니다. )

        에디터뷰

        게임뷰

          eunjoo Could you also show us some screenshots of the material settings? I want to make sure you have the right shaders and settings.

            Misaki 물론이에요.
            일부러 크게 건드리지 않았습니다.

              eunjoo Thank you for sharing the screenshots! The component and material settings appear to be correct, so I guess that the Render Pipeline assets set up in your project are incorrect.

              For example, if I were to display skeletons using the Universal Render Pipeline/2D/Spine/Sprite shader with a Render Pipeline asset for 3D renderer, it would look like this:

              If the Render Pipeline asset for 2D renderer is set up correctly, it should look something like this:

              You say it will be correct in game view, so it could be that some assets are set correctly for some quality levels in the Quality settings in the Project Settings, but other levels are set incorrectly.
              Could you please confirm that the correct Render Pipeline assets are being used?

                Misaki 네 안타깝게도, 모든 랜더 파이프라인 자산은 올바르게 사용되고 있습니다.

                이후 패키지 임포팅 문제도 있을 것이라 판단하여, 라이브러리 폴더를 삭제후 다시 켜봤습니다.
                스파인에서 제작한 알파 애니메이션이 검은색으로 변하는 것은 사라진 것 같습니다.

                하지만 아직도 2D 라이트를 비출 때 일부 이미지가 잘못 출력되고 있습니다.
                [비정상]

                [원본]

                그리고 여전히 에디터상에서는 스파인이 정상적으로 보이지 않네요.
                [게임 뷰]

                [에디터뷰]

                (그리고 자세히 보시면 알겠지만 우리가 보는 방향에서 오른쪽 볼터치가 정상적인 블랜딩 상태이고, 왼쪽 볼터치-2D라이트의 영향을 받는 영역-가 어두워진 것을 확인할 수 있습니다.)

                  eunjoo I am sorry to hear that the problem still persists. Could you please send us via email a minimal Unity project that can reproduce the problem?: contact@esotericsoftware.com
                  Please include the URL of this forum thread in the email so we know the context. Then we can take a look at what's wrong.

                    Misaki 감사합니다. 스파인 리소스를 포함하여 씬을 익스포트하여 보냈습니다. 문제를 해결할 수 있으면 좋을 것 같네요.

                      Misaki
                      스파인 리소스를 Tint Black 을 적용해서 뽑으니 에디터에서 이상하게 보이는 현상은 사라졌습니다!
                      하지만 볼터치가 어둡게 보이는 것은 여전해요. 🙁

                      eunjoo Thanks for sending the Unity package! It turns out that the problem still seems to be caused by a misconfigured render pipeline.

                      Here is the image when I use the Example 2D URP Asset that comes with the URP extension package, which is for URP 2D Renderer:

                      Here is the image when I use the Example URP Asset that comes with the URP extension package, which is for URP 3D Forward Renderer:

                      Please check and look at our examples carefully. Just in case you need to know how to import the examples, select Spine Universal RP Shaders in the Package Manager, expand the "Samples" column and click the Import button (In the screenshot below, it's changed to Reimport, but if you haven't imported it yet, it should be Import.):

                        Misaki
                        프로젝트의 다른 동료가 추가로 설명을 해줬습니다.
                        어느 부분에서 잘못됐는지 알 것 같아요. 시도해보고오겠습니다. 감사합니다!

                        Misaki 고맙습니다 덕분에 문제를 해결했습니다!
                        에디터는 랜더 파이프라인 세팅에서 디폴트 랜더러를 기준으로 보여진다는 걸 알았어요.
                        하지만 안타깝게도 우리는 기본적으로는 3D 게임이고, 부분적으로만 2D 랜더러를 사용합니다.
                        때문에 디폴트 랜더러를 2D 랜더러로 설정하면 다른 3D 씬의 에디터에서 설정이 힘들어 스파인의 에디터 화면을 포기하기로 했습니다.
                        디폴트가 3D URP로 설정되어 에디터상에서 잘못보이더라도 스파인을 비추는 카메라가 2D 랜더러 파이프라인 세팅이라면 정상 출력된다는 것을 확인했기 때문입니다.

                        도움에 감사드립니다!

                          eunjoo Glad to hear the problem has been resolved! Thank you for getting back to us!