Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Hybrid Renderer V2 Nintendo Switch support?

Discussion in 'Graphics for ECS' started by Fancisco_Greco, Jan 26, 2021.

  1. Fancisco_Greco

    Fancisco_Greco

    Joined:
    Jan 26, 2021
    Posts:
    20
    Are there any news about Hybrid renderer V2 support on Nintendo Switch?
     
    Nyanpas likes this.
  2. Nyanpas

    Nyanpas

    Joined:
    Dec 29, 2016
    Posts:
    406
    Is this for Hevolus?
     
  3. AlexHolderDev

    AlexHolderDev

    Joined:
    Jul 2, 2014
    Posts:
    35
    I haven't touched this stuff in like 6 months, but wasn't it the case that HDRP doesn't work on the Switch while URP does work? The Hybrid Renderer V2 worked, but HDRP didn't. But I could be very out of the loop
     
  4. Fancisco_Greco

    Fancisco_Greco

    Joined:
    Jan 26, 2021
    Posts:
    20
    I'm using URP but I'm getting the
    error with Unity 2020.2.1f1 and hybrid renderer 0.11
     
  5. AlexHolderDev

    AlexHolderDev

    Joined:
    Jul 2, 2014
    Posts:
    35
    I got that error on a first attempt of a build, but then re-attempting the build did not encounter the error. Everything works on the Switch for me;

    Unity 2020.2.2f1
    Hybrid Renderer 011.0-preview.42 (dependent on Entities 0.17.0-preview.41)

    My steps:
    • I made a project with the URP template
    • Installed the Hybrid Renderer package
    • Enabled the V2 renderer
    • Created a material using the default shader (Universal Render Pipeline/Lit)
    • Enabled GPU instancing on the material
    • Applied the material to some spheres in the sample scene
    • Did a build & run for the Switch platform
    Other than upgrading Unity, everything else should be the same unless you've also made & used a custom shader as well. My stuff looks like this (the error is a seemingly-unrelated error talked about in this other thread):
     
    Fancisco_Greco likes this.
  6. Fancisco_Greco

    Fancisco_Greco

    Joined:
    Jan 26, 2021
    Posts:
    20
    Interesting, just tried following your steps but I keep getting the same error regardless of how many times I rebuild, did you use ConvertToEntity to convert your spheres?
     
  7. AlexHolderDev

    AlexHolderDev

    Joined:
    Jul 2, 2014
    Posts:
    35
    Ah, that's a pretty important step to mention. I hadn't done that, but I have now and now I get that same message that you get when I test a the build.

    When that error starts occurring, I also get this message when doing editor builds: "WARNING: Hybrid Renderer using error shader for batch with an erroneous material." I saw other threads that suggested disabling the SRP batcher in the pipeline asset settings to fix that, and it made no impact or change for me throughout any of this process.

    I went through the shader selection on the custom lil test material again and noticed that the URP/Lit shader was now in a "Failed to compile" category. I tried selecting URP/Simple Lit, running a build, and got the same error again. After that, the Simple Lit shader ended up in that "Failed to compile" category too.

    Then, I found the shaders in the project asset window in the Packages section. I selected the 2 affected shaders & reimported them. Entering playmode in the editor showed no errors & no graphical issues.

    So, I tried doing another build to the Switch. The build failed and the shader ended up in the "Failed to compile" category again. Building again after that goes successfully, but does cause the error message & invisible entities to happen within the build.

    Trying to manually make the shaders compile by selecting their asset and clicking the "compile & show code" button in their inspector doesn't yield any reasonable change or progress. A popup appears that says "Universal Render Pipeline/Lit: (a number here) of 735", but the number goes waaaaaaaaaaaay above 735 and doesn't have any clear sign of finishing its compilation. I didn't want to wait 10+ minutes to see if that would end up working.

    I switched platform for the project over to Windows/Standalone and everything works fine there. Even the shaders that failed to compile for Switch work fine without any changes in the Windows x64 build.

    ...So... I have no other ideas here. My spheres don't show up at all now, as seen here.

    Project that I'm using is now up on Github here: https://github.com/AlexHolderDeveloper/HybridRendererV2-ReproProject
    It shouldn't have any secret Switch-specific stuff in it, but may make it private after some time to be safe anyway.
     
    Last edited: Feb 6, 2021
    Fancisco_Greco likes this.
  8. AlexHolderDev

    AlexHolderDev

    Joined:
    Jul 2, 2014
    Posts:
    35
    If it helps, I've made a thread in the Nintendo developer forum under the English/Unity/Graphics category. We can go into more Switch-specific detail there if needed, as it does just seem like something in the Switch platform thingy for Unity is affecting how the shaders are compiling.
     
    Fancisco_Greco likes this.
  9. Fancisco_Greco

    Fancisco_Greco

    Joined:
    Jan 26, 2021
    Posts:
    20
    Yeah it seems like the shaders failing to compile is what's causing the spheres to become invisible, it also seems like we will need to wait for the next version of the Hybrid Renderer to have console support, after all the docs say support is planned for 2020.2. Maybe the devs can shed some light on this?
     
  10. AlexHolderDev

    AlexHolderDev

    Joined:
    Jul 2, 2014
    Posts:
    35
    As a work-around for now, as mentioned in the Switch forum thread:

    Make your own shaders, do not use the built-in Unity URP shaders. Make them in the Shader Graph system if you have to!

    I finally have entities working with URP materials thanks to that lil workaround, though builds on the Switch platform seem to think that the SRP Batcher is disabled & throws a harmless error about it (even when SRP Batcher is enabled in all relevant URP assets).

    More debugging & work may be needed on Unity's end, but for now I can at least see my URP-rendered entities in Switch platform builds.
     
    Fancisco_Greco likes this.