Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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 @@ -652,6 +652,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fix an issue with the color intensity of emissive for performance rtgi
- Fixed issue with rendering being mostly broken when target platform disables VR.
- Workaround an issue caused by GetKernelThreadGroupSizes failing to retrieve correct group size.
- Fix inconsistencies with transparent motion vectors and opaque by allowing camera only transparent motion vectors.

### Changed
- Improve MIP selection for decals on Transparents
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,9 @@ unsafe internal void UpdateShaderVariablesGlobalCB(ref ShaderVariablesGlobal cb,

float exposureMultiplierForProbes = 1.0f / Mathf.Max(probeRangeCompressionFactor, 1e-6f);
cb._ProbeExposureScale = exposureMultiplierForProbes;

cb._TransparentCameraOnlyMotionVectors = (frameSettings.IsEnabled(FrameSettingsField.MotionVectors) &&
!frameSettings.IsEnabled(FrameSettingsField.TransparentsWriteMotionVector)) ? 1 : 0;
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3069,6 +3069,7 @@ out ScriptableCullingParameters cullingParams
if (camera.cameraType != CameraType.Game)
{
currentFrameSettings.SetEnabled(FrameSettingsField.ObjectMotionVectors, false);
currentFrameSettings.SetEnabled(FrameSettingsField.TransparentsWriteMotionVector, false);
}

hdCamera = HDCamera.GetOrCreate(camera, xrPass.multipassId);
Expand Down Expand Up @@ -4013,7 +4014,7 @@ void RenderForwardOpaque(CullingResults cullResults, HDCamera hdCamera, Scriptab

static bool NeedMotionVectorForTransparent(FrameSettings frameSettings)
{
return frameSettings.IsEnabled(FrameSettingsField.MotionVectors) && frameSettings.IsEnabled(FrameSettingsField.TransparentsWriteMotionVector) && frameSettings.IsEnabled(FrameSettingsField.ObjectMotionVectors);
return frameSettings.IsEnabled(FrameSettingsField.MotionVectors);
}

RendererListDesc PrepareForwardTransparentRendererList(CullingResults cullResults, HDCamera hdCamera, bool preRefraction)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,13 @@ PackedVaryingsType MotionVectorVS(inout VaryingsType varyingsType, AttributesMes
ApplyVertexModification(inputMesh, normalWS, previousPositionRWS, _LastTimeParameters.xyz);
#endif

#ifdef _WRITE_TRANSPARENT_MOTION_VECTOR
if (_TransparentCameraOnlyMotionVectors > 0)
{
previousPositionRWS = varyingsType.vmesh.positionRWS.xyz;
}
#endif

varyingsType.vpass.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionRWS, 1.0));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,5 +252,10 @@ unsafe struct ShaderVariablesGlobal

[HLSLArray(7, typeof(Vector4))]
public fixed float _ProbeVolumeAmbientProbeFallbackPackedCoeffs[7 * 4]; // 3 bands of SH, packed for storing global ambient probe lighting as fallback to probe volumes.

public int _TransparentCameraOnlyMotionVectors;
public float _Pad8;
public float _Pad9;
public float _Pad10;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ GLOBAL_CBUFFER_START(ShaderVariablesGlobal, b0)
float _ProbeVolumeBilateralFilterWeightMin;
float _ProbeVolumeBilateralFilterWeight;
float4 _ProbeVolumeAmbientProbeFallbackPackedCoeffs[7];
int _TransparentCameraOnlyMotionVectors;
float _Pad8;
float _Pad9;
float _Pad10;
CBUFFER_END


Expand Down