Search Unity

render ShadowPass twice with different scriptableCullingParameters

Discussion in 'General Graphics' started by j_pedrero, Jan 22, 2019.

  1. j_pedrero

    j_pedrero

    Joined:
    Jan 7, 2019
    Posts:
    10
    Hello,
    I am trying to accomplish something like this:
    https://www.slideshare.net/UnityTechnologiesJapan/cedec2018scriptable-render-pipeline

    (Pages 73-84)
    Modifying the Lightweight Rendering Pipeline Source.

    So far I managed to create a custom shadow pass, and render it twice using different scriptableCullingParameters

    although on the frame debug window I can see it renders twice, on my screen I can only see it once
    upload_2019-1-22_19-38-46.png

    I beleive it has something to do with the way I set the render Targets:

    Code (CSharp):
    1. CoreUtils.SetRenderTarget(cmd, m_MainLightShadowmapTexture, ClearFlag.Depth, CoreUtils.ConvertSRGBToActiveColorSpace(m_CurrCamera.backgroundColor));
    2.      
    3. SetRenderTarget(cmd, m_MainLightShadowmapTexture, RenderBufferLoadAction.DontCare,
    4. RenderBufferStoreAction.DontCare, ClearFlag.None, Color.black, TextureDimension.Tex2D);


    If any one has any clue it will be much appreciated.
     
    Last edited: Jan 22, 2019
  2. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    584
    I'm not sure what you are trying to achieve. What would you expect to appear on screen by rendering twice the shadowmap?
     
  3. j_pedrero

    j_pedrero

    Joined:
    Jan 7, 2019
    Posts:
    10
    Im trying to render in this order:
    1. render realtime shadows
    2. render Static Objects
    3. render static baked shadows
    4. render dynamic objects
    as it is shown here:
    https://www.slideshare.net/UnityTechnologiesJapan/cedec2018scriptable-render-pipeline
    Page 83
    https://github.com/wotakuro/MixedShadowSample

    the final goal is to have a pass with only BAked shadows and a pass with only dynamic shadows
     
    Last edited: Jan 23, 2019