diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index a58c30696d0..525f1a8391e 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -35,6 +35,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed missing context menu for “Post Anti-Aliasing” in Camera (1357283) - Fixed error when disabling opaque objects on a camera with MSAA. - Fixed double camera preview. +- Fixed the volumetric clouds cloud map not being centered over the world origin (case 1364465). ### Changed - Visual Environment ambient mode is now Dynamic by default. diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricClouds.compute b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricClouds.compute index 07f36374940..bddd056f658 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricClouds.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricClouds.compute @@ -399,8 +399,8 @@ float3 AnimateFineNoisePosition(float3 positionPS) void GetCloudCoverageData(float3 positionPS, out CloudCoverageData data) { - // Convert the position into dome space - float2 normalizedPosition = AnimateCloudMapPosition(positionPS).xz / _NormalizationFactor * _CloudMapTiling.xy + _CloudMapTiling.zw; + // Convert the position into dome space and center the texture is centered above (0, 0, 0) + float2 normalizedPosition = AnimateCloudMapPosition(positionPS).xz / _NormalizationFactor * _CloudMapTiling.xy + _CloudMapTiling.zw - 0.5; // Read the data from the texture float4 cloudMapData = SAMPLE_TEXTURE2D_LOD(_CloudMapTexture, s_linear_repeat_sampler, float2(normalizedPosition), 0); data.coverage = float2(cloudMapData.x, cloudMapData.x * cloudMapData.x);