Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Official Finding your way in HDRP 7.2.0 - Getting started - Settings - New feature

Discussion in 'High Definition Render Pipeline' started by SebLagarde, Feb 21, 2020.

Thread Status:
Not open for further replies.
  1. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    The High Definition Render Pipeline (HDRP) targets high-end PCs, high-end Mac and high-end consoles (Xbox One and PlayStation 4) for creating high-definition and photorealistic visuals. With package version 7.2.0 in 2019.3.2f1, HDRP is verified.

    This post in this forum is a companion to the blog post https://blogs.unity3d.com/2020/02/24/hdrp-out-of-preview-in-2019-3/

    Please read before going further. Thanks

    Finding your way in HDRP


    Longtime users of Unity should understand that HDRP isn’t like the built-in pipeline. It requires a new learning curve for both artists and programmers. New paradigms have been introduced, new artist tools, new settings system, new volume system, new shaders, etc. Migrating from an existing built-in Unity project isn’t a simple task and may require rewriting custom scripts, rewriting custom shaders, reworking the lighting, or setting up your scenes from scratch.


    One major change is that this pipeline is a package; you need to use Package Manager to upgrade to the latest version. We recommend that you always use the latest available version compatible with your Unity binary as it contains more bug fixes. You can check the version in the Package Manager window.


    To get started with HDRP, check out this documentation. It includes several helper guides, including the Getting Started manual and how to upgrade from the Built-in pipeline or from a previous HDRP version.


    You can also refer to presentations by the Unity team at events such as Unite or GDC. In particular, we recently presented about Getting Started with HDRP and VR support in HDRP. Alternatively, you can go deep and learn more about the architecture of HDRP (The Road toward Unified Rendering with Unity’s High Definition Render Pipeline) or how we implement some effects (Efficient Screen-Space Subsurface Scattering Using Burley’s Normalized Diffusion in Real-Time).


    To help you on your journey and check that you have the right setup for your projects (regular, VR, ray tracing), we provide an HDRP Wizard. The Wizard validates your settings and can fix them if they are incorrect. It also lets you convert your built-in project and provides an HDRP Scene Prefab to create new scenes.




    The Render Pipeline Wizard

    How do I enable a feature?
    The Settings system lets you easily customize HDRP to your production needs: HDRenderPipelineAsset helps you configure your entire project, the Frame Settings lets you fine-tune your scene’s Camera, and the Volume system gives you finer-grained control over an area in your scene.


    Each project is controlled by an HDRenderPipelineAsset assigned in the Graphics Window. With these settings, you can enable a feature project-wide.


    Additionally, you can disable a feature on a Camera by changing the settings in its Frame Settings. With this level of control over settings, you can remove unnecessary features in specific cases: for example, a reflection probe Camera can ignore transparent mesh renderers or use a single cascade shadow map.


    HDRP uses Volumes to support localized settings. Volumes are GameObjects added to your scene that control rendering features such as post-processing, sky, or fog when the Camera enters its bounds. You can also make the volume global. For example, to have Screen Space Reflection (SSR) in a scene, you need to enable it in the project’s HDRenderPipelineAsset; ensure your camera’s Frame Settings support it, and also enable the setting for the Volume in which your Camera lies.


    Like any GameObjects, Volumes can be nested. They are very useful for representing different moods in the same scene or controlling differences between interiors and exteriors. For example, you can fake time of day by changing the lighting conditions of your scene’s Volumes. However, in this particular example, only fixed settings are authorized when baking GI.


    We want to make it easy for you to get started with this package, so the default settings contain Frame Settings configurations for a Camera, a Reflection Probe, and a Realtime Reflection Camera. You can override the default settings with Custom Frame Settings on the GameObjects. Most common setups include default Volume; you can override the default by placing global volume in a scene or providing your own default volume profile. You can find the default settings in the HDRP Default Settings tab of the Project Settings.



    The HDRP default settings tab


    A quick way to visualize and change the state of the active Frame Settings is the new Debug menu. This is useful for debugging and optimization, as the state change isn’t serialized. You can use this menu in conjunction with a real-time profiler to see the performance impact of a feature. You can also check if a feature is enabled for a given camera.



    Debug menu with current state information

    How do I adapt configurations for different platforms?
    Because each platform has different abilities or can require several configurations (for example, low, medium, and high for PC), we give you the option to override the HDRenderPipelineAsset per configuration via Quality Settings. This allows you to enable/disable features and define memory size and texture size per configuration. Additionally, several properties have Scalability Settings. Those properties can have different values depending on the configuration.


    For example, we can define various configurations – low, medium, or high for PC, PS4 Pro, PS4 Base, Xbox One, Xbox One X. (A configuration can target one or more platforms; i.e., it is possible to create a medium configuration for PC, PS4 Base and Xbox One.) When a platform has multiple configurations, the user is in control and must write C# script to set up the desired configuration at runtime.



    Quality settings with various configuration


    You can decide that PC High, PS4 Pro and Xbox One X use high-quality Subsurface Scattering and Color Buffer format is fp16, while all other platforms use regular Subsurface Scattering quality with Color Buffer format of 111110f. You can define texture cube array resolution of 256x256x6 on PC and define it as 128x128x6 on console.





    Left, HDRenderPipelineAsset for XBoxOne X configuration; right, HDRenderPipelineAsset for PC Medium configuration


    For scalability settings, you can override the shadow resolution per configuration. Artists can define settings per light to use either custom resolution or a resolution provided by the HDRenderPipelineAsset (in QualitySettings – Low, Medium, High, Ultra). Artists can decide to use High/Ultra levels for in-game cinematic lights and Low/Medium levels for gameplay lights. Then, for each configuration, you can use HDRenderPipelineAsset to define the shadow resolution those levels map to.









    This light uses Medium shadow resolution, which corresponds to 512 in the HDRenderPipelineAsset for the active platform.


    Such settings are available for several rendering features such as shadows, lighting effects (SSR, SSAO, etc.), and post-processing.


    Materials created via Shader Graph can also use a Material Quality node. (You’ll need to add a predefined Keyword, Material Quality, in the Shader Graph blackboard that you can then drag and drop into the working environment). This allows artists to set different shader complexity – Low, Medium and High.



    Shader graph with a Material Quality built-in Keyword setup. The red, green or blue value depends on the configuration in HDRenderPipelineAsset and Frame Settings.


    You can select the Material Quality level to use for a given configuration on the HDRenderPipelineAsset.



    Additionally, you can use this node to define Material Quality levels according to the quality you want in different contexts inside the project: High quality and complexity during cinematic, Medium quality for game view usage, and Low quality for planar reflections. This is driven by the Frame Settings on the camera:



    Artists still need to set the variants required for a given configuration in the HDRenderPipelineAsset. If a configuration is missing, the closest variant will be used. Using several quality levels increases the build time.





    It is vital to have the right settings for your project as it can influence your visuals, your runtime performance, and build time.


    The most common bottleneck is the high number of shader variants in your project. In order to reduce the number of variants included in your build, we recommend that you enable only the features you need for your build (i.e., remove shadow mask if your project doesn’t use it), support a single shader mode (e.g., use only Deferred), and remove shaders and materials used for debugging purposes. For platforms that can support several tiers, such as PC, we are uniting all the shader variants required and building them together. So for example, when PC Low, PC Medium and PC High configurations are set to use Low, Medium and High Material Quality respectively, all the shader variants for all the Material Quality levels are compiled for a PC Build.


    HDRP uses a separate package, HDRP Config, to control the availability of some of its features at runtime. For example, you can use it to disable usage of area lights, enable camera-relative rendering, or control the shadow filtering mode for deferred rendering. This separate package can be easily merged. It helps HDRP to keep the number of shader variants under control. You’ll need to write C# and shader code (just don’t introduce new shader variants, as that defeats the point of it). To control the features available for each platform, users must rely on platform-specific macros defined by Unity.


    How can I get more control?
    By default, HDRP uses the most common settings for several GameObjects. Once you are familiar with HDRP and want to do more complex things, you can experiment with the Advanced Settings like those provided on Lights or some Volumes.



    Shadows settings on a Light have advanced settings that allow, for example, shadow tint


    Advanced settings are toggled via the wheel icon at the top right of the asset’s component.


    Performance control
    Performance is crucial for any real-time or interactive application. Many HDRP features may affect performance when they are not controlled correctly. Each feature has its own cost (usually indicated in the documentation).


    However, HDRP comes with some features to help you control your performance. For example, built-in dynamic resolution can help reduce GPU cost, particles can be rendered at half-resolution, or shadow maps can be updated on demand.


    The Frame Settings allow fine control of which effects or features are enabled. Light layering, for example, is a feature that requires extra performance (extra GBuffer in deferred path). It can be used to achieve a particular look during in-game cinematics and then disabled during gameplay to save on cost.


    The combination of volume system, layer mask, and camera settings of planar reflection, lets you configure directional light shadows to use only a single cascade inside the planar reflection, while the main scene renders with four cascades.


    Those are just a few examples. Profiling regularly is key to optimizing performance.

    To get the most performance out of your project, it is important to check the Lit Shader Mode. Deferred rendering in HDRP is faster in most scenarios, such as a scene with various Materials and multiple local Lights. Some scenarios, like those with a single Directional Light, can be faster in Forward rendering mode. If performance is not so important for your project, use Forward rendering mode for better quality rendering. For VR projects, we recommend Forward rendering to benefit from the extra quality that multisampling anti-aliasing (MSAA) provides.


    Even if both paths support the same features, the feature quality may differ. Forward rendering has better material quality than Deferred rendering because it doesn’t suffer from GBuffer compression. It also has better shadow bias and better ambient occlusion handling. Differences are highlighted in the documentation.
     
    Last edited: Feb 24, 2020
  2. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    Artists’ tools
    To be production-ready, a render pipeline needs to provide tools for artists to express their creativity. HDRP comes with verified Visual Effect Graph and Shader Graph, and offers new tools like Look Dev and HDRI Sky with Backplate for asset workflow.


    As mentioned above, HDRP is built on the premise of physically based rendering. Thanks to this, materials authored correctly should respond to lighting in a natural way in all lighting conditions.


    The Look Dev view lets you quickly check the look of your assets under several lighting conditions. It also includes some view modes that allow you to check each component of your materials.


    You start by creating a library of HDRI images, then you load an asset or a prefab into the view. You can switch between images in the view or even use one of the debug view modes. Or you can adjust the display for a split-screen view to compare different assets, lighting conditions, or view modes.


    https://drive.google.com/a/unity3d.com/file/d/1bnSpmBLsswOBBlr_zKEKzi9hUMaJWHOs/view?usp=sharing

    In addition to Look Dev, Backplate is an advanced mode in the HDRI sky. It creates a virtual geometry that can be textured using the bottom part of the HDRI image, it can fade at the edges, and it can also render shadow maps on top of the otherwise unlit HDRI sky.

    https://drive.google.com/a/unity3d.com/file/d/1PB8B0Jq6C_aXpz3cfvpiXTt9gFMGvv66/view?usp=sharing


    HDRP allows you to make advanced visual effects thanks to Visual Effect Graph, which is our new node-based visual effect authoring tool. It is easy to use, flexible, and powerful. The visual effects generated rely on GPU particles, which allows you to take full advantage of GPUs to simulate and display large quantities of particles. The node graph allows deep customization of your effects, and you can expose the properties you need for interacting with your game systems. Read more about the Visual Effect Graph in this blog post.




    Shader Graph is our node-based shader authoring tool. When used with HDRP, additional features become available (often prefixed by HD). In HDRP, you can use a shader graph to override the GI, edit vertex normals and vertex tangents, control Material Quality, or render your shader with a parallax occlusion mapping node that writes a depth offset.


    In Shader Graph, cross-pipeline nodes like PBR master node or Unlit master node are enhanced with more features and control in HDRP (where these nodes are known as HD Lit and HD Unlit respectively). You can use distortion, refraction, subsurface scattering and other effects. You can also access specific HDRP lighting models for your shaders by using the Hair master node or the Fabric master node.




    This package includes Sample Content to show you how to use certain features. You can access these examples through the Package Manager interface. Go to Window > Package Manager, select the High Definition RP package, and in the right panel you will see the samples that you can choose to import into your project.



    Available HDRP samples to import into the project


    The package also comes with a sample shader for Fabric and hair shader graph, an example of custom sky, some textures resources for post-processing, a particle system shaders for compatibility with Shuriken, and a set of material samples.



    Sample content in the HDRP package: Fabric shader




    Sample content in the HDRP package: Material samples


    Lastly, the Render Pipeline Debug displays all material properties for both opaque and transparent materials, either with Deferred or Forward Rendering path. You can choose to display various lighting, such as Diffuse lighting only, Specular lighting only, shadows, etc. It also lets you override properties for the whole scene, like normal, albedo, or smoothness. It can display intermediate render targets like motion vector, depth buffer, and many others. An invaluable tool for artists, it works both in the Unity Editor and on any player (e.g., PS4).



    The Render Pipeline Debug menu on the Fontainebleau demo.


    The MatCap mode replaces the material and lighting of objects with a simple environment texture. This mode is useful for navigating and getting a sense of the scene without having to set up the scene lighting. For example, you can use this mode when editing a dark area, like the inside of a cave, which would be difficult to navigate with low lighting.




    Extensibility of HDRP
    HDRP contains a lot of passes and it can be tricky to dig into it, but there is a way to add new passes without having to change the code.


    The main purpose of Custom Passes is to inject effects or custom code into the render loop. They allow you to access HDRP buffers and modify them at certain points in the frame (see the injection points diagram below). Custom Passes use the same volume system principle as Post Process but have more restrictions (they don’t rely on profile assets and they can’t interpolate). Custom Passes require some C# scripting and shader authoring.



    Custom Pass control settings


    By default in HDRP you have access to two Custom Pass types:

    • DrawRenderers allows you to select visible Mesh Renderer in your Camera, filtered by Render Queue and Layer, to render effects with an override Material or with their current Material.

    • FullScreen is used to do a blit of a Material in fullscreen using a custom shader. With this fullscreen pass, you are able to sample HDRP buffers, custom buffers, create various effects, and compositing.

    Here is an example of an effect you can achieve with Custom Pass:

    https://drive.google.com/a/unity3d.com/file/d/1ipVcz3D0nuTncs-nG4OU54zBG0x1WU-s/view?usp=sharing

    Example of animated effects done with Custom Pass


    See the Custom Pass documentation for more information, or explore some more effects made with custom passes.


    Custom Post Processes allow you to write your own post-processing effects. (They look a lot like the Post Processing Stack via Volume components in the Built-in render pipeline.) They are integrated within the Volume system, benefiting from the blending and overrides of this system. You create a shader that creates your custom post-process effect and link it to your Volume component.


    You need to specify the order of execution of post-processes; this can be configured in the Project Settings window. They will be executed from top to bottom.


    Custom Post Process Orders configuration in Default Settings


    For more information, please refer to the Custom Post Process documentation.




    Example of posterize custom post process


    Whether you use Custom Pass or Custom Post Process depends on your approach. Custom Pass is intended for artists and is simple to add. In Unity 2020.1, you will not need to write any C# or shader code for custom pass; you will be able to use Shader Graph to produce material for full screen pass. Custom Post Process is intended for programmers, as some coding is required. It is integrated with the post-processing system, to reuse memory and take advantage of ping-pong patterns with RenderTargets. It is a good choice for effects that require multiple passes.


    This diagram presents a simplified view of the HDRP passes and highlights the injection points for Custom Pass and Custom Post Process.


    All HDRP rendering passes, highlighting injection points for Custom Pass and Custom Post Process

    Start using HDRP

    Several high-graphic productions are in progress with HDRP, including games and VR projects. We’ve even rendered Unity’s Japan office in HDRP, so you can see how the architecture, engineering and construction (AEC) industry can leverage HDRP’s photorealism.


    Check out these sample projects to help you get started: Fontainebleau and The Spaceship.


    To learn more about its capabilities and how to get the most out of HDRP, check out the following blog posts:
    How to set up Unity’s High Definition Render Pipeline for high-end visualizations

    The power of photogrammetry: Simulating the real world in VR

    Creating Assets with Photogrammetry using a rotating surface

    Introducing Sherman – a Unity project featuring Real time fur, HDRP and Visual FX Graph for animators
     
    ewermor, Ne0mega, chap-unity and 6 others like this.
Thread Status:
Not open for further replies.