Skip to content

Hd/fix framesettings ordering #5323

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 3 commits into from
Aug 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed Additional Velocity for Alembic not taking correctly into account vertex animation
- Fixed wrong LUT initialization in Wireframe mode.
- Fixed case where the SceneView don't refresh when using LightExplorer with a running and Paused game (1354129)
- Fixed wrong ordering in FrameSettings (Normalize Reflection Probes)

### Changed
- Changed Window/Render Pipeline/HD Render Pipeline Wizard to Window/Rendering/HDRP Wizard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,11 @@ static internal void Drawer_SectionLightingSettings(SerializedFrameSettings seri
area.AmmendInfo(FrameSettingsField.Volumetrics, ignoreDependencies: true);
area.AmmendInfo(FrameSettingsField.ReprojectionForVolumetrics, ignoreDependencies: true);
area.AmmendInfo(FrameSettingsField.TransparentSSR, ignoreDependencies: true);

//TODO: Remove hideUI when out of experimental. I don't like hideUI it make things more difficult to add a FrameSettings at a given position.
// This should not be used except for experimental stuff (it is not compliant with the remaining of UX flows anyway)
area.AmmendInfo(FrameSettingsField.ProbeVolume, hideInUI: !HDRenderPipelineGlobalSettings.Ensure().supportProbeVolumes);
area.AmmendInfo(FrameSettingsField.NormalizeReflectionProbeWithProbeVolume, hideInUI: !HDRenderPipelineGlobalSettings.Ensure().supportProbeVolumes);

area.AmmendInfo(
FrameSettingsField.SssQualityMode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,18 @@ public static OverridableFrameSettingsArea GetGroupContent(int groupIndex, Frame
return area;
}

/// <summary>
/// Ammend the info on a FrameSettings drawer in the generation process.
/// </summary>
/// <param name="field">Targeted FrameSettings.</param>
/// <param name="overrideable">Override the method used to say if it will be overrideable or not. If not, the left checkbox will not be drawn.</param>
/// <param name="ignoreDependencies">Ignore the dependencies when checking if this is overrideable. (Normally, only work if dependency is enabled).</param>
/// <param name="customGetter">Custom method to get the value. Usefull for non boolean FrameSettings.</param>
/// <param name="customSetter">Custom method to set the value. Usefull for non boolean FrameSettings.</param>
/// <param name="overridedDefaultValue">Modify the default value displayed when override is disabled.</param>
/// <param name="labelOverride">Override the given label with this new one.</param>
/// <param name="hasMixedValues">Override the miltiple different state manually. Usefull when using customGetter and customSetter. This is static on the Editor run. But Editor is reconstructed if selection change so it should be ok.</param>
/// <param name="hideInUI">/!\ WARNING: Use with caution. Should not be used with current UX flow. Only usage should be really special cases.</param>
public void AmmendInfo(FrameSettingsField field, Func<bool> overrideable = null, bool ignoreDependencies = false, Func<object> customGetter = null, Action<object> customSetter = null, object overridedDefaultValue = null, string labelOverride = null, bool hasMixedValues = false, bool hideInUI = false)
{
var matchIndex = fields.FindIndex(f => f.field == field);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public enum FrameSettingsField
/// <summary>No Frame Settings.</summary>
None = -1,

//rendering settings from 0 to 19
//rendering settings (group 0)
/// <summary>Specifies the Lit Shader Mode for Cameras using these Frame Settings use to render the Scene.</summary>
[FrameSettingsField(0, autoName: LitShaderMode, type: FrameSettingsFieldAttribute.DisplayType.BoolAsEnumPopup, targetType: typeof(LitShaderMode), customOrderInGroup: 0, tooltip: "Specifies the Lit Shader Mode for Cameras using these Frame Settings use to render the Scene (Depends on \"Lit Shader Mode\" in current HDRP Asset).")]
LitShaderMode = 0,
Expand Down Expand Up @@ -258,7 +258,7 @@ public enum FrameSettingsField
[FrameSettingsField(0, autoName: MaterialQualityLevel, type: FrameSettingsFieldAttribute.DisplayType.Others, tooltip: "The material quality level to use.")]
MaterialQualityLevel = 66,

//lighting settings: 20-39, 46-49
//lighting settings (group 1)
/// <summary>When enabled, Cameras using these Frame Settings render shadows.</summary>
[FrameSettingsField(1, autoName: ShadowMaps, customOrderInGroup: 1, tooltip: "When enabled, Cameras using these Frame Settings render shadows.")]
ShadowMaps = 20,
Expand Down Expand Up @@ -337,7 +337,13 @@ public enum FrameSettingsField
[FrameSettingsField(1, autoName: DirectSpecularLighting, tooltip: "When enabled, Cameras that use these Frame Settings render Direct Specular lighting. This is a useful Frame Setting to use for baked Reflection Probes to remove view dependent lighting.")]
DirectSpecularLighting = 38,

//async settings from 40 to 59
/// <summary>When enabled, HDRP uses probe volumes for baked lighting.</summary>
[FrameSettingsField(1, customOrderInGroup: 3, autoName: ProbeVolume, tooltip: "Enable to debug and make HDRP process Probe Volumes. Enabling this feature causes HDRP to process Probe Volumes for this Camera/Reflection Probe.")]
ProbeVolume = 127,
[FrameSettingsField(1, customOrderInGroup: 4, displayedName: "Normalize Reflection Probes", positiveDependencies: new[] { ProbeVolume })]
NormalizeReflectionProbeWithProbeVolume = 126,

//async settings (group 2)
/// <summary>When enabled, HDRP executes certain Compute Shader commands in parallel. This only has an effect if the target platform supports async compute.</summary>
[FrameSettingsField(2, displayedName: "Asynchronous Execution", tooltip: "When enabled, HDRP executes certain Compute Shader commands in parallel. This only has an effect if the target platform supports async compute.")]
AsyncCompute = 40,
Expand All @@ -357,7 +363,7 @@ public enum FrameSettingsField
[FrameSettingsField(2, displayedName: "Volume Voxelizations", positiveDependencies: new[] { AsyncCompute }, tooltip: "When enabled, HDRP calculates volumetric voxelization asynchronously.")]
VolumeVoxelizationsAsync = 45,

//lightLoop settings from 120 to 127
//lightLoop settings (group 3)
/// <summary>When enabled, HDRP uses FPTL for forward opaque.</summary>
[FrameSettingsField(3, autoName: FPTLForForwardOpaque, tooltip: "When enabled, HDRP uses FPTL for forward opaque.")]
FPTLForForwardOpaque = 120,
Expand All @@ -376,11 +382,6 @@ public enum FrameSettingsField
/// <summary>When enabled, HDRP uses material variant classification to compute lighting.</summary>
[FrameSettingsField(3, autoName: ComputeMaterialVariants, positiveDependencies: new[] { DeferredTile }, tooltip: "When enabled, HDRP uses material variant classification to compute lighting.")]
ComputeMaterialVariants = 125,
/// <summary>When enabled, HDRP uses probe volumes for baked lighting.</summary>
[FrameSettingsField(1, customOrderInGroup: 3, autoName: ProbeVolume, tooltip: "Enable to debug and make HDRP process Probe Volumes. Enabling this feature causes HDRP to process Probe Volumes for this Camera/Reflection Probe.")]
ProbeVolume = 127,
[FrameSettingsField(1, customOrderInGroup: 4, displayedName: "Normalize Reflection Probes", positiveDependencies: new[] { ProbeVolume })]
NormalizeReflectionProbeWithProbeVolume = 126,

//only 128 booleans saved. For more, change the BitArray used
}
Expand Down