Skip to content

Add import dialog to add a new diffusion profile to the global settings #4743

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

Merged
merged 38 commits into from
Jun 8, 2021

Conversation

FrancescoC-unity
Copy link
Contributor

@FrancescoC-unity FrancescoC-unity commented Jun 1, 2021

Addressing https://unity.slack.com/archives/C6Y79CZM0/p1621941147179000

This PR introduces a dialog on import of a material with a diffusion profile. The user can then add a diffusion profile automatically to the global settings if there is space for it.

diffusionProfileLoad.mp4

Added Vic as I am not sure the wording on the dialog box is good enough :D

Adding @alelievr as I remember you worked on diffusion profiles? Ignore this review if I am misremembering.

What did I test: can see the video above, I also tested that an already added profile doesn't prompt a dialog box and if there is no space in the diffusion profile list similarly no dialog is displayed.

pmavridis and others added 30 commits May 26, 2021 19:23
* Fix AxF debug output in certain configurations.

* Update comment
* Fix white flash

* changelog

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>
* Show info box when ray tracing is enabled.

* Changelog

* Move below MSAA

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>
…phics Compositor enabled (#4593)

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>
* Reconstruct jittered projection matrix far plane (for Infinite )

* Changelog

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>
…DRP's lifecycle. (#4688)

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>
* Fix overdraw in custom pass utils blur function

* Updated changelog

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>
* Fix

* changelog

* Force sync compilation for TAA

Co-authored-by: CifaCia <f.cifariellociardi@gmail.com>
Co-authored-by: sebastienlagarde <sebastien@unity3d.com>
Co-authored-by: sebastienlagarde <sebastien@unity3d.com>
…side is updated. (case 1335737, related to 1314040) (#4691)

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>
…ing only the RTSSS Data (case 1332904). (#4626)

* Fixed the ray traced sub subsurface scattering debug mode not displaying only the RTSSS Data (case 1332904).

* Add test scene

Co-authored-by: Remi Chapelain <remi.chapelain@unity3d.com>
Co-authored-by: Sebastien Lagarde <sebastien@unity3d.com>
…e refraction and probe refraction (#4653)

* Delete the second transmittance mul

* Changelog

Co-authored-by: Sebastien Lagarde <sebastien@unity3d.com>
#4636)

* Initialize the shading normal to a non-zero value for anisotropy

* Changelog

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>
* Fix VfX lit particle aov output color space

* Update comment

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>
* Fixed issue with transparent unlit.

* Updated changelog.

* Reverted accidental change to default mtl.

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>
* Fix

* changelog

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>
…cal volumetric fog volume (#4728)

* Fixed nullref when deleting the 3D mask of a density volume (case 1339330)

* Updated changelog

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>
@FrancescoC-unity
Copy link
Contributor Author

FrancescoC-unity commented Jun 2, 2021

Quickly tested with importing material samples since there's 7 differents diff profile there.

And the only thing that fails is for Eye shader. There's this node that takes 2 diff profile in input that are not included in the batch in material importer. Is there something we can do about this since this is node accessible by everyone in utility SG nodes ?

image

Also, since there's an upper limit of diffusion profile that can be added (weirdly 15), when your list is nearly full, when importing new materials with new diff profile, the new one gets added and then when the list is full, the rest are just skipped without info, is there a way to have either some sort of pop up telling you that the list is full, or a warning for each diffusion profile skipped and the reason why, for the users to know that something just failed silently ? :)

Thanks !

Oh didn't know about the Eye diffusion profiles, I can look into that later on today, though I am not entirely what I can do about it.

Regarding the silently fail, I thought about that but then if you load a lot of assets, you'll end up with potentially a lot of dialog stopping the process saying the same thing which sounds annoying.

I guess what I can do the warning at the end of process in the console.

Copy link
Contributor

@Vic-Cooper Vic-Cooper left a comment

Choose a reason for hiding this comment

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

One small adjustment to the changelog.

@@ -65,6 +65,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Added a slider that controls how much the volumetric clouds erosion value affects the ambient occlusion term.
- Added three animation curves to control the density, erosion, and ambient occlusion in the custom submode of the simple controls.
- Added support for the camera bridge in the graphics compositor
- Added a dialog box on import to add a diffusion profile to the global settings.
Copy link
Contributor

Choose a reason for hiding this comment

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

Tweaked for clarity:

Added a dialog box when you import a Material that has a diffusion profile to add the diffusion profile to global settings.

@remi-chapelain
Copy link
Contributor

I guess what I can do the warning at the end of process in the console.

I am fine with this solution, I agree, it can be hassle when importing huge asset pack !

Copy link
Contributor

@remi-chapelain remi-chapelain left a comment

Choose a reason for hiding this comment

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

Issues have been addressed :), approving ✔️

@remi-chapelain remi-chapelain requested a review from Vic-Cooper June 2, 2021 15:00
AddDiffusionProfileToSettings("_DiffusionProfileAsset");

// Special Eye case that uses a node with diffusion profiles.
if (HDShaderUtils.GetShaderIDsFromShader(material.shader).Item1 == HDShaderUtils.ShaderID.SG_Eye)
Copy link
Member

Choose a reason for hiding this comment

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

All shadergraphs can have a diffusion profile now with the diffusion profile type in the blackboard:
image

This leads to this code being generated:

        [DiffusionProfile]gtuiewwg("gtuiewwg", Float) = 0
[HideInInspector]gtuiewwg_Asset("gtuiewwg", Vector) = (0, 0, 0, 0)

Thus, you can check that a property is a diffusion profile with the [DiffusionProfile] attribute on it. You can get that with this function: https://docs.unity3d.com/ScriptReference/Shader.GetPropertyAttributes.html

@sebastienlagarde sebastienlagarde changed the base branch from hd/bugfix to master June 7, 2021 20:09
@sebastienlagarde sebastienlagarde changed the base branch from master to hd/bugfix June 7, 2021 20:09
@sebastienlagarde
Copy link
Contributor

note to self: retarget to master once hd/bugfix is merge

@sebastienlagarde sebastienlagarde changed the base branch from hd/bugfix to master June 7, 2021 22:20
@sebastienlagarde sebastienlagarde marked this pull request as ready for review June 7, 2021 22:22
@sebastienlagarde
Copy link
Contributor

@FrancescoC-unity
Copy link
Contributor Author

Copy link
Contributor

@Vic-Cooper Vic-Cooper left a comment

Choose a reason for hiding this comment

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

Looks good :)

@sebastienlagarde
Copy link
Contributor

it works, thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.