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

Error code on wiki of SRP

Discussion in 'Graphics Experimental Previews' started by kakashi8841, Nov 8, 2018.

  1. kakashi8841

    kakashi8841

    Joined:
    Apr 27, 2018
    Posts:
    10
    I have found error on https://github.com/Unity-Technologies/ScriptableRenderPipeline/wiki/SRP-Drawing

    In section "Draw Settings: How things should be drawn", code in first line is :

    Code (CSharp):
    1. var drs = new DrawRendererSettings(Camera.current, new ShaderPassName("Opaque"));
    This code will lead unity to crash, because Camera.current is null in game view while Editor do not in Play mode, and pass a null camera to DrawRendererSettings method make unity crash.

    I think we can use Camera.main or iterate the cameras parameter which from the Render method.

    I use Unity 2018.3.0b7 (64-bit).