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

The video is not render when use custom render pipeline.

Discussion in 'Graphics Experimental Previews' started by watsonsong, Mar 14, 2018.

  1. watsonsong

    watsonsong

    Joined:
    May 13, 2015
    Posts:
    555
    How to support the video render for custom render pipeline?
    The video is black seems the shader is not support.

    I add the "SRPDefaultUnlit" to the DrawRendererSettings as the following code, is there any thing I missed?

    var drawFlag = DrawRendererFlags.EnableDynamicBatching |
    DrawRendererFlags.EnableInstancing;
    var drawSettings = new DrawRendererSettings(camera, LitPassName)
    {
    sorting = { flags = SortFlags.CommonOpaque },
    rendererConfiguration = rendererConfig,
    flags = drawFlag,
    };

    drawSettings.SetShaderPassName(1, UnlitPassName);
     
  2. watsonsong

    watsonsong

    Joined:
    May 13, 2015
    Posts:
    555
    BTW, the lightweightsrp seems not support the video shader either.
     
  3. watsonsong

    watsonsong

    Joined:
    May 13, 2015
    Posts:
    555
    Is there any one known about this issue?
    I add a video player and run the scene like this:


    But I can see any two clear command in the frame debugger(for there has two camera in the scene):


    I am draw the scene with this code:
    Code (CSharp):
    1.  
    2. // Setup the default renderer config.
    3. var rendererConfig =
    4.     RendererConfiguration.PerObjectLightmaps |
    5.     RendererConfiguration.PerObjectLightProbe |
    6.     RendererConfiguration.PerObjectReflectionProbes;
    7.  
    8. // Draw opaque objects using BasicPass shader pass.
    9. var drawFlag = DrawRendererFlags.EnableDynamicBatching |
    10.     DrawRendererFlags.EnableInstancing;
    11. var drawSettings = new DrawRendererSettings(camera, LitPassName)
    12. {
    13.     sorting = { flags = SortFlags.CommonOpaque },
    14.     rendererConfiguration = rendererConfig,
    15.     flags = drawFlag,
    16. };
    17.  
    18. drawSettings.SetShaderPassName(1, UnlitPassName);
    19.  
    20. var filterSettings = new FilterRenderersSettings(true)
    21. {
    22.     renderQueueRange = RenderQueueRange.opaque
    23. };
    24.  
    25. context.DrawRenderers(
    26.     cull.visibleRenderers, ref drawSettings, filterSettings);
    27.  
    28. // Render objects that did not match any shader pass with error
    29. // shader.
    30. this.RenderObjectsWithError(
    31.     ref context, filterSettings, SortFlags.None);
    32.  
    33. // Draw skybox
    34. context.DrawSkybox(camera);
    35.  
    36. // Draw transparent objects using BasicPass shader pass
    37. drawSettings.sorting.flags = SortFlags.CommonTransparent;
    38. filterSettings.renderQueueRange = RenderQueueRange.transparent;
    39. context.DrawRenderers(
    40.     cull.visibleRenderers, ref drawSettings, filterSettings);
    41.  
    42. // Render objects that did not match any shader pass with error
    43. // shader.
    44. this.RenderObjectsWithError(
    45.     ref context, filterSettings, SortFlags.None);
    46.  
    Is there any thing I am missing?
     

    Attached Files:

  4. watsonsong

    watsonsong

    Joined:
    May 13, 2015
    Posts:
    555
    I test do not use the SRP and the video is render by the Draw GL command:
     

    Attached Files:

  5. watsonsong

    watsonsong

    Joined:
    May 13, 2015
    Posts:
    555
    I change to use material override render mode, and add all legency pass into the SRP, the video is rendered.



    But the SRP is not support the Camera Plane mode(because it use the GL.Draw I think). And I add the following code in my SRP:
    Code (CSharp):
    1. var drawSettings = new DrawRendererSettings(camera, LitPassName)
    2. {
    3.     sorting = { flags = SortFlags.CommonOpaque },
    4.     rendererConfiguration = rendererConfig,
    5.     flags = drawFlag,
    6. };
    7.  
    8. drawSettings.SetShaderPassName(1, UnlitPassName);
    9. for (int i = 0; i < LegacyPassNames.Length; ++i)
    10. {
    11.     drawSettings.SetShaderPassName(i, LegacyPassNames[i]);
    12. }
    I think the SRP is not support the video player in a proper way.
     

    Attached Files:

  6. NorthStar79

    NorthStar79

    Joined:
    May 8, 2015
    Posts:
    88
    thank you for post'ng this. It helped me.
     
  7. LeroyHermans

    LeroyHermans

    Joined:
    Feb 26, 2017
    Posts:
    2
    Hey,

    I am currently encountering the same problem. How and where did you add the code to the render pipeline? i cannot figure out where to add.

    Hope to hear from you
     
  8. dpotuznik

    dpotuznik

    Joined:
    Jan 18, 2018
    Posts:
    17
    Me too please help us :)
    i try to play a video on HDRP but so far no luck ...
    Best Regards
    Daniel
     
  9. dpotuznik

    dpotuznik

    Joined:
    Jan 18, 2018
    Posts:
    17