Skip to content

Conversation

alex-vazquez
Copy link
Contributor

@alex-vazquez alex-vazquez commented Mar 9, 2021

Purpose of this PR

Rename Density Volume to Local Volumetric Fog

https://jira.unity3d.com/browse/XPIPELINE-90

Many of the changes done on this #2751, had been directly renamed as everything will go on the same version.

I've improved the Volumetric section on the HDRP Pipeline Asset Inspector, checked with @TheoWong-pixel

From this:

image

To this:

image

Deprecating old Density Volume public enums, clases, and methods all in a single new File Deprecated.cs as URP is doing.

Added support for InspectorNameAttribute for enumerations that will be added to the Render Pipeline Debugger Window

image


Testing status

  • Check the menu items and the component name are the new ones

image

  • Create a Density Volume with modified parameters in an old version, apply the rename and open it with my changes

Old Version:
image
New Version
image

  • Open the HDRP template and see that no errors are shown for density volumes
    image

  • Check that if a new version uses the old API, there is a warning
    image

  • Check the API Updater correctly changes the class names. Go to previous package 2021.1 and save a Density Volume, and script that obtains the component and the parameters. See that my new version the API Updater properly updates everything.

  • Run HDRP unit test locally

@alex-vazquez alex-vazquez self-assigned this Mar 9, 2021
@github-actions github-actions bot added the HDRP label Mar 9, 2021
Copy link
Contributor

@sebastienlagarde sebastienlagarde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR appreciated.
However I was guessing we were agree that we need to rename the C# class, to not create a discrepancy between display and script code. With all the migration problem issue, what is the status regarding this? Can we explore is there is a way to rename the class and perform a migration? thanks

Copy link
Contributor

@jenniferd-unity jenniferd-unity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having things half and half is weird in the code base but if HDRP team agrees i am good for it

| **Size** | Controls the dimensions of the Volume. |
| **Per Axis Control** | Enable this to control blend distance per axis instead of globally. |
| **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. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the image also needs updating

@JordanL8
Copy link
Contributor

The current stuff looks good although this needs an entry in the what's new page to explain the change. Also, if there is anything the user needs to do to upgrade their project (changed class name etc...), we need an entry in the relevant upgrading page. Also, as Jenny pointed out, the screenshots need updating too. Could you add these and ping me for a review?

  • What's new: A simple entry explaining the change and why we've done it.
  • Upgrade guide: If we need one, explain the change in brief, link to the whats new page for more information, and add a list of steps the user needs to perform to migrate their project.
  • Screenshots: Replace the current screenshots of the density volume Inspector with those for the local volumetric fog using the dark theme, without the developer circle thing, and using the minimum width possible without truncating the property names.

Thanks!

Copy link
Contributor

@sebastienlagarde sebastienlagarde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow incredible PR :D, thanks for this change. We will need to check with QA that migration happen well, but very great work

@sebastienlagarde
Copy link
Contributor

oh forget to mention, please add a sectionin upgrade guide to mention this change, thanks

@alex-vazquez alex-vazquez changed the title Rename Density Volume to Local Volumetric Fog UX and Documentation part Rename Density Volume to Local Volumetric Fog Mar 11, 2021
@alex-vazquez alex-vazquez requested review from JordanL8, JulienIgnace-Unity, RSlysz and jenniferd-unity and removed request for JordanL8 March 11, 2021 14:37
@alex-vazquez alex-vazquez marked this pull request as ready for review March 12, 2021 15:34
@github-actions github-actions bot added the SRP label Mar 12, 2021
Copy link
Contributor

@RSlysz RSlysz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point. if it land in same 12.x.x release, it is ok.

@alex-vazquez alex-vazquez requested a review from a team March 15, 2021 15:14
Copy link
Contributor

@jenniferd-unity jenniferd-unity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving as is but note I would prefer to move the menu under Rendering.

{
[MenuItem("GameObject/Volume/Density Volume", priority = CoreUtils.Sections.section2 + CoreUtils.Priorities.gameObjectMenuPriority + 2)]
static void CreateDensityVolumeGameObject(MenuCommand menuCommand)
[MenuItem("GameObject/Local Volumetric Fog", priority = CoreUtils.Priorities.gameObjectMenuPriority + 2)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TheoWong-pixel could you confirm?

Copy link
Contributor

@TomasKiniulis TomasKiniulis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the detailed description Alex! Updating template from 2020.3.1f1 to PR with additional various density volumes added seems to work correctly for me.

Listed some minor findings related to docs. Some sections do not sound grammatically correct where "Density Volumes" are replaced with "Local Volumetric Fog". @JordanL8 could you confirm if suggested changes are correct?


- 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 do not support volumetric shadowing. If you place a Local Volumetric Fog between a Light and a surface, the Volume does not decrease the intensity of light that reaches the surface.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Local Volumetric Fog do not support volumetric shadowing

Local Volumetric Fog does not support volumetric shadowing.

- 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 do not support volumetric shadowing. If you place a 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 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 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Local Volumetric Fog are voxelized at a very coarse rate

Local Volumetric Fog is voxelized at a very coarse rate

| **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 many Local Volumetric Fog and making the more distant ones disappear|
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is useful when optimizing a scene with many Local Volumetric Fog and making the more distant ones disappear

Should it be something like: "This is useful when optimizing a scene with lots of Local Volumetric Fogs 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 many 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 fade out. This is useful when optimizing a scene with many Local Volumetric Fog and making the more distant ones disappear|
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is useful when optimizing a scene with many Local Volumetric Fog and making the more distant ones disappear

Maybe it should be "This is useful when optimizing a scene with lots of Local Volumetric Fogs and making the more distant ones disappear"?

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 can appear on-screen at once. This setting also has an impact on memory.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Max Local Volumetric Fog On Screen controls how much Local Volumetric Fog can appear on-screen at once. This setting also has an impact on memory.

@alex-vazquez alex-vazquez added ready-to-merge Add this tag whenever your PR is ready to be merged. i.e, non draft, all reviewers approved, ABV and removed ready-to-merge Add this tag whenever your PR is ready to be merged. i.e, non draft, all reviewers approved, ABV labels Mar 17, 2021
@sebastienlagarde sebastienlagarde merged commit 9320b66 into master Mar 17, 2021
@sebastienlagarde sebastienlagarde deleted the x-pipeline/RenameDensityVolume branch March 17, 2021 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants