docs.unity.cn
  • Manual
  • Scripting API
  • Changelog
  • License

High Definition RP 17.0.2

Search Results for

    Show / Hide Table of Contents
    • High Definition Render Pipeline
    • Requirements
    • What's new
      • 10 / Unity 2020.​2
      • 11 / Unity 2021.​1
      • 12 / Unity 2021.​2
      • 13 / Unity 2022.​1
      • 14 / Unity 2022.​2
      • 15 / Unity 2023.​1
    • Features
      • Features List
      • Comparison with the Built-in Render Pipeline
    • Getting started
      • Getting Started with HDRP
      • Forward and Deferred Rendering
      • Exposing Additional Properties
      • Sample Content
      • Sample project
      • Menu Items
    • Upgrade guides
      • High Definition Render Pipeline Wizard
      • Upgrading to HDRP from the built-in render pipeline
      • Material Upgrade
      • Upgrading from HDRP 13.​x to 14.​x
      • Upgrading from HDRP 12.​x to 13.​x
      • Upgrading from HDRP 11.​x to 12.​x
      • Upgrading from HDRP 10.​x to 11.​x
      • Upgrading from HDRP 8.​x to 10.​x
      • Upgrading from HDRP 7.​x to 8.​x
      • Upgrading from HDRP 6.​x to 7.​x
      • Upgrading from HDRP 5.​x to 6.​x
    • Volume Framework
      • Volumes
        • Volume Profiles
        • Volume Overrides
      • Volume Overrides List
        • Exposure
        • Fog
        • Water
          • Use the Water System in your Project
          • Capabilities of the Water System
          • Water system simulation
          • Settings and properties related to the Water System
          • Quality and performance decisions
          • Water Override for Volumes
          • Decals and masking in the Water System
          • Foam in the Water System
          • Caustics in the Water System
          • Create a current in the Water System
          • Deform a water surface
          • Exclude part of a water surface
          • Underwater view
          • Materials in the Water System
          • Scripting in the Water System
        • Rendering
          • High Quality Lines
        • Lighting
          • Ambient Occlusion
          • Indirect Lighting Controller
          • Screen Space Global Illumination
          • Screen Space Lens Flare
          • Screen Space Reflection
          • Screen Space Refraction
        • Material
          • Diffusion Profile List
        • Post-processing
          • Bloom
          • Channel Mixer
          • Chromatic Aberration
          • Color Adjustments
          • Color Curves
          • Depth of Field
          • Film Grain
          • Lens Distortion
          • Lift, Gamma, Gain
          • Motion Blur
          • Panini Projection
          • Shadows, Midtones, Highlights
          • Split Toning
          • Tonemapping
          • High Dynamic Range (HDR) Output
          • Vignette
          • White Balance
        • Shadowing
          • Contact Shadows
          • Micro Shadows
          • Shadows
        • Sky
          • Cloud Layer
          • Gradient Sky
          • HDRI Sky
          • Physically Based Sky
          • Procedural Sky
          • Volumetric Clouds
        • Visual Environment
    • Render Pipeline Settings
      • HDRP Asset
      • Frame Settings
      • HDRP Global Settings
      • HDRP Config package
      • Scalability
    • Shaders and materials
      • Built-in shaders
        • 3DSMaxPhysicalMaterial
          • Physical​Material3Ds​Max
        • ArnoldStandardSurface
          • Arnold​Standard​Surface
        • Autodesk Interactive
          • Autodesk Interactive Shader
          • Autodesk Interactive Masked Shader
          • Autodesk Interactive Transparent Shader
        • Ax​F Shader
        • Decal
          • Decal Shader
        • Cotton/Wool Shader
        • Eye Shader
        • Fog volume Shader
          • Fix issues with fog volumes
        • Fullscreen Shader
        • Hair Shader
        • Layered Lit Shader
        • Layered Lit Tessellation Shader
        • Lit Tessellation Shader
        • Lit Shader
        • Silk Shader
        • Terrain Lit Shader
        • Unlit Shader
      • Material variants
      • Reduce shader variants in your build
      • HDRP material properties
        • Alpha Clipping
        • Ambient Occlusion
        • Displacement Mode
        • Double Sided
        • Geometric Specular Anti-aliasing
        • Mask Map and Detail Map
        • Material Type
        • Tessellation
        • Surface Type
        • Renderer and Material Priority
      • Subsurface Scattering
        • Subsurface Scattering Materials
        • Diffusion Profile
      • Compute Thickness
      • Master Stacks in HDRP
        • Contexts and Blocks
          • Vertex
          • Fragment
          • Canvas Master Stack
          • Decal Master Stack
          • Eye Master Stack
          • Fabric Master Stack
          • Fog Volume Master Stack
          • Fullscreen Master Stack
          • Hair Master Stack
          • Lit Master Stack
          • Stack​Lit Master Stack
          • Unlit Master Stack
          • Water Master Stack
      • Shader Graph Nodes
    • Lighting
      • Reflection in HDRP
      • Refraction in HDRP
        • Understand refraction
        • Create a refractive Material
        • Refraction models
        • How HDRP calculates color for reflection and refraction
      • Reflection Probes
        • Using Reflection Probes
        • Components
          • Reflection Probe
          • Planar Reflection Probe
          • Reflection Proxy Volume
      • Light
      • Probe Volumes
        • Understand Probe Volumes
        • Use Probe Volumes
        • Display and adjust Probe Volumes
        • Fix issues with Probe Volumes
        • Streaming
        • Probe Volume settings and properties
      • Light Anchor
      • View and control a light from its perspective
      • Environment Lighting
      • Clouds in HDRP
      • Atmospheric Scattering
      • Local Volumetric Fog
      • Rendering Layers
      • Shadows
      • Shadowmasks
      • Volumetric Lighting
      • Physical Light Units and Intensities
      • IES
        • IES Profile
        • IES Importer
    • Camera
      • HD Camera
      • Scene View Camera
      • Dynamic Resolution
      • Motion Vectors
      • Anti-Aliasing
      • Alpha Output
      • Arbitrary Output Variables
      • Multiframe Rendering and Accumulation
      • Deep learning super sampling
    • Post-processing
      • Effect Execution Order
      • Effect List
      • HDR Output
      • Authoring Lookup Textures
        • Overview
        • Authoring in Adobe Photoshop
        • Authoring in Da​Vinci Resolve
      • Propagating Na​Ns
    • UI
      • UI Best Practices
    • Ray Tracing
      • Getting Started with Ray Tracing
      • Effects and Volume Overrides
        • Ray-Traced Ambient Occlusion
        • Ray-Traced Contact Shadows
        • Ray-Traced Global Illumination
        • Ray-Traced Reflections
        • Ray-Traced Shadows
        • Ray-Traced Subsurface Scattering
        • Ray Tracing Settings
        • Light Cluster
        • Path Tracing
        • Recursive Rendering
      • Shader Graph Keywords
        • Raytracing Quality
      • Ray Tracing and Animations
      • Debugging
        • Debugging Ray-Traced Effects
    • Components
      • Decal Projector
      • Mesh Renderer Extension
      • Lens Flare (SRP)
        • Lens Flare asset
    • Tools
      • Look Dev
      • Compositor
        • User Guide
        • User Options
    • Debugging
      • Mat​Cap
      • Rendering Debugger
      • Add controls to the Rendering Debugger
    • Virtual Reality
      • VR Overview
    • Consoles
      • Building For Consoles
    • Customizing HDRP
      • Camera-relative Rendering
      • Creating a Custom Sky
      • Creating Custom Clouds
      • Creating a Custom Post-Process Effect
      • Custom Pass
        • Creating a Custom Pass
        • Injection Points
        • Custom Pass Volume workflow
        • Viewing a Custom Pass in the Frame Debugger
        • Scripting your own Custom Pass in C#
        • Managing Custom Passes without Game​Objects
        • Troubleshooting
      • Custom Material Inspector
      • Creating and Editing Lights at Runtime
      • Creating a Decal Projector at Runtime
      • Editing Materials at Runtime
      • Editing Frame Settings at Runtime
      • Editing Volumes at Runtime
      • Render Graph
    • HDRP Glossary
    • Known Issues and How To Fix Them

    Create a local fog effect

    You may want to have fog effects in your Scene that global fog can not produce by itself. In these cases you can use local fog. To add localized fog, use a Local Volumetric Fog component. Local Volumetric Fog is a volume of fog represented as an oriented bounding box. By default, fog is constant (homogeneous), but you can alter it by assigning a Density Mask 3D texture to the Texture field under the Density Mask Texture section.

    Create a Local Volumetric Fog component

    You can create a Local Volumetric Fog component in one of the following ways:

    1. In the menu bar, select GameObject > Rendering > Local Volumetric Fog.

    2. Right-click in the Hierarchy window and select Volume > Local Volumetric Fog.

    Set up Volumetric fog

    To use volumetric fog, enable it in the all of the following locations:

    • Project Settings
    • HDRP Asset
    • Global Volume

    Enable Volumetric Fog in Project Settings

    To enable Volumetric Fog in the Project Settings window, open the Project settings window (menu: Edit > Project Settings) and enable the following properties**:**

    1. Go to Quality > HDRP > Lighting > Volumetrics and enable Volumetric Fog.
    2. Go to Graphics > Pipeline Specific Settings > HDRP.
    3. Under Frame Settings (Default Values), in the Camera section:
      • Select Lighting.
      • Enable Fog.
      • Enable Volumetrics.

    Enable Volumetric Fog in the HDRP Asset

    To enable Volumetric Fog in the HDRP Asset:

    1. In the Project window, select the HDRenderPipelineAsset to open it in the Inspector**.**
    2. Go to Lighting > Volumetrics.
    3. Enable Volumetric Fog.

    Enable Volumetric Fog in a Global Volume

    To use volumetric fog in your scene, create a Global volume with a Fog component. To do this:

    1. Create a new GameObject (menu: GameObject > Create Empty).
    2. In the Inspector window, select Add Component.
    3. In the search box that appears, enter “volume”.
    4. Select the Volume Component.
    5. Go to Profile and select New to create a volume profile.
    6. Select Add Override.
    7. In the search box that appears, select Fog.

    To enable volumetric fog in the Fog component:

    1. Select the Fog dropdown
    2. Select the Enable toggle, and enable it.
    3. Change the State setting to Enabled.
    4. Select the Volumetric Fog toggle, and enable it.

    To see more properties you can use to control Volumetric Fog, expose the hidden Fog settings:

    1. In the Volume component, go to the Fog override and select the More (⋮) dropdown.
    2. Select Show All Additional Properties to open the Preferences window.
    3. In the Preferences window, under Additional Properties, open the Visibility dropdown and select All Visible.

    Refer to the Local Volumetric Fog Volume reference for more information.

    Apply a Fog Volume shader graph

    To apply a Fog Volume shader in a scene, assign a Fog Volume material to a Local Volumetric Fog component:

    1. Create and set up a Local Volumetric Fog component..
    2. In the Project window, right-click the Fog Volume shader graph asset and select Create > Material.
    3. In the Hierarchy window, select the Local Volumetric Fog GameObject.
    4. In the Local Volumetric Fog’s Inspector window, set the Mask Mode property to Material.
    5. In the Mask Material section, select the material picker (circle).
    6. Select the Fog Volume material.

    If the Fog Volume doesn't appear in your scene, follow the Local Volumetric Fog setup instructions.

    Note: The Scale transform doesn't affect the size of the fog in your scene. To do this, change the Size value in the Local Volumetric Fog component.

    Note: If you use more than one Fog Volume shader in your scene, then the HDRP fog system applies lighting consistently across them all.

    Refer to Fog Volume shader for more information.

    Mask textures

    A mask texture is a 3D texture that controls the shape and appearance of the local volumetric fog in your scene. Unity does not limit the size of this 3D texture, and its size doesn't affect the amount of memory a local volumetric fog uses.

    Use a built-in Mask Texture

    HDRP includes 3D Density Mask Textures with different noise values and shapes that you can use in your scene. To use these Textures, import them from the High Definition RP package samples:

    1. Open the Package Manager window (menu: Window > Package Manager).
    2. Find the High Definition RP package.
    3. Expand the Samples drop-down.
    4. Find the Local Volumetric Fog 3D Texture Samples and click on the Import button.

    Create a Density Mask Texture

    To create a 3D texture to apply to a local volumetric fog component:

    1. In the image-editing software of your choice, create an RGBA flipbook texture and import it as a 3D texture. For example, a texture of size 1024 x 32 describes a 3D Texture of size 32 x 32 x 32 with 32 slices laid out one after another.
    2. Open a Local Volumetric Fog component and in its Density Mask Texture section assign the 3D Texture you imported to the Texture field .

    Limitations

    HDRP voxelizes Local Volumetric Fog at 64 or 128 slices along the camera's focal axis to improve performance. This causes the following limitations:

    • Local Volumetric Fog doesn't support volumetric shadowing. If you place Local Volumetric Fog between a Light and a surface, the Volume does not decrease the intensity of light that reaches the surface.
    • Noticeable aliasing can appear at the boundary of the fog Volume. To hide aliasing artifacts, use Local Volumetric Fog with global fog. You can also use a Density Mask and a Blend Distance value above 0 to decrease the hardness of the edge.

    Open the volumetric sample scene

    HDRP includes a Volumetric sample scene that demonstrates different ways that you can use Local Volumetric Fog. To import the volumetric samples:

    1. Go to Window > Package manager and select High Definition RP.
    2. Select the Samples tab.
    3. Find Volumetric Samples and select Import.

    To set up the Volumetric sample scene:

    1. Go to the Project window.
    2. Go to Assets > Samples > High Definition RP > HDRP version number > Volumetric samples > Scenes.
    3. Select the Volumetric Samples scene.
    4. Go to Assets > Samples > High Definition RP > HDRP version number > Volumetric samples > Scenes > Resources.
    5. Drag the Volumetric Samples Collection into the Hierarchy window.
    6. In the Inspector window, open the Sample List dropdown and select a sample to display it in your scene.

    In This Article
    • Create a Local Volumetric Fog component
    • Set up Volumetric fog
      • Enable Volumetric Fog in Project Settings
      • Enable Volumetric Fog in the HDRP Asset
      • Enable Volumetric Fog in a Global Volume
    • Apply a Fog Volume shader graph
      • Mask textures
      • Use a built-in Mask Texture
    • Create a Density Mask Texture
    • Limitations
    • Open the volumetric sample scene
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)