Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

Compilation errors with the HDRP

Discussion in '2019.1 Beta' started by spaceemotion, Nov 1, 2018.

  1. spaceemotion

    spaceemotion

    Joined:
    Sep 29, 2015
    Posts:
    51
    Edit: Even though I just installed the HDRP on the project yesterday it seems like the v5, that seems to have been just released, fixed these issues.

    ----

    Hey! Thanks for making the alpha public.

    I just tried it out on a copy of our project and am getting a few compilation errors with the HDRP:

    Library\PackageCache\com.unity.shadergraph@4.0.1-preview\Editor\DefaultShaderIncludes.cs(24,10): error CS0619: 'ShaderIncludePathAttribute' is obsolete: '[ShaderIncludePath] attribute is no longer supported. Your shader library must be under the Assets folder or in a package. To include shader headers directly from a package, use #include "Packages/<package name>/<path to your header file>"'​

    Library\PackageCache\com.unity.shadergraph@4.0.1-preview\Editor\Data\MasterNodes\ISubShader.cs(10,35): error CS0246: The type or namespace name 'RenderPipelineAsset' could not be found (are you missing a using directive or an assembly reference?)

    Library\PackageCache\com.unity.shadergraph@4.0.1-preview\Editor\Data\Nodes\IMasterNode.cs(10,35): error CS0246: The type or namespace name 'RenderPipelineAsset' could not be found (are you missing a using directive or an assembly reference?)

    Library\PackageCache\com.unity.shadergraph@4.0.1-preview\Editor\Data\Nodes\MasterNode.cs(14,65): error CS0535: 'MasterNode<T>' does not implement interface member 'IMasterNode.IsPipelineCompatible(RenderPipelineAsset)'

    Shader error in 'SRP Default': failed to open source file: 'ShaderGraphLibrary/Functions.hlsl' at /(omitted)/Library/PackageCache/com.unity.render-pipelines.high-definition@4.0.1-preview/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl(17) (on d3d11)

    Compiling Vertex program with UNITY_PASS_SHADOWCASTER INSTANCING_ON
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR
    Running this on a Win 10 machine.

    Cheers!

    ----

    There also seem to have been changes to the new Preferences Window API, but that's unrelated to the HDRP.

    (Currently making a SSCE)
     
    Last edited: Nov 1, 2018
  2. Charles_Beauchemin

    Charles_Beauchemin

    Unity Technologies

    Joined:
    Jan 18, 2017
    Posts:
    353
    I'm happy to hear that upgrading your SRP package(s) to 5.0.0 fixed your issues!
     
    jashan and spaceemotion like this.
  3. spaceemotion

    spaceemotion

    Joined:
    Sep 29, 2015
    Posts:
    51
    Hey, thanks for the quick reply. I just have to figure out why Rider is not picking up the solution properly, all I'm seeing is "load failed" and this in the console when I'm triggering a Build in Rider itself:

    Microsoft (R) Build Engine version 4.7.3056.0
    [Microsoft .NET Framework, version 4.0.30319.42000]
    Copyright (C) Microsoft Corporation. All rights reserved.

    MSBUILD : error MSB1004: Specify the name of the target.
    Switch: /t:

    For switch syntax, type "MSBuild /help"​

    Unity itself builds fine though. I'm not using the Incremental compiler and got a couple (10) custom packages.

    Runtime Version is set to .NET 4.x, API to .NET 4.x as well.

    The error seems to come from here:

    Project 'Assembly-CSharp' load failed: The project file could not be loaded. There is no Unicode byte order mark. Cannot switch to Unicode.
    Which I was able to fix by applying this trick: https://stackoverflow.com/a/29918434/1397894
    Is this an issue with the .csproj file generation in Unity? Because the issue comes back as soon as I do a change in the code and Unity recompiles...
     
    Last edited: Nov 1, 2018
  4. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,919
    Probably should pop a warning up for packages that have to be upgraded / offer to get next version (HDRP did that before once I think?)
     
  5. Charles_Beauchemin

    Charles_Beauchemin

    Unity Technologies

    Joined:
    Jan 18, 2017
    Posts:
    353
    we already have a mechanism to handle this, we probably overlooked something for HDRP
     
    hippocoder likes this.
  6. NRDPXL

    NRDPXL

    Joined:
    Oct 30, 2018
    Posts:
    7
    I have same issues and same errors with HDRP on macOS with Metal and OpenGL. Version 2019.1.0a7
     
  7. Charles_Beauchemin

    Charles_Beauchemin

    Unity Technologies

    Joined:
    Jan 18, 2017
    Posts:
    353
    Have you tried upgrading the HD Render-Pipeline package to 5.0.0 to see if it fixes your issues?
     
  8. NRDPXL

    NRDPXL

    Joined:
    Oct 30, 2018
    Posts:
    7
    I'm not sure how to do that, as in Package manager I'm able to access only 3.3.0 and as I understand this one is the latest.
     
  9. spaceemotion

    spaceemotion

    Joined:
    Sep 29, 2015
    Posts:
    51
    @NRDPXL have you enabled the preview packages mode in the advanced menu?

    upload_2018-11-4_17-39-7.png
     
  10. NRDPXL

    NRDPXL

    Joined:
    Oct 30, 2018
    Posts:
    7
    Yes did the job. works on 5.0.0. thank you!
     
  11. mdsitton

    mdsitton

    Joined:
    Jan 27, 2018
    Posts:
    35
    I'm having similar issues with lwrp/postprocessing I've upgraded to 5.0 preview and that gives me an issue with the postprocessing package. Then if i upgrade postprocessing to 2.0.1.7 then i get issues with lwrp again.

    I get a bunch of these for different texture formats before trying to update postprocessing:
    Library\PackageCache\com.unity.postprocessing@2.0.16-preview\PostProcessing\Runtime\Utils\TextureFormatUtilities.cs(67,38): error CS0117: 'TextureFormat' does not contain a definition for 'ASTC_RGBA_12x12'

    After updating postprocessing i get:

    Library\PackageCache\com.unity.render-pipelines.lightweight@5.0.0-preview\Runtime\LWRPAdditionalLightData.cs(19,37): error CS0246: The type or namespace name 'MenuCommand' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.render-pipelines.lightweight@5.0.0-preview\Runtime\LWRPAdditionalLightData.cs(18,10): error CS0246: The type or namespace name 'MenuItemAttribute' could not be found (are you missing a using directive or an assembly reference?)
    Library\PackageCache\com.unity.render-pipelines.lightweight@5.0.0-preview\Runtime\LWRPAdditionalLightData.cs(18,10): error CS0246: The type or namespace name 'MenuItem' could not be found (are you missing a using directive or an assembly reference?)
     
    Spziokles likes this.
  12. MajorBulldozer

    MajorBulldozer

    Joined:
    Mar 14, 2014
    Posts:
    4
    ++Thanks;
     
  13. pbrito_unity

    pbrito_unity

    Joined:
    Mar 30, 2018
    Posts:
    18
    I can play in the editor but when I compile to windows I get some errors:

    Library\PackageCache\com.unity.render-pipelines.lightweight@5.0.0-preview\Runtime\LWRPAdditionalLightData.cs(19,37): error CS0246: The type or namespace name 'MenuCommand' could not be found (are you missing a using directive or an assembly reference?)

    Library\PackageCache\com.unity.render-pipelines.lightweight@5.0.0-preview\Runtime\LWRPAdditionalLightData.cs(18,10): error CS0246: The type or namespace name 'MenuItemAttribute' could not be found (are you missing a using directive or an assembly reference?)

    Library\PackageCache\com.unity.render-pipelines.lightweight@5.0.0-preview\Runtime\LWRPAdditionalLightData.cs(18,10): error CS0246: The type or namespace name 'MenuItem' could not be found (are you missing a using directive or an assembly reference?)

    Error building Player because scripts had compiler errors

    UnityEditor.BuildPlayerWindow+BuildMethodException: 4 errors
    at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x00234] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:190
    at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x0007f] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:96
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)​
     
    Spziokles likes this.
  14. RoKetX

    RoKetX

    Joined:
    May 10, 2018
    Posts:
    4
    Same here, have the same error the guy does above.

    This is on a totally blank project with just LWRP 5.0

    https://puu.sh/BWWet.png
     
    Spziokles likes this.
  15. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    574
    Is the project using .Net 4.x?
     
  16. RoKetX

    RoKetX

    Joined:
    May 10, 2018
    Posts:
    4
  17. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    574
    Change the Compatibility Level to .Net 4.x as well and it should compile the rest of the scripts and work
     
  18. RoKetX

    RoKetX

    Joined:
    May 10, 2018
    Posts:
    4
    Same error on compile
     
  19. mdsitton

    mdsitton

    Joined:
    Jan 27, 2018
    Posts:
    35
  20. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    574
    This might be a version problem

    LWRP and HDRP 4.x.x works with 2018.3 beta and release (you can get it from the package manager or get the latest from GitHub under release/2018.3) 4.2.0

    LWRP and HDRP 5.x.x works with 2019.1 alpha, anything lower won't compile and gives errors

    Check this post for more info on SRP versions and how things are right now - Current SRP and Unity Versions Clarified
     
  21. mdsitton

    mdsitton

    Joined:
    Jan 27, 2018
    Posts:
    35
    As i said i'm already using 5.0...
    upload_2018-11-11_19-6-10.png
     
  22. mdsitton

    mdsitton

    Joined:
    Jan 27, 2018
    Posts:
    35
    and my settings
    upload_2018-11-11_19-7-49.png
     
  23. mdsitton

    mdsitton

    Joined:
    Jan 27, 2018
    Posts:
    35
  24. mdsitton

    mdsitton

    Joined:
    Jan 27, 2018
    Posts:
    35
    the thread you linked mentions 5.1.0 which doesn't exist yet in the package manager "currently 5.1.0 for 2019.1 is equivalent"
     
  25. mdsitton

    mdsitton

    Joined:
    Jan 27, 2018
    Posts:
    35
    Last edited: Nov 12, 2018
    jashan and Charles_Beauchemin like this.
  26. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,105
    Would it be easy for you to auto-enable "Show Preview Packages" in the Package Manager of alphas and betas?

    I just got onto 2019.1.0a10 ... is my understanding correct that Shader Graph does not have a version that works with 2019.1.0a10, yet? Unfortunately, even after updating to HDRP 5.1.0 and removing Shader Graph (it's neither visible in the package manager, nor in the project browser under packages), and also after restarting Unity, I'm getting:

    Code (CSharp):
    1. <PathToProject>/Library/PackageCache/
    2. com.unity.shadergraph@5.1.0/Editor/Drawing/Blackboard/BlackboardProvider.cs(103,53):
    3. error CS0029: Cannot implicitly convert type `int' to `UnityEngine.UIElements.StyleLength'
    ... and a few similar ones :-(

    PS: So, it did exist in the path that is given in that error message. Unfortunately, Unity restores that folder when I delete it manually (close Unity, delete folder, open Unity). I also had a look at Packages/manifest.json but that does not have an entry for Shader Graph. I did create a new project with the HDRP template, so that's probably what is causing Shader Graph to be included.
     
    Last edited: Nov 26, 2018