diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 604d86a388a..7a2f31e71ef 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -356,6 +356,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed controls for clouds fade in (case 1353548). - Reduced the number shader variants for the volumetric clouds. - Fixed motion vector for custom meshes loaded from compute buffer in shader graph (like Hair) +- Fixed incorrect light list indexing when TAA is enabled (case 1352444). +- Fixed Additional Velocity for Alembic not taking correctly into account vertex animation +- Fixed wrong LUT initialization in Wireframe mode. ### Changed - Changed Window/Render Pipeline/HD Render Pipeline Wizard to Window/Rendering/HDRP Wizard diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/AxF/AxF.cs b/com.unity.render-pipelines.high-definition/Runtime/Material/AxF/AxF.cs index 489c371127a..ea7d72c319c 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/AxF/AxF.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/AxF/AxF.cs @@ -285,6 +285,13 @@ public override void RenderInit(CommandBuffer cmd) return; } + if (GL.wireframe) + { + m_preIntegratedFGD_Ward.Create(); + m_preIntegratedFGD_CookTorrance.Create(); + return; + } + using (new ProfilingScope(cmd, ProfilingSampler.Get(HDProfileId.PreIntegradeWardCookTorrance))) { CoreUtils.DrawFullScreen(cmd, m_preIntegratedFGDMaterial_Ward, new RenderTargetIdentifier(m_preIntegratedFGD_Ward)); diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/PreIntegratedFGD/PreIntegratedFGD.cs b/com.unity.render-pipelines.high-definition/Runtime/Material/PreIntegratedFGD/PreIntegratedFGD.cs index daec7e402bf..450447008ff 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/PreIntegratedFGD/PreIntegratedFGD.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/PreIntegratedFGD/PreIntegratedFGD.cs @@ -104,6 +104,14 @@ public void RenderInit(FGDIndex index, CommandBuffer cmd) if (m_isInit[(int)index] && m_PreIntegratedFGD[(int)index].IsCreated()) return; + // If we are in wireframe mode, the drawfullscreen will not work as expected, but we don't need the LUT anyway + // So create the texture to avoid errors, it will be initialized by the first render without wireframe + if (GL.wireframe) + { + m_PreIntegratedFGD[(int)index].Create(); + return; + } + CoreUtils.DrawFullScreen(cmd, m_PreIntegratedFGDMaterial[(int)index], new RenderTargetIdentifier(m_PreIntegratedFGD[(int)index])); m_isInit[(int)index] = true; } diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs index 547cf4313ad..37bcc7913f2 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs @@ -1689,7 +1689,7 @@ void UpdateVolumeAndPhysicalParameters() } } - Matrix4x4 GetJitteredProjectionMatrix(Matrix4x4 origProj) + internal Matrix4x4 GetJitteredProjectionMatrix(Matrix4x4 origProj) { // Do not add extra jitter in VR unless requested (micro-variations from head tracking are usually enough) if (xr.enabled && !HDRenderPipeline.currentAsset.currentPlatformRenderPipelineSettings.xrSettings.cameraJitter) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.LightLoop.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.LightLoop.cs index bbe6611d9e9..2d2b3cb8884 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.LightLoop.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.LightLoop.cs @@ -417,6 +417,9 @@ unsafe void PrepareBuildGPULightListPassData( for (int viewIndex = 0; viewIndex < hdCamera.viewCount; ++viewIndex) { var proj = hdCamera.xr.enabled ? hdCamera.xr.GetProjMatrix(viewIndex) : camera.projectionMatrix; + // Note: we need to take into account the TAA jitter when indexing the light list + proj = hdCamera.RequiresCameraJitter() ? hdCamera.GetJitteredProjectionMatrix(proj) : proj; + m_LightListProjMatrices[viewIndex] = proj * s_FlipMatrixLHSRHS; var tempMatrix = temp * m_LightListProjMatrices[viewIndex]; diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/MotionVectorVertexShaderCommon.hlsl b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/MotionVectorVertexShaderCommon.hlsl index b9dd586bfdb..914c40b2fc9 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/MotionVectorVertexShaderCommon.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/MotionVectorVertexShaderCommon.hlsl @@ -141,9 +141,6 @@ PackedVaryingsType MotionVectorVS(VaryingsType varyingsType, AttributesMesh inpu #endif float3 effectivePositionOS = (hasDeformation ? inputPass.previousPositionOS : inputMesh.positionOS); -#if defined(_ADD_PRECOMPUTED_VELOCITY) - effectivePositionOS -= inputPass.precomputedVelocity; -#endif @@ -170,6 +167,10 @@ PackedVaryingsType MotionVectorVS(VaryingsType varyingsType, AttributesMesh inpu previousMesh.positionOS -= GetCustomVelocity(previousMesh); #endif +#if defined(_ADD_PRECOMPUTED_VELOCITY) + previousMesh.positionOS -= inputPass.precomputedVelocity; +#endif + float3 previousPositionRWS = TransformPreviousObjectToWorld(previousMesh.positionOS); #else @@ -177,6 +178,10 @@ PackedVaryingsType MotionVectorVS(VaryingsType varyingsType, AttributesMesh inpu effectivePositionOS -= GetCustomVelocity(inputMesh); #endif +#if defined(_ADD_PRECOMPUTED_VELOCITY) + effectivePositionOS -= inputPass.precomputedVelocity; +#endif + float3 previousPositionRWS = TransformPreviousObjectToWorld(effectivePositionOS); #endif