Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
d54fdf5
Rename Density Volume to Local Volumetric Fog UX and Documentation part
alex-vazquez-unity3d Mar 9, 2021
ba0c96d
Fixes from code review
alex-vazquez-unity3d Mar 9, 2021
6eb140e
Changelog
alex-vazquez-unity3d Mar 9, 2021
ec15732
Fixes from code review
alex-vazquez-unity3d Mar 9, 2021
45119e0
Rename Density Volume to Local Volumetric Fog on the codebase
alex-vazquez-unity3d Mar 10, 2021
474a6f8
UX changes
alex-vazquez-unity3d Mar 10, 2021
7a6f876
Update screenshot
alex-vazquez-unity3d Mar 11, 2021
fd048c0
Deprecated.cs, move variables to be named localVolumetricFog
alex-vazquez-unity3d Mar 11, 2021
c88233a
Format
alex-vazquez-unity3d Mar 11, 2021
ddb60ec
update whats-new
alex-vazquez-unity3d Mar 11, 2021
89d5bad
Upgrading guide update
alex-vazquez-unity3d Mar 11, 2021
2129ff1
Removing s from LocalVolumetricFogs
alex-vazquez-unity3d Mar 11, 2021
ab9014c
Merge branch 'master' into x-pipeline/RenameDensityVolume
alex-vazquez Mar 11, 2021
9936af2
Reworded what's new entry
JordanL8 Mar 11, 2021
ec15788
Reworded the upgrading guide content
JordanL8 Mar 11, 2021
771ca39
Format
alex-vazquez-unity3d Mar 12, 2021
359d3e1
API Updater fixes
alex-vazquez-unity3d Mar 12, 2021
d1759d5
Remove classes that are from 12 version
alex-vazquez-unity3d Mar 12, 2021
9219508
Last deprecation fixes
alex-vazquez-unity3d Mar 12, 2021
582efc2
Update Changelog
alex-vazquez-unity3d Mar 12, 2021
cc35079
s remove
alex-vazquez-unity3d Mar 12, 2021
066bb50
Reworded parts where find and replace changed context
JordanL8 Mar 16, 2021
21c06a3
Renamed density volume screenshot
JordanL8 Mar 16, 2021
e0c6281
Change of the menu path
alex-vazquez-unity3d Mar 16, 2021
745cf63
Merge remote-tracking branch 'origin/x-pipeline/RenameDensityVolume' …
alex-vazquez-unity3d Mar 16, 2021
356a8fc
Final rewording pass
JordanL8 Mar 16, 2021
a635b52
Merge branch 'x-pipeline/RenameDensityVolume' of https://github.com/U…
JordanL8 Mar 16, 2021
7c612e3
Merge branch 'master' into x-pipeline/RenameDensityVolume
alex-vazquez Mar 17, 2021
96eff70
Fix Runtime compilation
alex-vazquez-unity3d Mar 17, 2021
1c77fbf
Merge remote-tracking branch 'origin/x-pipeline/RenameDensityVolume' …
alex-vazquez-unity3d Mar 17, 2021
d4cacec
Revert changelog merge
alex-vazquez Mar 17, 2021
8f0dd94
Fix object names on runtime
alex-vazquez-unity3d Mar 17, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions com.unity.render-pipelines.core/Editor/CoreEditorUtils.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using System;
using System.IO;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Text;
using UnityEditor.AnimatedValues;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEditor.AnimatedValues;

namespace UnityEditor.Rendering
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using UnityEditor.Rendering;
using UnityEditorInternal;

// TODO(Nicholas): deduplicate with DensityVolumeUI.Drawer.cs.
// TODO(Nicholas): deduplicate with LocalVolumetricFogUI.Drawer.cs.
namespace UnityEditor.Rendering
{
using CED = CoreEditorDrawer<SerializedProbeVolume>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,15 +279,23 @@ public Type autoEnum
{
set
{
enumNames = Enum.GetNames(value).Select(x => new GUIContent(x)).ToArray();

// Linq.Cast<T> on a typeless Array breaks the JIT on PS4/Mono so we have to do it manually
//enumValues = Enum.GetValues(value).Cast<int>().ToArray();

var values = Enum.GetValues(value);
enumValues = new int[values.Length];
enumNames = new GUIContent[values.Length];
for (int i = 0; i < values.Length; i++)
enumValues[i] = (int)values.GetValue(i);
{
var enumValue = values.GetValue(i);
var memInfo = value.GetMember(value.GetEnumName(enumValue));
var name = memInfo[0]
.GetCustomAttributes(typeof(InspectorNameAttribute), false)
.FirstOrDefault() is InspectorNameAttribute attribute ? attribute.displayName : enumValue.ToString();

if (memInfo[0].GetCustomAttributes(typeof(ObsoleteAttribute), false).FirstOrDefault() is ObsoleteAttribute)
name += " (Obsolete)";

enumNames[i] = new GUIContent(name);
enumValues[i] = (int)enumValue;
}

InitIndexes();
InitQuickSeparators();
Expand Down
6 changes: 2 additions & 4 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Changed
- Changed Window/Render Pipeline/HD Render Pipeline Wizard to Window/Rendering/HDRP Wizard
- Removed the material pass probe volumes evaluation mode.
- Changed GameObject/Rendering/Density Volume to GameObject/Volume/Density Volume
- Changed GameObject/Rendering/Decal Projector to GameObject/Decal Projector
- Changed GameObject/Rendering/Density Volume to GameObject/Rendering/Local Volumetric Fog
- Changed GameObject/Volume/Sky and Fog Volume to GameObject/Volume/Sky and Fog Global Volume
- Move the Decal Gizmo Color initialization to preferences
- Unifying the history validation pass so that it is only done once for the whole frame and not per effect.
Expand Down Expand Up @@ -159,8 +158,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Decreased the minimal Fog Distance value in the Density Volume to 0.05.
- Virtual Texturing Resolver now performs RTHandle resize logic in HDRP instead of in core Unity
- Cached the base types of Volume Manager to improve memory and cpu usage.
- Reduced the maximal number of bounces for both RTGI and RTR (case 1318876).
- Added tooltips to warn when some features may be disabled depending on MSAA/raytracing usage.
- Changed Density Volume for Local Volumetric Fog

## [11.0.0] - 2020-10-21

Expand Down

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
## Density Volume
## Local Volumetric Fog

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 Density Volume. A Density Volume is a an additive 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. Currently, HDRP supports 3D textures at a resolution of 32x32x32.
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 an additive 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. Currently, HDRP supports 3D textures at a resolution of 32x32x32.

HDRP voxelizes Density Volumes to enhance performance. This results in two limitations:
HDRP voxelizes Local Volumetric Fog to enhance performance. This results in two limitations:

- Density Volumes do not support volumetric shadowing. If you place a Density Volume between a Light and a surface, the Volume does not decrease the intensity of light that reaches the surface.
- Density Volumes are voxelized at a very coarse rate, with typically only 64 or 128 slices along the camera's focal axis. This can cause noticeable aliasing at the boundary of the Volume. You can hide the aliasing by using Density Volumes in conjunction with some global fog, if possible. You can also use a Density Mask and a non-zero Blend Distance to decrease the hardness of the edge.
- Local Volumetric Fog does not 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.
- Local Volumetric Fog is voxelized at a very coarse rate, with typically only 64 or 128 slices along the camera's focal axis. This can cause noticeable aliasing at the boundary of the Volume. You can hide the aliasing by using Local Volumetric Fog in conjunction with some global fog, if possible. You can also use a Density Mask and a non-zero Blend Distance to decrease the hardness of the edge.

To create a Density Volume, right click in the Hierarchy and select __Volume > Density Volume__. Alternatively, you can use the menu bar at the top of the screen and navigate to __GameObject > Volume > Density Volume__.
To create Local Volumetric Fog, right click in the Hierarchy and select __Volume > Local Volumetric Fog__. Alternatively, you can use the menu bar at the top of the screen and navigate to __GameObject > Volume > Local Volumetric Fog__.


# Properties

![](Images/DensityVolume1.png)
![](Images/LocalVolumetricFog1.png)



Expand All @@ -25,24 +25,24 @@ To create a Density Volume, right click in the Hierarchy and select __Volume > D
| **Blend Distance** | Blend Distance creates a fade from the fog level in the Volume to the fog level outside it. This is not a percentage, it is the absolute distance from the edge of the Volume bounds, defined by the Size property, where the fade starts. Unity clamps this value between 0 and half of the lowest axis value in the Size property. If you use the Normal tab, you can alter a single float value named Blend Distance, which gives a uniform fade in every direction. If you open the Advanced tab, you can use two fades per axis, one for each direction. For example, on the x-axis you could have one for left-to-right and one for right-to-left. Setting the distance to 0 hides the fade, while setting the distance to 1 creates a fade. |
| **Falloff Mode** | Controls the falloff function applied to the blending of **Blend Distance**. By default the falloff is linear but you can change it to exponential for a more realistic look. |
| **Invert Blend** | Reverses the direction of the fade. Setting the Blend Distances on each axis to its maximum possible value preserves the fog at the center of the Volume and fades the edges. Inverting the blend fades the center and preserves the edges instead. |
| **Distance Fade Start** | Distance from the camera at which the Density Volume starts to fade out. This is useful when optimizing a scene with many Density Volumes and making the more distant ones disappear|
| **Distance Fade End** | Distance from the camera at which the Density Volume has completely fade out. This is useful when optimizing a scene with many Density Volumes and making the more distant ones disappear|
| **Density Mask Texture** | Specifies a 3D texture mapped to the interior of the Volume. The Density Volume only uses the RGB channels of the texture for the fog color and A for the fog density multiplier. A value of 0 in the Texture alpha channel results in a Volume of 0 density, and the value of 1 results in the original constant (homogeneous) volume. |
| **Scroll Speed** | Specifies the speed (per-axis) at which the Density Volume scrolls the texture. If you set every axis to 0, the Density Volume does not scroll the texture and the fog is static. |
| **Distance Fade Start** | Distance from the camera at which the Local Volumetric Fog starts to fade out. This is useful when optimizing a scene with a lot of Local Volumetric Fog and making the more distant ones disappear|
| **Distance Fade End** | Distance from the camera at which the Local Volumetric Fog has completely faded out. This is useful when optimizing a scene with a lot of Local Volumetric Fog and making the more distant ones disappear|
| **Density Mask Texture** | Specifies a 3D texture mapped to the interior of the Volume. Local Volumetric Fog only uses the RGB channels of the texture for the fog color and A for the fog density multiplier. A value of 0 in the Texture alpha channel results in a Volume of 0 density, and the value of 1 results in the original constant (homogeneous) volume. |
| **Scroll Speed** | Specifies the speed (per-axis) at which the Local Volumetric Fog scrolls the texture. If you set every axis to 0, the Local Volumetric Fog does not scroll the texture and the fog is static. |
| **Tiling** | Specifies the per-axis tiling rate of the texture. For example, setting the x-axis component to 2 means that the texture repeats 2 times on the x-axis within the interior of the volume. |

## Related Settings in the HDRP Asset

There are two settings related to density volumes in the HDRP Asset settings: **Max Density Volume Size** and **Max Density Volume On Screen**. You can find both of these settings in the HDRP Asset's **Lighting** section.
There are two settings related to Local Volumetric Fog in the HDRP Asset settings: **Max Local Volumetric Fog Size** and **Max Local Volumetric Fog On Screen**. You can find both of these settings in the HDRP Asset's **Lighting** section.

![](Images/HDRPAsset_VolumetricSettings.png)

The **Max Density Volume Size** controls the maximum resolution you can use for the **Density Mask Texture**. Changing this setting can have a large impact on memory usage. For information on how much memory HDRP allocates for the Density Volume system, see the info box below this setting in the HDRP Asset.
The **Max Local Volumetric Fog Size** controls the maximum resolution you can use for the **Density Mask Texture**. Changing this setting can have a large impact on memory usage. For information on how much memory HDRP allocates for the Local Volumetric Fog system, see the info box below this setting in the HDRP Asset.

The **Max Density Volume On Screen** controls how many Density Volumes can appear on-screen at once. This setting also has an impact on memory.
The **Max Local Volumetric Fog On Screen** controls how many Local Volumetric Fog components can appear on-screen at once. This setting also has an impact on memory.

## Creating a Density Mask Texture

1. In image-editing software of your choice, prepare an RGBA flipbook texture and [import it as a 3D texture](https://docs.unity3d.com/2020.2/Documentation/Manual/class-Texture3D.html). For example, a texture of size 1024x32 describes a 3D texture of size 32x32x32 with 32 slices laid out one after another.

2. Open a Density Volume component and assign the texture you just imported to the __Texture__ field in the __Density Mask Texture__ section.
2. Open a Local Volumetric Fog component and assign the texture you just imported to the __Texture__ field in the __Density Mask Texture__ section.
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ The **Lighting** panel has tools that you can use to visualize various component
| ------------------------------------ | ------------------------------------------------------------ |
| **Fullscreen Debug Mode** | Use the drop-down to select a fullscreen lighting effect to debug. For example, you can visualize [Contact Shadows](Override-Contact-Shadows.md), the depth pyramid, and indirect diffuse lighting. |
| **Tile/Cluster Debug** | Use the drop-down to select an internal HDRP lighting structure to visualize on screen.<br/>&#8226; **None**: Select this option to turn off this debug feature.<br/>&#8226; **Tile**: Select this option to show an overlay of each lighting tile, and the number of lights in them.<br/>&#8226; **Cluster**: Select this option to show an overlay of each lighting cluster that intersects opaque geometry, and the number of lights in them.<br/>&#8226; **Material Feature Variants**: Select this option to show the index of the lighting Shader variant that HDRP uses for a tile. You can find variant descriptions in the *lit.hlsl* file. |
| **- Tile/Cluster Debug By Category** | Use the drop-down to select the Light type that you want to show the Tile/Cluster debug information for. The options include [Light Types](Light-Component.md), [Decals](Decal-Projector.md), and [Density Volumes](Density-Volume.md).<br/>This property only appears when you select **Tile** or **Cluster** from the **Tile/Cluster Debug** drop-down. |
| **- Tile/Cluster Debug By Category** | Use the drop-down to select the Light type that you want to show the Tile/Cluster debug information for. The options include [Light Types](Light-Component.md), [Decals](Decal-Projector.md), and [Local Volumetric Fog](Local-Volumetric-Fog.md).<br/>This property only appears when you select **Tile** or **Cluster** from the **Tile/Cluster Debug** drop-down. |
| **- Cluster Debug Mode** | Use the drop-down to select the visualization mode for the cluster. The options are:<br/> **VisualizeOpaque**: Shows cluster information on opaque geometry.<br/> **VisualizeSlice**: Shows cluster information at a set distance from the camera.<br/>This property only appears when you select **Cluster** from the **Tile/Cluster Debug** drop-down.. |
| **- Cluster Distance** | Use this slider to set the distance from the camera at which to display the cluster slice. This property only appears when you select **VisualizeSlice** from the **Cluster Debug Mode** drop-down. |
| **Display Sky Reflection** | Enable the checkbox to display an overlay of the cube map that the current sky generates and HDRP uses for lighting. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
* [Environment Lighting](Environment-Lighting.md)
* [Clouds in HDRP](clouds-in-hdrp.md)
* [Atmospheric Scattering](Atmospheric-Scattering.md)
* [Density Volume](Density-Volume.md)
* [Local Volumetric Fog](Local-Volumetric-Fog.md)
* [Light Layers](Light-Layers.md)
* [Shadows](Shadows-in-HDRP.md)
* [Shadowmasks](Lighting-Mode-Shadowmask.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,10 @@ With:
protected override void Execute(CustomPassContext ctx) { ... }
```

## Density Volume Mask Texture
## Local Volumetric Fog Mask Texture

Previously, to convert a 2D flipbook texture to the 3D format Density Mask Textures require, you needed to use the __Density Volume Texture Tool__ in the __Window > Rendering__ menu.
From Unity 2020.2, you can now do this conversion directly through the __Texture Importer__. For information on how to use the importer to convert the flipbook texture, see the [Density Volume documentation](Density-Volume.md).
Previously, to convert a 2D flipbook texture to the 3D format Density Mask Textures require, you needed to use the __Local Volumetric Fog Texture Tool__ in the __Window > Rendering__ menu.
From Unity 2020.2, you can now do this conversion directly through the __Texture Importer__. For information on how to use the importer to convert the flipbook texture, see the [Local Volumetric Fog documentation](Local-Volumetric-Fog.md).

## Diffusion Profiles

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ From 2021.2, if material ambient occlusion needs to be applied to probe volume G

HDRP 2021.2 includes the "ForwardEmissiveForDeferred" shader pass and the associated SHADERPASS_FORWARD_EMISSIVE_FOR_DEFERRED define for Materials that have a GBuffer pass. You can see the new pass in Lit.shader. When you use the Deferred Lit shader mode, Unity uses "ForwardEmissiveForDeferred" to render the emissive contribution of a Material in a separate forward pass. Otherwise, Unity ignores "ForwardEmissiveForDeferred".

## Density Volumes

Density Volumes are now known as **Local Volumetric Fog**. If a Scene uses Density Volumes, HDRP automatically migrates the GameObjects to use the new component name, with all the same properties set for the Density Volume. However, if you reference a **Density Volume** through a C# script, a warning appears (**DensityVolume has been deprecated (UnityUpgradable) -> Local Volumetric Fog**) in the Console window. To resolve this, change your code to target the new component. This warning may stop your Project from compiling in future versions of HDRP.

## ClearFlag

ClearFlag.Depth does not implicitely clear stencil anymore. ClearFlag.Stencil added.
Loading