Author Topic: Issue with missing meta files in HDRP  (Read 157 times)

Cheo

  • Newbie
  • *
  • Posts: 5
    • View Profile
Issue with missing meta files in HDRP
« on: September 12, 2020, 03:05:43 PM »
Hello, after scanning my project folders and trying to convert global keywords intolocal ones, I often get several error messages saying that a meta file which name ends in "_backup" is missing in the folder at the end of this path : (Project name)/Library/PackageCache/com.unity.render-pipelines.high-definition@8.2.0/Runtime/Material.
The files are indeed nowhere to be found in those folders, but I created a blank HDRP project to be sure and couldn't find any of those meta files either ! In addition to this, the conversion does not seem to have happened once I restart Unity and there are also those warning messages I'm not sure what to make of :
Can not delete asset. Packages/com.unity.render-pipelines.high-definition/Runtime/Material/AxF/AxF.shader_backup is an immutable path.
UnityEditor.AssetDatabase:CopyAsset(String, String)
and :
The package cache was invalidated and rebuilt because the following immutable asset(s) were unexpectedly altered:
  Packages/com.unity.render-pipelines.high-definition/Runtime/Material/LayeredLit/LayeredLitTessellation.shader_backup
UnityEditor.AssetDatabase:CopyAsset(String, String)

(Each are repeated about 4 or 5 times for different shaders)

Has anyone else met this issue before ? Thanks in advance !

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 6214
    • View Profile
Re: Issue with missing meta files in HDRP
« Reply #1 on: September 12, 2020, 04:42:41 PM »
Hi,
We'll investigate this - could you please specify which Unity / HDRP version are you using?
Thanks.

Cheo

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Issue with missing meta files in HDRP
« Reply #2 on: September 12, 2020, 07:32:32 PM »
Hi, I'm currently using Unity 2020.1.5f1 (the issue was happening with the previous version too) and HDRP 8.2.0.

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 6214
    • View Profile
Re: Issue with missing meta files in HDRP
« Reply #3 on: September 13, 2020, 02:59:13 PM »
So Unity is now blocking any modification in their internal packages. When overwritting package shaders, it will restore them to normal upon next restart. I guess they're enforcing this to ensure consistency and reduce bug reporting in case users accidentally modify those shaders.

As consequence, latest version of Shader Control will no longer allow modifications of those internal shaders. It will still list them and their keywords in the Project View and also you can exclude them from the build phase (in Build View). But you cannot disable keywords and click "Save". Doing so will show an informative message about the shader being readonly.

Cheo

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Issue with missing meta files in HDRP
« Reply #4 on: September 15, 2020, 10:37:18 AM »
About 30 keywords show up after the project scan and the error window still appears twice when I convert them all, but Shader Control seems to be working fine again ! Awesome ! Thank you very much, I can now import tons of assets again with no worries !

Cheo

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Issue with missing meta files in HDRP
« Reply #5 on: September 21, 2020, 12:20:29 PM »
I'm afraid I was wrong in my last message : yesterday I updated and imported Gaia Pro into my project which caused the maximum shader keywords error again. After scanning the project folders, 118 global keywords are said to be used and even by adding the additional 76 keywords from the last build the numbers do not make sense, the 256 keywords limit is not supposed to be reached !
And converting the keywords to local and reopening Unity does not seem to solve the error either. One thing that is worth mentioning is that about 30 keywords are generally listed after a scan, but on a few occasions the number went up to about 120 and the same issue I previously had happened again : error windows saying that a meta file was missing popped up one after the other and I had to quit and restart Unity.
I've added a few screenshots hoping it can help you understand the problem : https://imgur.com/a/ic2qICw
My project relies on a lot of assets from the asset store and I do not wish to come to sacrifice some in order to go below the keyword limit, so it would mean a lot to me if you could help me solve this !

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 6214
    • View Profile
Re: Issue with missing meta files in HDRP
« Reply #6 on: September 21, 2020, 01:26:45 PM »
Hi,

1) A new update is now available which will show an informative message when trying to convert to local a keyword located in a read-only shader file (to prevent issues with HDRP / URP internal packages which are protected). So you should be able to use the "Convert All" or "Convert To Local" without worrying about the metadata issue again. Please update.

2) Thanks for the screenshot. The Project View shows 303 keywords of which 118 are global + 76 additional internal keywords for a total of 194 global keywords. It's less than 256 max indeed. What numbers show the Build View, if any? It's possible that there're materials that could be using old keywords. Try the option "Clean All Materials". This option will remove any disabled keyword in all materials in the project. Another way to clean up materials and keywords is to remove demo scenes in the assets (as they usually come with many demos, remove anything that you don't need).

Let me know if that helps.

Cheo

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Issue with missing meta files in HDRP
« Reply #7 on: September 21, 2020, 04:37:12 PM »
Hello, I've updated Shader Control and used Clean all materials again, but to no end, the same error messages (usually about MATERIAL_QUALITY_LOW and MEDIUM) keep coming back. The build view currently says : Total shaders : 229. Shaders using keywords : 84. Total Unique Keywords : 132. I deleted a few unused shaders and demo scenes but that hasn't changed anything either. I think I will remove Gaia to see if it solves the issue, since it happened once I imported it.

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 6214
    • View Profile
Re: Issue with missing meta files in HDRP
« Reply #8 on: September 21, 2020, 04:47:36 PM »
When removing or disabling keywords, it's important to restart Unity because the internal keyword count doesn't get reseted until you do so (the max keywords exceed messge). Regarding Gaia, it comes with many sample assets that probably you won't need - you could also create your terrain in a side project, then import only the terrain and required assets in your real project.