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

Feedback Wanted: Scriptable Render Pipelines

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

  1. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    You can't, there is no room in GBuffer for this. (We chose to have an aggressive optimize gbuffer)
     
  2. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    Yes, it is name Fade Distance in shadow data.
    However currently even if it save GPU drawing, the CPU is still executed :(
     
  3. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    Not yet. VR support is in progress but not working for the moment.
     
    ZenUnity and Alverik like this.
  4. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    Many question :)
    Short answer: We plan to support output of normal for forward opaque during depth press (or motion vector pass if it is enabled).

    no mode for high quality normal. Our normal are encoded on 24bit rectangular octahedral (in latest version), this is already a good quality. If you aim for more quality, go forward, or edit the code to change to a FP16 render target (if you project can afford it), and just save normal xyz in RGB.
     
    DanielDickinson likes this.
  5. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    No plan for this currently. Too low priority for us at the moment. The LightLoop is both C# and shader. And we use material classification, mean you are link to our Lit.cs material. Hard to decorrelated or abstract all this.
     
  6. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    1. Details mask

    2. SSS radius is just a SSS mask (this has been rename). Just allow you to switch off the effect where you don't want it.
    Thickness map can be created with inverse normal AO baking: https://support.allegorithmic.com/documentation/display/SPDOC/Thickness
    Caution: Thickness map mean we store thickness. white is thick and black is thin.

    3. Doc is coming soon for this. Layered shader is a bit complex...

    4. Bent normal is average unoccluded normal direction. Can be generated with Knald or XNormal. Allow to have a better Global illumination (Less light leaking)

    5. Default shadow bias in HD are poor, try to tweak them and the near plane of the shadow/
     
  7. DanielDickinson

    DanielDickinson

    Joined:
    Aug 4, 2013
    Posts:
    278
    @Zahidylin_Marat - Copy the contents of the folder into your new project.
     
    Last edited: Feb 3, 2018
  8. DanielDickinson

    DanielDickinson

    Joined:
    Aug 4, 2013
    Posts:
    278
    @SebLagarde - Alright, fair. But in the interests of playing around with it, I still have a few questions -

    What do you mean by material classification? Is there something stopping me from writing custom shaders for your loop? Assuming I follow the same standards (Pass names, Data structures, Shader macros etc.) your shaders are currently using? Don't get me wrong, picking through it all is currently a bit of a maze, but I think I have my head around most of it.

    From what I can tell your light loop currently only needs a depth buffer (as a base) and a stencil buffer (as a mask?) to work with. Is there any reason I couldn't generate my own Gbuffers, resolve my own depth and write my own custom light loop shader method using the same buffers generated conveniently by the light loop?

    Writing the above, I'm beginning to see your point, but I'm definitely still interested.
     
  9. petersx

    petersx

    Joined:
    Mar 5, 2015
    Posts:
    239
    But specular map is very important to create real-world like skin shader. There is no room now or never ?
     
  10. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Is the cpu bound gonna be improved in the future?
     
  11. Zahidylin_Marat

    Zahidylin_Marat

    Joined:
    Jul 28, 2012
    Posts:
    114
    Didnt help - geting error.

    Code (CSharp):
    1. NullReferenceException
    2. UnityEditor.InspectorWindow.HasLabel (UnityEngine.Object target, System.String assetPath) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:647)
    3. UnityEditor.InspectorWindow.HasLabel (UnityEngine.Object target) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:642)
    4. System.Linq.Enumerable+<CreateWhereIterator>c__Iterator1D`1[UnityEngine.Object].MoveNext ()
    5. System.Collections.Generic.List`1[UnityEngine.Object].AddEnumerable (IEnumerable`1 enumerable) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:128)
    6. System.Collections.Generic.List`1[UnityEngine.Object]..ctor (IEnumerable`1 collection) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:65)
    7. System.Linq.Enumerable.ToArray[Object] (IEnumerable`1 source)
    8. UnityEditor.InspectorWindow.GetInspectedAssets () (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:663)
    9. UnityEditor.InspectorWindow.DrawPreviewAndLabels () (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:679)
    10. UnityEditor.InspectorWindow.OnGUI () (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:449)
    11. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    12. Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    13. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
    14. System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
    15. UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:291)
    16. UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:284)
    17. UnityEditor.HostView.InvokeOnGUI (Rect onGUIPosition) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:251)
    18. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
     
  12. Dhialub

    Dhialub

    Joined:
    Nov 11, 2013
    Posts:
    41
    And performance is even more important for real time applications. The results are quite good already, if you use a proper roughness map. You can also set the specular intensity of the material in the SSS settings (although it's global and not a map).
     
  13. petersx

    petersx

    Joined:
    Mar 5, 2015
    Posts:
    239
    Ok, I'm not expert - but if we wait so long for sss in Unity why this is worse than f.e. UE4 ?
     
  14. Dhialub

    Dhialub

    Joined:
    Nov 11, 2013
    Posts:
    41
    Actually I like the implementation more in Unity, albeit the differences are negligible.
    As far as I know, specular color doesn't vary that much. Occlusion in the pores are better handled by the ao map, normals and roughness.
    Even the official UE material guide reccomends to leave the specular input alone.
    https://docs.unrealengine.com/latest/INT/Resources/ContentExamples/MaterialNodes/1_3/
    It should be used only for microshadowing, but as I said, it's handled by the AO map.
     
    Alverik likes this.
  15. petersx

    petersx

    Joined:
    Mar 5, 2015
    Posts:
    239
    Maybe you have right, but textures for skin always have a specular map.
    For simply games with small characters - sss is not important - but for cut scenes with close up - that's matter.
    Of course skin with standard lit shader SRPHD looks very impressive - but I would like to see it with specular map.
    That guide in UE is not applicable to skin or anything has a specularity.
     
  16. Xype

    Xype

    Joined:
    Apr 10, 2017
    Posts:
    339
    Works great until you start adding pretty much any other asset that I own to the project....and I have some of the best and most popular assets out there. You are going to have to get on that if you want this to succeed, because lets see you broke my mapmagic you broke my megasplat, you broke my voxeland, you broke my Aquas.

    When I just straight follow the instructions, which is run the script you provided, make a new scene, import those 2. It works but theres no textures to play with so I bring in my textures/land tools so I could give it a run for its money. Welp you broke them all grats haha. I copied my real project and tried to just import those assets and woah wanna talk about disaster, glad it was a backup, for fun I tried to fix everything, took me 18 hours, and I had to delete the Shader and Post Processing Stack 2 to even make that time :)

    Don't get me wrong it was fun, I am only reporting my first impressions. Sadly I have no opinion on how it works because it came with like a couple textures. When I tried bringing in standard assets many of them broke too lol. Been laughing all night.

    Windows 10 creators, i7 7700k, 32 gigs ram, Nvidia Geforce 1060, Driver 390.77, Unity3d 2018.1.0f5

    I havn't given up hope I will come back and try again when you get some more polish on it.
     
  17. Dhialub

    Dhialub

    Joined:
    Nov 11, 2013
    Posts:
    41
    Yes, it is applicable. The metallic workflow exist solely because most non-metal materials have similar specular intensity and very little variance in that. The magic happens in the roughness maps.

    Xype: It'll break anything custom shader related, it is expected.
     
  18. Xype

    Xype

    Joined:
    Apr 10, 2017
    Posts:
    339
    I think everyone is getting this particular want some feedback item wrong. It works on the lower end new framework. This isnt the ultra high def PBR system. This is a system they designed so that devs grabbing unity out of the box can have something that looks great and performs extremely well with little overhead so they can use the overhead somewhere else.

    I mean if you wan't skin I think Unity knows how to do Skin. They walked everryone through that 2 years ago.



    Basically I am sitting here even though it did not work for me, ABSOLUTELY HAPPY. Here we have 2 Unity folks interacting with us actually supporting and delivering on their promise.

    DONT RUN THEM OFF OMG
     
    MadeFromPolygons likes this.
  19. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    This means you should stay with the classic pipeline. SRP with HD is the future of Unity rendering in an experimental phase. It is not designed to be compatible with the past at all, and I doubt it ever will be. Instead your assets need to update to work with SRP/HD instead.
     
    MadeFromPolygons, one_one and Alverik like this.
  20. Xype

    Xype

    Joined:
    Apr 10, 2017
    Posts:
    339

    Its all good man, I was just trying to get some textures in to play with. I reported my findings, my thought is next time they might toss in some textures so I can give it a good whirl :)

    And I know thats why I am tinkerin with it. I am looking forward to it. I had a blast breaking things. Its just script incompatabilities and the beta, I wish I had more time to hammer into it, but I got code to write :)
     
  21. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Just wanted to make sure I'm not missing anything...
    Right now to get started there are very basic pipelines - say BasicRenderPipeline - and the built-in ones like HDRenderPipeline, but the contrast in complexity is ridiculous. While the Basic is very easy to understand and get along, but HD seems like a complete framework of it's own.
    Are there any intermediate pipelines out there or used internally, like Deferred only with basic feature support (shadows, lightmapping, ...), to learn from?
     
    Last edited: Feb 3, 2018
  22. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    Basic Pipeline is just an example to explain how you could start to write your own pipeline. It is not mean to be used for anything than educational purpose.

    There is currently no equivalent to builtin Unity. We hope to leverage Lightweight sufficiently to take this role. Not done currently.

    HD have a totally different philosophy. Most decision for it come from AAA graphic industry which was not the target of builtin Unity. Thus why there is so much difference and this extra layer of complexity. Optimization in particular constraint a LOT any flexible design. Goal is to bring AAA feature in the hand of Indy artists.
     
    Alverik, AcidArrow and hippocoder like this.
  23. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    Hey, let me clarify a bit all this.

    Specular map are usually useless for skin. Index of refraction of the skin is 1.4, which is 0.028 in term of specular color. This doesn't vary on the face (or rather vary in a very negligible range for our purpose). We store the specular control in the diffusion profile instead to save space in the GBuffer. Here you can have your control.

    Variation regarding skin is control with smoothness map and diffusemap.(where you have you micro-diffuse occlusion)
    UE4 support micro-specular occlusion via the specular map. In HD we have a chose to have a dedicated specular occlusion map instead. But currently this control is not expose in the Lit.shader (in Lit.shader we currently deduce it automatically from AO map with a view dependent trick). But when Shader graph will be available, you will be able to fill it yourself.

    Last note.
    UE4 (and almost every engine) use Jimenez Screen space Susburface scattering. Which handle only multiscattering (See Jensen paper about light diffusion: https://graphics.stanford.edu/papers/bssrdf/bssrdf.pdf)
    In HD we wanted to go step further and chose to integrate single scattering + multiscattering via the Normalized Disney diffuse model of Burley : https://graphics.pixar.com/library/ApproxBSSRDF/paper.pdf.
    This model allow more accurate match with reference. In practice this translate by a more sharp result (i.e you diffuse map don't look as blurry as with Jimenez SSS that looks more like wax than skin). What engine often do is that they introduce an extra spike contribution in Jimenez (Frostbite, CryEngine) to get back this sharpness, but this spike is discontinuous whereas with the disney model, the diffusion profile still continuous.
     
    one_one, Alverik, Corvwyn and 4 others like this.
  24. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    >What do you mean by material classification?
    This:
    https://www.slideshare.net/DICEStudio/spubased-deferred-shading-in-battlefield-3-for-playstation-3
    http://advances.realtimerendering.com/s2016/s16_ramy_final.pptx

    To sum-up. In forward you know exactly what you render: SSS or anisotropy or clear coat etc... In deferred you can't. Material classification allow to bring back this knowledge and optimize the code for it.
    Consequence: your light loop need to be aware of the material classification. This is one example where optimization break your modular design.

    >Is there something stopping me from writing custom shaders for your loop?
    Adding a forward shader only is easy.
    Editing deferred shader is a bit more tedious. Performance here are very sensitive to any change.
    As long as you understand the code, any change are fine, but have in mind that GBuffer structure of RT0 and RT1 have to be compatible for forward SSS and (later) forward SSR (unless you don't care about this).

    >Is there any reason I couldn't generate my own Gbuffers, resolve my own depth and write my own custom light loop >shader method using the same buffers generated conveniently by the light loop?
    There is few function prototype to respect when writing a material, if you follow guidelines (that we haven't written of course :) ) it work.
    When writing a new light loop, this are the same function prototype to follow.
    So yes, you can replace fully the lightloop or the deferred material, and add new material. That's one of the goal. Just it is not simple to do.
     
    Alverik and DanielDickinson like this.
  25. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    789
    @SebLagarde Are the Optimization constraints because of current builtin pipeline or that's a choice to get the most out of hardware?
     
  26. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    Optimization are to get the most of console (PS4/XBoxOne) hardware (AMD GCN architecture) and software optimizatin (lighting architecture and material classification - deferred/forward tile/cluster) are part of it.

    Oh I should mention that I talk only about GPU optimization (HD can only influence shader performance).
    CPU belong to Builtin Unity and is far from being optimize...
     
    Last edited: Feb 4, 2018
  27. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    789
    Ah, alright. So shaders made in the shader graph will have these material classifications automatically applied.
     
  28. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Yep, I was talking about the developer side of things, not the user. I know for production the complexity of HD is needed.
    But to get started creating a pipeline, IMO, Basic is too simple and HD is too much at once.
    What I asked is if there are any special intermediate pipelines with less flexibility and less features, that may or may not be production ready, to learn from? Anything that bridges the gab between basic and HD is fine for me:)
    If there are none, ok with me, I'll try to grasp the HD. I understand that in the beta phase there's not much learning material, but later on I hope you'll have:)
     
  29. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    Lightweight is perfect for that. Few code, limited features support but enough to make it relevant for learning how to write a complete pipeline.
     
    Seneral likes this.
  30. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    Material classification is for the lighting model, (i.e lit.hlsl), the shader graph only affect the inputs part (i.E the litData.hlsl). So material classification work with any shader that use lit lighting model, shader graph or not shader graph.
     
    DanielDickinson likes this.
  31. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
    is it possible to provide mini pack just for using HDR lit tessellation and lit tessellation layer shaders on unity 2017?
     
  32. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    Can't work. These shaders are coupled to the HDRP material/lighting framework.
     
  33. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
    yup ... i mean provide this framework as mini unitypackage for using on 2017
     
  34. Dhialub

    Dhialub

    Joined:
    Nov 11, 2013
    Posts:
    41
    Baked indirect lighting is not working with the lightweight srp. If I select any low end pipeline asset and bake lightmaps, no light has any indirect bounces at all, no matter the intensity and light type (mixed and baked show the same results) in both Enlighten and progressive. It works just fine if I remove the pipeline asset. Is this expected behaviour?

    Created an empty project and it's working now. No clue what caused the problems.
     
    Last edited: Feb 5, 2018
  35. Remy_Unity

    Remy_Unity

    Unity Technologies

    Joined:
    Oct 3, 2017
    Posts:
    703
    The layer mask as it is now is different of how the terrain splat maps work, and work in on overlapping layer way :
    1. Base layer is applied everywhere
    2. Layer 1 is applied where there is red
    3. Layer 2 is applied where there is green
    4. Layer 3 is applied where there is blue
    5. Alpha is for global transparency
     
    hippocoder and DanielDickinson like this.
  36. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    842
    Terrains itself are not supposed to work, or are they?
     
  37. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    Not possible. These shaders require the whole HDRP framework.
     
  38. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    Not suppose to work with HD. Not sure about LW, I think it should.
     
    DanielDickinson likes this.
  39. Liminal-Ridges

    Liminal-Ridges

    Joined:
    Oct 21, 2015
    Posts:
    256
    Anyone knows if HD pipeline will be available with 18.1 release?
     
  40. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    No, it is not due for 18.1 - Check roadmap.
    (Even lightweight is experimental status at the moment).

    You can experiment with it of course and give feedback (I think most of us are playing with it in this thread). Just don't expect an easy time.
     
    Alverik and DanielDickinson like this.
  41. Liminal-Ridges

    Liminal-Ridges

    Joined:
    Oct 21, 2015
    Posts:
    256
    I tried but got error so dumped it. Is it going to give better graphics, or is it just a faster approach?
     
  42. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    789
    Graphics quality is up to the artists. However, there will be tools provided to achieve better graphics, like the Shader Graph. What SRP will provide (Built-in pipes to be specific) is better rendering/shading PBR wise. Custom pipelines will do whats needed for specific projects and such.

    (At least to my knowledge and understanding. I'm just an artist messing with this stuff)
     
    DanielDickinson likes this.
  43. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    842
    It looks subjectively better (far less camera shaking at extreme positions, less flickering, more light options [soft borders] ...) and it is frickin' fast. My unoptimized project went from around 40 fps to 145.
     
    Alverik and cfree like this.
  44. EthanHunt

    EthanHunt

    Joined:
    Oct 9, 2012
    Posts:
    14
  45. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,980
    Interested what has changed about floating precision?

    Myself (and it seems a few others) are noticing far better floating precision when moving far from the origin (less shake, stutter etc), which is a very nice addition I didnt know was getting worked on :)
     
  46. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    Maybe camera relative rendering?

    Taken from this post: #2
     
    MadeFromPolygons likes this.
  47. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    386
    Yep, I’ve encountered the same- the lighting is gorgeous but I can’t quite put a finger on why it’s qualitatively better. Better tonal range out of the box, without so much need for post colour correction.

    And I’m seeing a fantastic performance increase, particularly after beta 6.

    I’m finding I’m developing out of the branch I made to test 2018.1 / SRP and ignoring the main 2017.3 project, seems to work ok and I’m happy enough if future SRP updates break features.
     
  48. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    Guessing you are talking about HD not LW?
     
  49. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    Yes, it is camera relative rendering
     
  50. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934