Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Git and SRP problems

Discussion in 'Graphics Experimental Previews' started by Nothke, Nov 16, 2018.

  1. Nothke

    Nothke

    Joined:
    Dec 2, 2012
    Posts:
    112
    Hi, I am trying to download the SRP package from github, because I want to try out the VFX graph and to stay up to date with HDRP, and have spent a day struggling to get it to work... I didn't want to ask anyone for help so far because I think all the time "I must be really stupid and I'm missing something.." but now I'm at the end of my nerves so would love to have some help.

    First, let me say I'm using the latest 2018.3.0b10 Unity version. I followed the instructions and used

    git clone https://github.com/Unity-Technologies/ScriptableRenderPipeline.git --branch release/2018.3


    That worked fine, then, although the VFX forum post doesn't mention it, but the other readme on github tells, I used

    git submodule update --init --recursive --remote


    Ok, that did... Something... Not exactly sure what (cmd did not output anything) or if I'm supposed to do it because other tutorials don't say it

    Now, I opened Unity. After a while of loading everything, I get a bunch of errors. FIrst, there was this..



    Appears that every test folder has assembly definition files named the same way. Why is that??
    Since these are tests, I realized I can just remove the whole "TestProjects" folder. I did and the errors were now gone.



    Ok, next, the SRP is looking for post processing, ok, so I installed the Post Processing package from package manager. Now it finally compiled and I can run it.. But... There is a bunch of shader errors



    To be precise there are 529 errors. There is 3 types of errors
    1. shader keywords exceeded, example:

    Maximum number (256) of shader keywords exceeded, keyword _ENABLESPECULAROCCLUSION_OFF will be ignored.
    You will have to delete some shaders or make them use less keywords.


    2. missing templates, example:

    Template not found: Packages/com.unity.render-pipelines.high-definition/Editor/Material\Lit\ShaderGraph\HDLitPass.template
    UnityEditor.Experimental.AssetImporters.ScriptedImporter:GenerateAssetData(AssetImportContext)


    3. and failed to open source file:

    Shader error in 'HDRenderPipeline/StackLit': failed to open source file: 'Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl' at line 352 (on d3d11)


    As a result HDRP materials are categorized under "Failed to compile":


    And also, HDRP pipeline file is nowhere to be found!?!? LWRP is there, but no HDRP.



    As a side note, I thought my GPU might not support these shaders and hence they can't compile, but HDRP is running fine via package manager, it's just that github does not.

    I am surprised tutorials end up with "oh just clone the git repository.." and everyone appears to have no issues.. No one mentions the assembly definition problem (at least I couldn't find), and any of issues I'm having.

    I constantly have this feeling of "I must be missing something", but I go back to reread the github notes and it doesn't appear that I am...

    I hope you can help me get it running, I really want to try out the new VFX graph :)
     
    Last edited: Nov 16, 2018
  2. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    That bit is no longer necessary. But running the command won't do any harm, it just won't do any good either!

    You should not need to install the post-processing, that should happen automatically because the package.json file in HDRP already lists it as a dependency.

    I think the big problem you have is where you have put the files that you got from GitHub. They are not supposed to live inside your projects Assets folder at all!

    Proper solution for this is to either:

    1) Put the ScriptableRenderPipeline folder inside your project folder, but not inside the Assets folder. Use the plus button in the package manager and then select the package.json file inside one of the package folders. Repeat for the other packages you need (eg do this for com.unity.render-pipelines.core, com.unity.render-pipelines.high-definition, com.unity.shadergraph, com.unity.visualeffectgraph).

    OR

    2) Same as above but manually edit your manifest.json file inside your Packages folder to point to those packages. Probably no point trying this method since results are the same as if following option 1 above, but its easier to let package manager do it than try to do it manually.

    OR

    3) Move the com.unity.render-pipelines.core, com.unity.render-pipelines.high-definition, com.unity.shadergraph, com.unity.visualeffectgraph folders so that they are inside the Packages folder of your project.

    THEN...

    Assuming your test project is pretty empty, and that you want to see the test scenes, you should copy the contents of ScriptableRenderPipeline/TestProjects/VisualEffectGraph to your Assets folder, in a way that overlaps what is already there. ie files from ScriptableRenderPipeline/TestProjects/VisualEffectGraph/Assets end up in your Assets folder, and files from ScriptableRenderPipeline/TestProjects/VisualEffectGraph/ProjectSettings overwrite the files in your existing projectfolder/ProjectSettings folder. Don't bother copying file from ScriptableRenderPipeline/TestProjects/VisualEffectGraph/Packages.

    If there are any errors from .cs files in the AllTests etc folders, you can probably just delete those files, it won't stop you being able to load the test scenes.

    When HDRP is working properly, it is quite normal to create your own pipeline definition file (via create menu) rather than use the supplied one.
     
    MadeFromPolygons likes this.
  3. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,976

    Thanks for this post, while I wasnt having this issue, reading this made me realise I have been using package manager wrong with git the entire time!

    As stupid as it may make me look, I hadnt realised there was a way to load packages from disk through the manager!

    Thanks!
     
  4. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    I don't think the feature existed till recently, had to edit file manually before they added this feature. I forget exactly when they added it but I only used the plus button myself for the first time this week.
     
    MadeFromPolygons likes this.
  5. Nothke

    Nothke

    Joined:
    Dec 2, 2012
    Posts:
    112
    OMG, when I said "I have a feeling I'm missing something" this was exactly it :D Just did the stuff you said about adding packages with '+' and it works perfectly.

    Now I see that mentioned in the github readme "This repository consists of a folder that should be cloned outside the Assets\ folder of your Unity project." I missed that. But also the note about the new + button should absolutely be added to the readme and the VFX graph "how to get it" page mentions none of that
     
    elbows likes this.