-
Notifications
You must be signed in to change notification settings - Fork 855
[HDRP] density volumes improvements #2751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
# Conflicts: # com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.cs # com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/Texture3DAtlas.cs # com.unity.render-pipelines.high-definition/Runtime/RenderPipelineResources/HDRenderPipelineResources.asset
{ | ||
volumes.Remove(volume); | ||
} | ||
if (!volumeAtlas.AddTexture(volumeTexture)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might have missed it but does this mean the atlas is updated every frame now? How do we detect if something has changed if not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only happens when the density volume texture is registered so no. Otherwise the it's the atlas that internally checks if the textures needs to be updated with a hash:
https://github.com/Unity-Technologies/Graphics/pull/2751/files#diff-9452a7b53ae106d6e8115c2ce8966e7dec933f97ce8d7241a18130cc5d9d4af7R373
There will be a volumetric lighting performance test in the automated performance test project soon, we can wait for it to be merged and then see the perf impact with the dashboards |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I was hitting only one issue though:
Setting Max Density Volume Size to Resolution 256 throws the following:
D3D11: Failed to create render texture resource (3D, 2048x8192x256 mips=14 dxfmt=27, hr=0x30)
, checking with Antoine a user could be informed with a warning notifying that gpu memory limit is reached
Went through settings, debug modes, exponential/linear settings. No other issues found.
## Creating a Density Mask Texture | ||
|
||
4. Click Apply. | ||
1. In image-editing software of your choice, prepare a grayscale 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
guess it need to be rewrite as it is not grayscale anymore, we handle RGB
com.unity.render-pipelines.high-definition/Documentation~/whats-new-11.md
Outdated
Show resolved
Hide resolved
...er-pipelines.high-definition/Runtime/RenderPipelineResources/HDRenderPipelineResources.asset
Show resolved
Hide resolved
…m/Unity-Technologies/Graphics into HDRP/density-volumes-improvements
@TomasKiniulis I fixed the texture failed to create issue |
Thanks! Seems like a nice way to avoid the issue |
Purpose of this PR
Also, improve the 3D Texture atlas to support different 3D texture resolutions and RGBA 3D textures and real-time GPU copy for 3D render textures.
New volumetric settings in the HDRP asset:

Falloff mode:

Note that the falloff mode doesn't affect the Fade Distance interpolation (which is always linear).
Also added a debug mode to visualize the density volume 3D atlas:

With selection support:

Testing status
Modified the fog volume test with 3D textures of different resolutions and colors:

https://yamato.cds.internal.unity3d.com/jobs/902-Graphics/tree/HDRP%252Fdensity-volumes-improvements/.yamato%252Fall-hdrp.yml%2523PR_HDRP_trunk/4610582/job/full-pipeline
Note:
If you want to author texture 3D in unity I recommend this tool: https://github.com/alelievr/Mixture.
You can ask me for installation :)