diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/VolumetricLighting/VolumetricCloudsEditor.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/VolumetricLighting/VolumetricCloudsEditor.cs
index f8de3f5cd4d..9c7114e3115 100644
--- a/com.unity.render-pipelines.high-definition/Editor/Lighting/VolumetricLighting/VolumetricCloudsEditor.cs
+++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/VolumetricLighting/VolumetricCloudsEditor.cs
@@ -46,9 +46,7 @@ class VolumetricCloudsEditor : VolumeComponentEditor
SerializedDataParameter m_DensityMultiplier;
SerializedDataParameter m_ShapeFactor;
SerializedDataParameter m_ShapeScale;
- SerializedDataParameter m_ShapeOffsetX;
- SerializedDataParameter m_ShapeOffsetY;
- SerializedDataParameter m_ShapeOffsetZ;
+ SerializedDataParameter m_ShapeOffset;
SerializedDataParameter m_ErosionFactor;
SerializedDataParameter m_ErosionScale;
SerializedDataParameter m_ErosionNoiseType;
@@ -126,9 +124,7 @@ public override void OnEnable()
m_DensityMultiplier = Unpack(o.Find(x => x.densityMultiplier));
m_ShapeFactor = Unpack(o.Find(x => x.shapeFactor));
m_ShapeScale = Unpack(o.Find(x => x.shapeScale));
- m_ShapeOffsetX = Unpack(o.Find(x => x.shapeOffsetX));
- m_ShapeOffsetY = Unpack(o.Find(x => x.shapeOffsetY));
- m_ShapeOffsetZ = Unpack(o.Find(x => x.shapeOffsetZ));
+ m_ShapeOffset = Unpack(o.Find(x => x.shapeOffset));
m_ErosionFactor = Unpack(o.Find(x => x.erosionFactor));
m_ErosionScale = Unpack(o.Find(x => x.erosionScale));
m_ErosionNoiseType = Unpack(o.Find(x => x.erosionNoiseType));
@@ -234,9 +230,7 @@ public override void OnInspectorGUI()
}
PropertyField(m_ShapeFactor);
PropertyField(m_ShapeScale);
- PropertyField(m_ShapeOffsetX);
- PropertyField(m_ShapeOffsetY);
- PropertyField(m_ShapeOffsetZ);
+ PropertyField(m_ShapeOffset);
PropertyField(m_ErosionFactor);
PropertyField(m_ErosionScale);
PropertyField(m_ErosionNoiseType);
@@ -248,11 +242,7 @@ public override void OnInspectorGUI()
}
}
else
- {
- PropertyField(m_ShapeOffsetX);
- PropertyField(m_ShapeOffsetY);
- PropertyField(m_ShapeOffsetZ);
- }
+ PropertyField(m_ShapeOffset);
}
PropertyField(m_EarthCurvature);
diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/HDRenderPipeline.VolumetricClouds.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/HDRenderPipeline.VolumetricClouds.cs
index ef1175bb30d..73f366b80f3 100644
--- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/HDRenderPipeline.VolumetricClouds.cs
+++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/HDRenderPipeline.VolumetricClouds.cs
@@ -439,8 +439,8 @@ void UpdateShaderVariableslClouds(ref ShaderVariablesClouds cb, HDCamera hdCamer
cb._ShapeScale = cloudModelData.shapeScale;
cb._ErosionFactor = cloudModelData.erosionFactor;
cb._ErosionScale = cloudModelData.erosionScale;
- cb._ShapeNoiseOffset = new Vector2(settings.shapeOffsetX.value, settings.shapeOffsetZ.value);
- cb._VerticalShapeNoiseOffset = settings.shapeOffsetY.value;
+ cb._ShapeNoiseOffset = new Vector2(settings.shapeOffset.value.x, settings.shapeOffset.value.z);
+ cb._VerticalShapeNoiseOffset = settings.shapeOffset.value.y;
// If the sun has moved more than 2.0°, reduce significantly the history accumulation
float sunAngleDifference = 0.0f;
diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricClouds.Migration.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricClouds.Migration.cs
index 04ccc55904c..df58db1052f 100644
--- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricClouds.Migration.cs
+++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricClouds.Migration.cs
@@ -23,6 +23,7 @@ enum Version
{
Initial,
GlobalWind,
+ ShapeOffset,
Count
}
@@ -44,6 +45,13 @@ enum Version
mode = WindParameter.WindOverrideMode.Custom,
customValue = c.m_ObsoleteOrientation.value
};
+#pragma warning restore 618
+ }),
+ MigrationStep.New(Version.ShapeOffset, (VolumetricClouds c) =>
+ {
+#pragma warning disable 618 // Type or member is obsolete
+ c.shapeOffset.overrideState = c.m_ObsoleteShapeOffsetX.overrideState || c.m_ObsoleteShapeOffsetY.overrideState || c.m_ObsoleteShapeOffsetZ.overrideState;
+ c.shapeOffset.value = new Vector3(c.m_ObsoleteShapeOffsetX.value, c.m_ObsoleteShapeOffsetY.value, c.m_ObsoleteShapeOffsetZ.value);
#pragma warning restore 618
})
);
@@ -61,5 +69,13 @@ void Awake()
MinFloatParameter m_ObsoleteWindSpeed = new MinFloatParameter(1.0f, 0.0f);
[SerializeField, FormerlySerializedAs("orientation"), Obsolete("For Data Migration")]
ClampedFloatParameter m_ObsoleteOrientation = new ClampedFloatParameter(0.0f, 0.0f, 360.0f);
+
+ [SerializeField, FormerlySerializedAs("shapeOffsetX"), Obsolete("For Data Migration")]
+ FloatParameter m_ObsoleteShapeOffsetX = new FloatParameter(0.0f);
+ [SerializeField, FormerlySerializedAs("shapeOffsetY"), Obsolete("For Data Migration")]
+ FloatParameter m_ObsoleteShapeOffsetY = new FloatParameter(0.0f);
+ [SerializeField, FormerlySerializedAs("shapeOffsetZ"), Obsolete("For Data Migration")]
+ FloatParameter m_ObsoleteShapeOffsetZ = new FloatParameter(0.0f);
+
}
}
diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricClouds.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricClouds.cs
index 14a00161465..57d1a1acbdd 100644
--- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricClouds.cs
+++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricClouds.cs
@@ -379,22 +379,10 @@ public CloudFadeInModeParameter(CloudFadeInMode value, bool overrideState = fals
public MinFloatParameter shapeScale = new MinFloatParameter(2.5f, 0.1f);
///
- /// Controls the offset (world X-axis) applied when evaluating the larger noise passing through the cloud coverage.
+ /// Controls the world space offset applied when evaluating the larger noise passing through the cloud coverage.
///
- [Tooltip("Controls the offset (world X-axis) applied when evaluating the larger noise passing through the cloud coverage.")]
- public FloatParameter shapeOffsetX = new FloatParameter(0.0f);
-
- ///
- /// Controls the offset (world Y-axis) applied when evaluating the larger noise passing through the cloud coverage.
- ///
- [Tooltip("Controls the offset (world Y-axis) applied when evaluating the larger noise passing through the cloud coverage.")]
- public FloatParameter shapeOffsetY = new FloatParameter(0.0f);
-
- ///
- /// Controls the offset (world Z-axis) applied when evaluating the larger noise passing through the cloud coverage.
- ///
- [Tooltip("Controls the offset (world Z-axis) applied when evaluating the larger noise passing through the cloud coverage.")]
- public FloatParameter shapeOffsetZ = new FloatParameter(0.0f);
+ [Tooltip("Controls the world space offset applied when evaluating the larger noise passing through the cloud coverage.")]
+ public Vector3Parameter shapeOffset = new Vector3Parameter(Vector3.zero);
///
/// Controls the smaller noise on the edge of the clouds. A higher value will erode clouds more significantly.