Search Unity

  1. We've closed the job boards. If you're looking for work, or looking to hire check out Unity Connect. You can see more information here.
    Dismiss Notice
  2. We're running great holiday deals on subscriptions, swag and Asset Store packages! Take a peek at this blog for more information!
    Dismiss Notice
  3. Check out our Unite Austin 2017 YouTube playlist to catch up on what you missed. More videos coming soon.
    Dismiss Notice
  4. Unity 2017.2 is now released.
    Dismiss Notice
  5. The Unity Gear Store is here to help you look great at your next meetup, user group or conference. With all new Unity apparel, stickers and more!
    Dismiss Notice
  6. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice
  8. Unity 2017.3 beta is now available for download.
    Dismiss Notice

Invalid Pass Number Error?

Discussion in 'Windows' started by cthomas1970, Nov 13, 2017.

  1. cthomas1970

    cthomas1970

    Joined:
    Sep 12, 2017
    Posts:
    21
    Hey, first time trying to develop a game using Unity. I have got to the stage where I need to test on XBOX One, which I plan to use, along with Windows, as my initial publishing target.

    I currently pub from Unity using these player settings

    Player
    Scripting Runtime Version : Stable .Net 3.5 equiv
    Scripting Backend : IL2CPP
    Api Compatibility Level : .NET 2.0 Subset

    BUILD SETTINGS : Universal Windows Platform
    Target : Any Device
    Build Type D3D
    SDK : 10.0.16299.0
    Build on : Local Machine

    Built as RELEASE for x64

    So, two main issues. My main one, is that when I port this over to my XBOX One, and start, I get these errors

    Invalid Pass Number (x) for Graphics Blit ( Meterial Hidden/BilateralBlur with 1 pass)

    This line repeats twice for Passes 2,3 and 5 I also get a similar error for pass 10, where the shader is listed as Unknown Material

    Now, when I install the same package on the Windows machine that built it, and run, I don't get these errors. I do get a null error, where some var is not assigned as planned, but it does not stop me from selecting a level, and playing the game. So on Windows, some decent progress, but XBox is severely stuck in the mud.

    Some background. In my game, I have one scene which is omni-present, and which contains my in game camera, player, game manager etc. I then load scenes additively into this, and in each level scene there is a PREVIEW CAMERA, which does a carousel of each level on the start screen.

    My guess is, I have the Unity Post Processing effects active on all cameras, and that means with the In Game and Preview camera, I would get two sets of the same error?

    I tested this, by disabling the post processing Components from all cameras, but after re-build, same issue. Thats not to say I'm not on the right trail? BTW, I dont make use of Bilaterial Blur in ANY other way, as far as I am concerned, and looking in the Post Processing shaders, I can see it DOES make use of Blit, and Bilateral Blur, so....

    So thats the main issue. Second issue is.. Is it possible to get more meaningful Debug info when running on Windows/ XBox, I am totally devoid of a lot of context, for instance, line numbers from code is missing, and Im not sure of what tools are avail to track this down a little better. The NULL pointer issue is there, and I see other issues as well, but the logging output is so bare its hard to work out exactly where to make fixes.
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    4,637
    Hi,

    regarding the first issue: I assume you don't get those errors when deploying as Universal Windows Platform app on PC? Is that shader a shader that you wrote yourself, or is it something from built-in shaders in Unity?

    Regarding debugging: the debugger situation with il2cpp scripting backend is dire right now. We don't have a C# debugger available, but we are working on it. The best you can do is step through the generated C++ code in Visual Studio. There should be source code annotations of original C# code above the equivalent generated C++ code.
     
  3. cthomas1970

    cthomas1970

    Joined:
    Sep 12, 2017
    Posts:
    21
    Hey, thanks for the reply. So...

    Yes, when I install the same package on my PC (the machine on which I published) I dont get the same errors. I DO have other errors, but tha'ts another story, which, I can probably make some progress on. I can see that in VS, if I attach Debug to the installed App, I do get some better logs i.e. actual class.method names, so thats useful. But I'm not sure at this stage, if I can do the same thing with my XBOX. All pretty new stuff.

    So I have two types of shaders in my project. The default Unity shader, I cant imagine that is the issue? And the second is SHADER FORGE derived code. I don't think ether is using blit bilattteral blur, I did a trawl for it in my own project, and did find it referenced in several shaders in the Unity Post-processing Stack, so it seems to be the smoking gun.

    As to HOW to fix, I have no idea. And NOT using the Stack does not seem very attractive...


    As I said above, running my App on PC, using its Debug Installed App Package... did give some new insight to other bugs. Im still learning the best approaches for Unity, and I have been storing level data in .json files on disk, which worked fine in the Editor, but this seems pretty broken in the UWP, not sure why. So maybe that needs re-thinking. Any tips in this regard, from anyone, most appreciated ;)
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    4,637
    Do you get the same errors on PC if you pass "-force-feature-level-10-0" command line argument to the app? This is how you can do it:

    https://docs.unity3d.com/Manual/CommandLineArguments.html

    I have a suspicion that the shader depends on DirectX 11 feature level 11.0, and Xbox only supports up to DirectX 11 feature level 10.1.

    As for storing data in JSON: what exactly is broken about it?
     
  5. cthomas1970

    cthomas1970

    Joined:
    Sep 12, 2017
    Posts:
    21
    Absolutely bang on the money. Started Unity with that flag, same errors appeared in the console, and when I started the game, graphics were totally black, apart from particles.

    So, if the Post Processing Stack requires 11.0, and XBOX One only supports 10.0, is there a way I can get around this? I've kind of built the whole look of my game on using the Unity Post Processing Stack. It would be a major undertaking to rip it out and, well, replace it with?


    Each level has a json file, numbered to match, I guess this could be a single file, but its how I have done level load data till now. This file contains the levels title, what things the player can do, the music volume level and such. This seems to be failing to load, as I have a null pointer error, which suggests the file data is missing, and each level is missing its title on the load screen.

    It works in Editor, but not when installed as a UWP app.

    I have put the files in a folder Asset/Resources/LevelData, and I am accessing using /Asset as the base of this path. Maybe that's my issue? Ill try using the Application.dataPath as the root, and see if that fixes it.
     
  6. cthomas1970

    cthomas1970

    Joined:
    Sep 12, 2017
    Posts:
    21
    OK, quick update on this, I now generate my level data file location like this...

    levelDataPath = Path.Combine(Application.dataPath, "Resources/LevelData/");

    When in the Editor, this resoves to my projects path /Assets/ and the .json files at that location are found and read. When installed as a UWP, I run in debug mode, and I can see its trying to get the files from here....

    C:/Program Files/WindowsApps/MyAppsName/Data\Resources/LevelData/filename.json

    And if I navigate to that folder, no files are present. So... Am I following the right path for this workflow? It appears not. If I am, shouldn't the app be placing the relevant files at that location?

    UPDATE
    I see there is this Application.streamingAssetsPath , looks like the solution, Ill give it a whirl
     
    Last edited: Nov 14, 2017
  7. cthomas1970

    cthomas1970

    Joined:
    Sep 12, 2017
    Posts:
    21
    OK, so level JSON file issue is fixed. So the main issue remains. Am I able to use the Post Processing Stack on the XBox One? Or do I have to find another solution?
     
  8. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    4,637
    I'll ask around.
     
  9. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    4,637
    Which version of postprocessing stack are you using? I couldn't find any references to Hidden/BilateralBlur in our stack, so the fact that you found it referenced from there is highly suspicious. Our postprocessing stack should fully work on 10.1 level hardware.
     
  10. cthomas1970

    cthomas1970

    Joined:
    Sep 12, 2017
    Posts:
    21
    Hey, so an update. The Processing Stack was not the issue. I had a Volumetric light script, and it appears that was causing the problem. I guess it was not written to detect the level 11.0 you mentioned, and disable itself gracefully.

    So I have my game working on XBOX now, which is great, so thanks for your help on that.

    So, can you recommend another more compatible Volumetric light system?