浏览代码

- Fixed objects motion vectors (they were upside down)

- Fixed some warnings
/Branch_FixObjectMotion
Julien Ignace 7 年前
当前提交
43ed7b97
共有 3 个文件被更改,包括 9 次插入3 次删除
  1. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Debug/DebugFullScreen.shader
  2. 8
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/MaterialUtilities.hlsl
  3. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/RenderPipelineResources/CopyDepthBuffer.shader

2
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Debug/DebugFullScreen.shader


{
arrow_coord.y = 1.0 - arrow_coord.y;
}
arrow_coord *= _ScreenToTargetScale;
arrow_coord *= _ScreenToTargetScale.xy;
float2 mv_arrow = SampleMotionVectors(arrow_coord);

8
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/MaterialUtilities.hlsl


positionCS.xy = positionCS.xy / positionCS.w;
previousPositionCS.xy = previousPositionCS.xy / previousPositionCS.w;
return (positionCS.xy - previousPositionCS.xy);
float2 velocity = (positionCS.xy - previousPositionCS.xy);
#if UNITY_UV_STARTS_AT_TOP
velocity.y = -velocity.y;
#endif
return velocity;
#else
return float2(0.0, 0.0);
#endif

2
ScriptableRenderPipeline/HDRenderPipeline/HDRP/RenderPipelineResources/CopyDepthBuffer.shader


float Frag(Varyings input) : SV_Depth
{
PositionInputs posInputs = GetPositionInput(input.positionCS, _ScreenSize.zw);
PositionInputs posInputs = GetPositionInput(input.positionCS.xy, _ScreenSize.zw);
return LOAD_TEXTURE2D(_InputDepthTexture, posInputs.positionSS).x;
}

正在加载...
取消
保存