Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Raytracing in build settings

Discussion in 'High Definition Render Pipeline' started by Beervangeer, Aug 17, 2020.

  1. Beervangeer

    Beervangeer

    Joined:
    Dec 4, 2012
    Posts:
    20
    Hello,

    I have been using raytracing features in my scene for reflections and ambient occlusion.
    It works very well in the editor, but when I make a build, the effects dont show.
    Can anyone help me with this problem? Do I have to activate something special for making a build work with Raytracing?
     
  2. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    760
    If it's working in editor, you shouldn't have too activate anything more for it to show in build

    Which Unity engine and HDRP version are you using ?

    Did you try making a development build to see if there's any errors showing that would prevent RTX effects from displaying ?
     
    Beervangeer likes this.
  3. Beervangeer

    Beervangeer

    Joined:
    Dec 4, 2012
    Posts:
    20
    Thanks for your reply.

    Yes I tried to make a Dev build. I can't seem to find a log file in the application folder. It should be in the data folder of the build app right?
     
  4. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    760
    If there's some errors on your project, you will be able to see them on the console directly on screen on your build.

    If there's nothing, could you send a small repro on your issue or create a bug report so I can take a look at it ?
     
  5. Beervangeer

    Beervangeer

    Joined:
    Dec 4, 2012
    Posts:
    20
    On Windows 10 Unity 2020.1.2f1
    My steps to recreate this:

    - Start New HDR Project
    - Go to Window -> Render PipeLine -> hd render pipeline wizard -> fix all issues for HDRP + DXR
    - Create a new scene
    - Add some objects
    - Add ambient occlusion, SSR and Global Illumsation to DXR Settings Volume (with Ray Tracing Preview Enabled per effect)
    - Save scene and build scene

    Attached you see a screenshot from within the editor and one of the build.

    I use a GTX 2070 Super.
     

    Attached Files:

    Last edited: Aug 18, 2020
    chap-unity likes this.
  6. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    760
    I just tried your steps with 2020.1.2f1 and the only way I managed to NOT have RTX effects in player is if I left my architecture to x86.
    Using x86_64 solves this problem on my side

    Do you build in x86 by any chance ?
     
  7. Beervangeer

    Beervangeer

    Joined:
    Dec 4, 2012
    Posts:
    20
    Thank you for checking, than thats probably it!

    When I try to build with x86_64 I get several errors.

    Its probably something with the Windows SDK, im gonna check.

    Code (CSharp):
    1. Failed running C:\Program Files\Unity\Hub\Editor\2020.1.2f1\Editor\Data\il2cpp/build/deploy/netcoreapp3.0/il2cpp.exe --convert-to-cpp --emit-null-checks --enable-array-bounds-check --dotnetprofile="unityaot" --compile-cpp --libil2cpp-static --platform="WindowsDesktop" --architecture="x64" --configuration="Release" --outputpath="C:\Users\Gebruiker\Desktop\Parabool\Temp/StagingArea/Data\Native\GameAssembly.dll" --cachedirectory="C:\Users\Gebruiker\Desktop\Parabool\Assets\..\Library/il2cpp_cache" --baselib-directory="C:/Program Files/Unity/Hub/Editor/2020.1.2f1/Editor/Data/PlaybackEngines/WindowsStandaloneSupport\Variations\win64_nondevelopment_il2cpp" --avoid-dynamic-library-copy --profiler-report --map-file-parser="C:/Program Files/Unity/Hub/Editor/2020.1.2f1/Editor/Data/Tools/MapFileParser/MapFileParser.exe" --directory=C:/Users/Gebruiker/Desktop/Parabool/Temp/StagingArea/Data/Managed --generatedcppdir=C:/Users/Gebruiker/Desktop/Parabool/Temp/StagingArea/Data/il2cppOutput
    2.  
    3. stdout:
    4. Running il2cpp.exe in server GC mode.
    5. Building GameAssembly.dll with MsvcDesktopToolChain
    6.     Msvc Install Version: 15.0
    7.     Msvc Install SDK Directory: C:\Program Files (x86)\Windows Kits\10
    8.     Msvc Linker Path: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\HostX64\x64\link.exe
    9.     Msvc Compiler Path: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\HostX64\x64\cl.exe
    10.  
    11.     Output directory: C:\Users\Gebruiker\Desktop\Parabool\Temp\StagingArea\Data\Native
    12.     Cache directory: C:\Users\Gebruiker\Desktop\Parabool\Library\il2cpp_cache
    13. ObjectFiles: 247 of which compiled: 247
    14.     Time Compile: 35749 milliseconds Unity.RenderPipelines.HighDefinition.Runtime3.cpp
    15.     Time Compile: 25486 milliseconds System2.cpp
    16.     Time Compile: 21833 milliseconds mscorlib5.cpp
    17.     Time Compile: 13135 milliseconds System.Xml4.cpp
    18.     Time Compile: 9872 milliseconds Unity.RenderPipelines.HighDefinition.Runtime6.cpp
    19.     Time Compile: 7738 milliseconds UModelerCommon.cpp
    20.     Time Compile: 7560 milliseconds mscorlib6.cpp
    21.     Time Compile: 7428 milliseconds System.Xml3.cpp
    22.     Time Compile: 7400 milliseconds mscorlib11.cpp
    23.     Time Compile: 7358 milliseconds mscorlib17.cpp
    24. Total compilation time: 45083 milliseconds.
    25. il2cpp.exe didn't catch exception: Unity.IL2CPP.Building.BuilderFailedException: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\HostX64\x64\link.exe /out:"C:\Users\Gebruiker\Desktop\Parabool\Library\il2cpp_cache\linkresult_90AD456A85A37A9DCCAA6406BBE3D009\GameAssembly.dll" /ignore:4206 /DEBUG /INCREMENTAL:NO /LARGEADDRESSAWARE /NXCOMPAT /DYNAMICBASE /NOLOGO /TLBID:1 /OPT:REF /OPT:ICF /HIGHENTROPYVA /DLL /IGNORE:4104 /NODEFAULTLIB:uuid.lib "kernel32.lib" "user32.lib" "advapi32.lib" "ole32.lib" "oleaut32.lib" "Shell32.lib" "Crypt32.lib" "psapi.lib" "version.lib" "MsWSock.lib" "ws2_32.lib" "Iphlpapi.lib" "Dbghelp.lib" "C:\Program Files\Unity\Hub\Editor\2020.1.2f1\Editor\Data\PlaybackEngines\WindowsStandaloneSupport\Variations\win64_nondevelopment_il2cpp\baselib.dll.lib" /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\lib\x64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\um\x64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\ucrt\x64" /SUBSYSTEM:WINDOWS @"C:\Users\Gebruiker\AppData\Local\Temp\tmp16E2.tmp"
    26.  
    27. LINK : fatal error LNK1181: cannot open input file 'Shell32.lib'
    28.  
    29.   at Unity.IL2CPP.Building.CppProgramBuilder.PostprocessObjectFiles(HashSet`1 objectFiles, CppToolChainContext toolChainContext)
    30.   at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
    31.   at il2cpp.Compilation.CompilationDriver.Run(RuntimePlatform platform, BuildingOptions buildingOptions)
    32.   at il2cpp.Program.DoRun(String[] args, RuntimePlatform platform, BuildingOptions buildingOptions)
    33.   at il2cpp.Program.Run(String[] args, Boolean setInvariantCulture)
    34.   at il2cpp.Program.Main(String[] args)
    35. stderr:
    36. Unhandled exception. Unity.IL2CPP.Building.BuilderFailedException: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\HostX64\x64\link.exe /out:"C:\Users\Gebruiker\Desktop\Parabool\Library\il2cpp_cache\linkresult_90AD456A85A37A9DCCAA6406BBE3D009\GameAssembly.dll" /ignore:4206 /DEBUG /INCREMENTAL:NO /LARGEADDRESSAWARE /NXCOMPAT /DYNAMICBASE /NOLOGO /TLBID:1 /OPT:REF /OPT:ICF /HIGHENTROPYVA /DLL /IGNORE:4104 /NODEFAULTLIB:uuid.lib "kernel32.lib" "user32.lib" "advapi32.lib" "ole32.lib" "oleaut32.lib" "Shell32.lib" "Crypt32.lib" "psapi.lib" "version.lib" "MsWSock.lib" "ws2_32.lib" "Iphlpapi.lib" "Dbghelp.lib" "C:\Program Files\Unity\Hub\Editor\2020.1.2f1\Editor\Data\PlaybackEngines\WindowsStandaloneSupport\Variations\win64_nondevelopment_il2cpp\baselib.dll.lib" /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\lib\x64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\um\x64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\ucrt\x64" /SUBSYSTEM:WINDOWS @"C:\Users\Gebruiker\AppData\Local\Temp\tmp16E2.tmp"
    37.  
    38. LINK : fatal error LNK1181: cannot open input file 'Shell32.lib'
    39.  
    40.   at Unity.IL2CPP.Building.CppProgramBuilder.PostprocessObjectFiles(HashSet`1 objectFiles, CppToolChainContext toolChainContext)
    41.   at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
    42.   at il2cpp.Compilation.CompilationDriver.Run(RuntimePlatform platform, BuildingOptions buildingOptions)
    43.   at il2cpp.Program.DoRun(String[] args, RuntimePlatform platform, BuildingOptions buildingOptions)
    44.   at il2cpp.Program.Run(String[] args, Boolean setInvariantCulture)
    45.   at il2cpp.Program.Main(String[] args)
    46.  
    47. UnityEngine.Debug:LogError(Object)
    48. UnityEditorInternal.Runner:RunProgram(Program, String, String, String, CompilerOutputParserBase)
    49. UnityEditorInternal.Runner:RunNetCoreProgram(String, String, String, CompilerOutputParserBase, Action`1)
    50. UnityEditorInternal.IL2CPPBuilder:RunIl2CppWithArguments(List`1, Action`1, String)
    51. UnityEditorInternal.IL2CPPBuilder:ConvertPlayerDlltoCpp(Il2CppBuildPipelineData, String, String, Boolean)
    52. UnityEditorInternal.IL2CPPBuilder:Run()
    53. UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, IIl2CppPlatformProvider, Action`1, RuntimeClassRegistry)
    54. DesktopStandalonePostProcessor:SetupStagingArea(BuildPostProcessArgs, HashSet`1)
    55. DesktopStandalonePostProcessor:PostProcess(BuildPostProcessArgs)
    56. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
    57.  
     
  8. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    760
    I'll double check if we don't have any issue with IL2CPP on this version but as a workaround, you can try to build a player with mono, see if that helps.

    I'll make sure the 64 bits thingy is mentioned in the documentation.
     
  9. Beervangeer

    Beervangeer

    Joined:
    Dec 4, 2012
    Posts:
    20
    @chap-unity thank you very much, it's now working fine! It only works with x86_64, you are right.
     
    chap-unity likes this.
  10. Beervangeer

    Beervangeer

    Joined:
    Dec 4, 2012
    Posts:
    20
    I think there something weird, because I installed IL2CPP with unityhub together with the 2020 install of Unity.
    I removed the Windows SDK from my computer and installed it again from the windows website.
    It now works fine.
     
  11. RadonRaph

    RadonRaph

    Joined:
    Jun 12, 2016
    Posts:
    3
    @chap-unity Things still not in the documentation :/
     
  12. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    760
    Camarent and Lex4art like this.