titidatiti

I'm using Unity 2017.3 and when I import the Spine-unity v3.8 asset package, it shows some shader errors:
QQ截图20190908210607.jpg

Shader error in 'Spine/Sprite/Unlit': Can't find include file Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Core.hlsl at line 9

It seems that spine-unity 3.8 is including the LWRP from unity 2019?
The official download website says v3.8 is Compatible with Spine 3.8.x and Unity 2017.1-2019.2.
I wonder if I did something wrong?

Thank you!

---

Is there anyone can help? :lol:
Thanks!
Bạn không được cấp phép để xem tập tin đính kèm trong bài viết này.
Hình đại diện của thành viên
titidatiti
  • Bài viết: 27

Mario

Hm, the default spine-unity asset shouldn't reference any LWRP shaders or APIs at all. Could you tell what steps you took to upgrade spine-unity in your project?
Hình đại diện của thành viên
Mario

Mario
  • Bài viết: 2412

titidatiti

badlogic đã viết:Hm, the default spine-unity asset shouldn't reference any LWRP shaders or APIs at all. Could you tell what steps you took to upgrade spine-unity in your project?
I upgraded spine-unity from 3.6 to 3.8 by just downloading the spine-unity 3.8 asset package and covering the old version in my project, and I did not add the LWRP Shaders UPM package. Then I found some script errors occur, so I removed several deprecated c# scripts(which do not exist in 3.8 ) from 3.6 package. When all the script errors are gone, the last error is the shader error that I mentioned in this topic.

After that I tried removing the whole Spine folder in Unity project and re-import the 3.8 asset package, but the shader error still exist. :lol:

---
[Update]
I found out that if I comment the code in ShaderMaths.cginc and ShaderShared.cginc like this, the bug is gone:
QQ截图20190911141722.jpg

Seems like the if defined(USE_LWRP) returns true, but I have no idea why :rolleyes:
Bạn không được cấp phép để xem tập tin đính kèm trong bài viết này.
Hình đại diện của thành viên
titidatiti
  • Bài viết: 27

Mario

You should always remove the entire old Spine folder and copy over the new Spine folder. Partial updates usually never work, and as you experienced, some stuff can get left over.

Regarding the USE_LWRP flag, there must be some left over files from the lwrp-shaders package. These are the only places where that define is defined, see Search · USE_LWRP. You could search your project for the string #define USE_LWRP to see which file might be the culprit. Let me know what you found!
Hình đại diện của thành viên
Mario

Mario
  • Bài viết: 2412

titidatiti

badlogic đã viết:You should always remove the entire old Spine folder and copy over the new Spine folder. Partial updates usually never work, and as you experienced, some stuff can get left over.

Regarding the USE_LWRP flag, there must be some left over files from the lwrp-shaders package. These are the only places where that define is defined, see Search · USE_LWRP. You could search your project for the string #define USE_LWRP to see which file might be the culprit. Let me know what you found!
I've searched the entire project for keywords USE_LWRP but I found no #define USE_LWRP in the project.
That's why I got confused and could only comment these code yesterday:lol:.
Hình đại diện của thành viên
titidatiti
  • Bài viết: 27

Mario

Wow, that is extremely weird! I'll make sure to forward this to Harri (our Unity expert) once he's back. For now I'm glad you found a work around :)
Hình đại diện của thành viên
Mario

Mario
  • Bài viết: 2412

Harald

The USE_LWRP definition is only defined in LWRP shaders that are included in the LWRP extension package, you will not find it in the main spine-unity unitypackage. They include the same shader include files, but branch into different #if sections.

Please also have a look at your Packages directory for any leftover files of previous installations.
It may also happen that your Library directory contains some old references and causes weird behaviour.
Hình đại diện của thành viên
Harald

Harri
  • Bài viết: 2181


Quay về Bugs