Search Unity

Feedback Wanted: High Definition Render Pipeline

Discussion in 'Graphics Experimental Previews' started by Tim-C, Sep 25, 2018.

  1. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    616
    There's a threshold slider coming soon, which does exactly what you described. If you are using the latest 2020.1 alpha you can get it from Github. Otherwise, the next package released should have it.

    upload_2019-12-15_10-6-23.png
    upload_2019-12-15_10-7-21.png
     
    Automoda likes this.
  2. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    484
    Yeah, was going to say that the old style bloom breaks energy conservation as bright areas magically get brighter with no additional energy getting in to the system.

    Having said that, it's a whole lot easier to tune for prettier pictures than the new one. With this the scattering is basically how much jelly/tears/water is on the camera lens, and relies entirely on the brightness of the pixel to carry further. More correct, since the bright areas are bleeding light to the dark areas, but at the same time, the dark areas are bleeding light to each other.

    Only tip I've worked out is to make sure the bright areas are still very bright before they get sent to bloom. that way you can set the scatter value low, but still get bright light to blur a bit.
     
  3. Jovssen

    Jovssen

    Joined:
    Jun 3, 2016
    Posts:
    36
    are you using realistic lux and exposure?
     
  4. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    979
    7.1.7 is available.

    I assume 7.2.0 is final version.
     
  5. dantman

    dantman

    Joined:
    Jan 3, 2017
    Posts:
    4
    I think HDRP needs some more public APIs (and docs) related to dynamically creating materials.

    The typical code doesn't really work with HDRP:
    Code (CSharp):
    1. Material mat = new Material(Shader.Find("HDRP/Lit"));
    2. mat.SetInt(HDMaterialProperties.kMaterialID, (int)Lit.MaterialFeatureFlags.LitSpecularColor);
    3. mat.SetFloat(kSurfaceType, (float)SurfaceType.Transparent);
    4. mat.SetFloat(kBlendMode, (float)BlendMode.Additive);
    5. mat.SetFloat(kEnableBlendModePreserveSpecularLighting, 0);
    6. mat.SetTexture("_BaseColorMap", baseTexture);
    7. AssetDatabase.CreateAsset(mat, "Assets/Materials/Test.mat");
    While the values do get set and you "see" them in the editor, the material does not actually reflect the settings that are set. i.e. The editor says "Surface Type: Transparent" but the material isn't actually transparent until you manually change settings in the GUI for each material.

    I understand this is because there are other internal configurations that get set when you change things in the GUI. However if so we also need an API to set the various settings from editor scripts. From what I can tell all the classes related to this like LitGUI are left as default private classes meaning none of the functions used to re-initialize these internal settings or set things can be called from editor scripts outside the package.
     
  6. Automoda

    Automoda

    Joined:
    Apr 27, 2017
    Posts:
    151
    Big problem: HDRP detail textures are blending the roughness channel in such a way that it nukes the main texture's smoothness rather than enhancing it. More of an alpha than a multiply. This is probably a bad move, and I'm afraid it may be too late to change but... Yikes! I wondered why my standard pipeline version looked better.

    SmoothDetail.jpg

    Here you see a rock (no baked global lighting etc, just a plain directional).

    Note how the detail channel nukes ALL roughness data from the original texture if the slider is at 100%

    Note how nice the desert patina looks if the detail texture is set to 0%

    The smoothness channel (G) of the detail texture is centered on 50% since I assumed it'd multiply.

    It seems the roughness, if set to 100%, almost entirely overwrites the original roughness.

    Note that the final result isn't the 50% roughness of the detail texture, though. More like 0-10%...


    So I don't see how you can use the detail texture's roughness at all. It doesn't enhance, it de-hances. Can you think of a situation where you'd want to blank-out roughness? As an artist, I sure cant. If it were to be multiply it'd add noise to the main texture, which would be the desired result rather than what I'm seeing. Whats your take on this?
     
  7. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,208
    Probably your maps are inverted or your channels are different? I mention it because HDRP doesn't use roughness at all, and that's a nuanced point that's well worth observing... it instead uses smoothness which is 1-rough (invert it).
     
  8. Automoda

    Automoda

    Joined:
    Apr 27, 2017
    Posts:
    151
    Hi Hippocoder. Maps are not inverted and the channels are set up perfectly. Call it what you want-- Potato potato.

    I took the time to post examples of the "roughness/smoothness" maps that I used and you'll see that I'm using them correctly in my image. I'm trying to help Unity make HDRP better, and I honestly cant see what they were thinking. I'm starting to wonder if the "smoothness" channel in the HDRP detail shader is just subtractive? If so, say so somewhere. I took the time to make the post because I'm days from publishing a very large asset with an HDRP option and I want to be sure I'm using it right. You're getting real feedback from a real photogrammetry artist trying to use this much hyped pipeline, so there ya go.

    I forgot to add one note though: You have to uncheck the mysterious sRGB flag on the detail texture import settings (in HDRP only) for some reason. If you fiddle with the flag you'll see what I mean-- The detail map becomes far too powerful if you leave sRGB on. Because this little trivia point is well hidden, I doubt many people have ever gotten the detail texture to work at all. I suggest adding some kind of pop-up warning if its set wrong like you do (sometimes) for normal maps.
     
  9. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,208
    It's not a dig. It's necessary to talk about because many Unity shaders support spec, roughness or smoothness. Obviously they have entirely different results. So covering these, followed by which channels are the first step in debugging. If it's still not giving you the right results, file a bug and Unity should be able to tell you what went wrong.
     
  10. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    979
    Is it possible to create Spherical fog volume as additional to box volume?

    I have bigger box fog volume and a smaller box volume. Edges of box volume can be seen . They are distracting. But Spherical fog volume would fit nicely. Fog would exponentialy fall off from centre toward the sphere so that box volume can't be seen.
     
  11. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,208
    If you are not scrolling the fog you can use a 3D texture to define the shape of the fog inside the volume.
     
  12. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    979
    How to make 3D texture ?
     
  13. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,208
    You can find a tool in HDRP for it. Read the docs :p
     
  14. Automoda

    Automoda

    Joined:
    Apr 27, 2017
    Posts:
    151
    Well we got our bloom threshhold value! I just tried it in HDRP 7.1.7 The threshhold goes from 0-100 but anything above .99 has zero effect, which is kinda not what I'd expect but that being said...

    Its still just as confounding as it was before no matter what slider I put in what position, and thats regardless whether I use 100,000 lux or 10 lux. Could you guys link me to a video of you setting it up to actually look good and do something other than fuz-blur-out the whole screen? I want to see glare coming from a sunset backlighting something. I want to see big fat glints from shiny parts on a machine. I cant get anything from bloom even after the threshhold was added. Have the guys that make all your show-off cut-scenes like Heretic and Book of the Dead show us how its done. They're really smart and have access to engine coders so it'd be a nice blog post or something.

    At the very least have a working bloom for the final 2019 version of Unity. And just so the coding team knows, 99% of artists would prefer awesome glints and glare than worrying about photon energy conservation. HDRP shaders are really brilliant and I have to say I'm always surprised how well thought out some of them are, and how 'usability' is built in as if the coders were also artists. Lets just say for this one issue, its time to go back to the drawing board ;)
     
  15. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    500
    The streaky one from The Heretic should be keijiro s one.
    https://github.com/keijiro/Kino

    You can take it and do additional rotations towards star crosses but it doesn t solve this unexpected behaviour from the bloom overall.

    Here my question and an answer from unity about the bloom and dof behaviour from PPV3.
    I also wished these got a little more love.

    https://forum.unity.com/threads/pho...nto-digital-assets.521946/page-2#post-5230607

    See also post before and after.
    They choosed an non additive bloom behaviour.
     
    Last edited: Jan 8, 2020
  16. Automoda

    Automoda

    Joined:
    Apr 27, 2017
    Posts:
    151
    "The bloom in HDRP is not additive, it is somewhat like blending with a blurred version version of the image in HDR. Bright values will naturally produce more noticeable glow but dark tones will be modified as well. The way it softens the image is very useful for unifying the tones and it's also great for getting a lot of subtle gradients in the values so that you can increase the contrast afterwards while still keeping details everywhere (not clipping)."

    Ok but thats not really bloom as we know it. Call it something like 'image softening' and I'd understand that. I'm usually fighting to increase detail rather than removing it.
     
    xDavidLeon likes this.
  17. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    500
    Think the same. It could be moved to an soft clip override.
    https://noamkroll.com/why-soft-clip...inematic-look-how-to-easily-apply-it-in-post/


    In BuiltIn RP PPV2 i use these changes
    Quick fix for MUCH BETTER BLOOM
    https://github.com/Unity-Technologies/PostProcessing/issues/787

    Sampling.hlsl
    (Changes are in lines 17, 60 and 82 )

    but the PPV3 implementation has some other theory behind.
    Would be nice to get some tips and advice from the PPV3 programmer.
     
    Last edited: Jan 9, 2020
    Flurgle likes this.
  18. Aurelinator

    Aurelinator

    Joined:
    Feb 27, 2012
    Posts:
    10
    Hi all,

    So I recently just upgraded to 2019.3 from 2019.2, and was a bit disappointed to find that a bunch of former public classes previously under the .experimental namespace) have become internal. I'm specifically talking about UI classes. Now I've looked up the change on the github and it might be from a while back, but since it's just made it to the public release, I'm just now seeing it.

    We have a bunch of custom shaders in our project, and created them using the
    MaterialUIBlock
    system so that we could keep aesthetic properties similar to the rest of HDRP's materials. All of our UI classes inherit from the
    MaterialUIBlock
    , and in order to keep parity with the rest of Unity, we use the
    SurfaceOptionUIBlock
    so that our shaders can get a lot of the goodness that was exposed to us.

    All of those classes and any of the previous MaterialUIBlocks have all gone internal, because of a change on the github done sometime in June of last year (https://github.com/Unity-Technologies/ScriptableRenderPipeline/pull/4013).

    What I think is funny is how the code still has a giant comment in it explaining how they wrote it this way so that users like me could subclass this to create aesthetically similar UI. (See
    MaterialUIBlockList.cs
    )

    Code (CSharp):
    1.     // A Material can be authored from the shader graph or by hand. When written by hand we need to provide an inspector.
    2.     // Such a Material will share some properties between it various variant (shader graph variant or hand authored variant).
    3.     // To create a such GUI, we provide Material UI Blocks, a modular API to create custom Material UI that allow
    4.     // you to reuse HDRP pre-defined blocks and access support header toggles automatically.
    5.     // Examples of such material UIs can be found in the classes UnlitGUI, LitGUI or LayeredLitGUI.
    6.  
    At this point, I could literally go ahead and copy a bunch of the HDRP code into my own project (
    MaterialUIBlockList, MaterialUIBlock, MaterialEditorExtensions
    ), and use reflection in my UI in order to invoke the
    SurfaceOptionUIBlock
    , but that seems absolutely horrible. What's the point of creating a really beautiful modular UI system meant for users to subclass, and then marking it all as internal, thus removing the entire point of its existence?
     
  19. HugoZink

    HugoZink

    Joined:
    Mar 4, 2018
    Posts:
    4
    EDIT: After some consideration, it seems we need the ability to make our own custom master nodes.

    We desperately need a way to do custom lighting setups in HDRP (such as with Custom Master Nodes). The old Forward pipeline gave us the ability to get the position, color and attenuation for all the lights. This is great for toon shaders and other lighting implementations to thrive. Is this possible in HDRP without modifying the pipeline?

    This all seems to be fairly easily possible in LWRP/URP.

    The crucial part is that this should be possible out of the box, i.e. we should not need to alter the pipeline or add C# scripts to our lights. Look at games driven by user content like VRChat, they would not work in HDRP without some serious modifications, because user content would not be able to change the pipeline. Currently they use the Forward renderer, which means any shader that supports Forward rendering will work.

    I'm also not a fan of nodes being mandatory (I used to manually code shaders and still prefer it that way), but that's a story for another time.

    Finally, for toon shaders it is very useful to be able to render a second pass for the outlines (with the vertices extended outwards from their normal a little). This does not seem to be possible in HDRP either.

    As for geometry shaders, are those still possible? I think that without manual coding support for stuff like extra passes and geometry/tessellation, HDRP is simply not viable for many non-standard use cases.
     
    Last edited: Feb 4, 2020
    SephironV likes this.
  20. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    311
    There is a custom pass api for that.
     
  21. HugoZink

    HugoZink

    Joined:
    Mar 4, 2018
    Posts:
    4
    Which brings me back to the first problem, which is user content and the fact that this requires C# scripting. It's not always great to have the pipeline, scripts and shaders so tightly coupled together, especially when the old pipelines and the 2018.3 custom master node "hacks" have shown that it might not be always necessary.
     
    Last edited: Feb 4, 2020
  22. HugoZink

    HugoZink

    Joined:
    Mar 4, 2018
    Posts:
    4
    One way a lot of these headaches could be alleviated is by allowing us to make our own "Master Nodes". In 2019.1 this API was made internal, however. Are there any plans to reverse this decision? If it is already possible, is there any documentation on where or how to do so?

    This has already been requested a few times before, and I heavily stand behind this request.

    There are many projects which would ideally want HDRP but still want to keep their own stylized or toon shading, in which case a custom master node would be the ideal solution. Sadly this no longer seems to be possible, which means I cannot switch to HDRP yet.
     
    Last edited: Feb 4, 2020
    Janoooba likes this.
  23. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    979
    Please IES lights support in SRP.
     
unityunity