Search Unity

  1. We are looking for feedback on the experimental Unity Safe Mode which is aiming to help you resolve compilation errors faster during project startup.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Feedback Wanted: Scriptable Render Pipelines

Discussion in 'Graphics Experimental Previews' started by Tim-C, May 9, 2017.

  1. interpol_kun

    interpol_kun

    Joined:
    Jul 28, 2016
    Posts:
    133
    But feedback is still necessary.
     
  2. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,516
    (It's still pretty experimental though...)
     
  3. BattleAngelAlita

    BattleAngelAlita

    Joined:
    Nov 20, 2016
    Posts:
    210
    Now, after finishing migration spr repository to graphics repository, i hope unity graphics team finally had time to implement some critical srp features:
    1 - RenderWithShader analogue
    2 - multipass shaders
    3 - ability to replace shadowcaster shader, and shadow buffer format(i.e. for VSM)
    4 - proper Fallback. In standard rendering i can just put utility passes in the last shader in Fallbacks chain(i.e. old shaders had "LightMode" = "Vertex", "LightMode" = "ShadowCaster", "LightMode"="Meta" in last Fallback). In SRP this dos'nt work

    And will be great if you setup CameraType.Reflection for camera.RenderToCubemap
     
    guycalledfrank likes this.
  4. BattleAngelAlita

    BattleAngelAlita

    Joined:
    Nov 20, 2016
    Posts:
    210
    Looks like thread is dead.
     
  5. jjxtra

    jjxtra

    Joined:
    Aug 30, 2013
    Posts:
    1,185
    I’ve been telling my users to stick with standard pipeline for the time being. SRP has potential but still a lot of wrinkles to work through.
     
    tatoforever and tspk91 like this.
  6. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,309
    Yes please. Probably they didn't because it wasn't efficient?... I never felt good about feeding strings into it, I hope it didn't literally perform string comparisons for every shader.

    Additional point to that: it always makes me nervous to use Enable/DisableShaderKeyword in rendering code (e.g. enable->render pass->disable->render other pass). Is it fast? Should I avoid it? Can we get precomputed keyword hashes instead of strings maybe?

    If you blur the VSM, it is actually a good idea to render to standard depth first to save bandwidth. Convert to VSM during first blur pass.
    Also shadowcaster shader can be replaced, it's just your shader needs to have a pass named "ShadowCaster".
     
    Last edited: May 16, 2020
    cecarlsen likes this.
  7. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,309
    Is there any explanation for SRP batcher not being compatible with built-in lightmap variables? :|

    upload_2020-5-16_22-37-30.png

     
  8. mukki014

    mukki014

    Joined:
    Jul 30, 2017
    Posts:
    113
    Did anyone tried URP on Android? Open gl es 3.1 or vulkan? If yes then how's the performance compared to built in render pipeline? Thank you
     
  9. BattleAngelAlita

    BattleAngelAlita

    Joined:
    Nov 20, 2016
    Posts:
    210
    I want to do RSM, so i need mini g-buffer instead of simple depth map.

    Problem is that EVERY shader need to have that specific pass. SRP can't do proper fallback to certain pass, like in old days shaders.

    Unity already feed some per material properties to "overrideMaterial", like light/reflection probes and lightmaps. All they need to do is feed other material properties to this "overrideMaterial"
     
    guycalledfrank likes this.
  10. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,309
    Further investigation: https://twitter.com/guycalledfrank/status/1261917956021407755
    It doesn't work with unity_LightmapST in UnityPerDraw, but does if you also add unity_DynamicLightmapST o_O

    EDIT: actually it turns out I missed the "blocks" idea: https://blogs.unity3d.com/2019/02/28/srp-batcher-speed-up-your-rendering/

    I guess then your only way is to draw renderers with overrideMaterial and use layers or renderQueue to split the drawing into multiple passes with different shader variation (opaque, alphatest, etc). Very cumbersome, yes.
     
    Last edited: May 17, 2020
  11. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,309
    Is there a way to know if a particular shadow cascade covers any objects? CullingResults.GetShadowCasterBounds gives it for the whole light (full shadow distance), but then after I set split data/matrices and call DrawShadows(), it may not overlap any objects and don't do anything... which is OK unless you expect to prepare/process the texture. In my case I convert depth to VSM, so clear & conversion happens even if nothing was drawn.
     
  12. BattleAngelAlita

    BattleAngelAlita

    Joined:
    Nov 20, 2016
    Posts:
    210
    Interesting, how many people are actually make their own render pipe?
     
  13. valarus

    valarus

    Joined:
    Apr 7, 2019
    Posts:
    175
    guycalledfrank likes this.
  14. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,309
    Just had to rewrite my shadow rendering from using DrawShadows to regular DrawRenderers, because I didn't want to cull/use visible lights (mine are static & worldspace) and it worked great. Now I'm wondering why would anyone use DrawShadows anyway? Probably because it checks for "cast shadows" on renderers (not a problem in my case, just using rendering layers instead)?

    Is there a changelog anywhere?
     
    valarus likes this.
  15. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,309
    Is there any point in cullParams.cullingPlaneCount option? Attempting to set it to anything other than 6 results in "Assertion failed on expression: 'params.cullingPlaneCount == kPlaneFrustumNum'" spamming. Wanted to cull without using 2 planes I didn't need, and it worked, (or looked like so) but got super slow due to infinite error spamming :D
     
  16. valarus

    valarus

    Joined:
    Apr 7, 2019
    Posts:
    175
unityunity