Arnaud Carre 7 年前
当前提交
87f0059b
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 8
      ScriptableRenderPipeline/HDRenderPipeline/ShaderVariablesFunctions.hlsl

8
ScriptableRenderPipeline/HDRenderPipeline/ShaderVariablesFunctions.hlsl


// Otherwise, depth comparisons become meaningless!
float4x4 trViewMat = transpose(GetWorldToViewMatrix());
float3 rotCamPos = trViewMat[3].xyz;
return mul((float3x3)trViewMat, -rotCamPos);
float3 viewPositionWS = mul((float3x3)trViewMat, -rotCamPos);
// When USE_LEGACY_UNITY_MATRIX_VARIABLES is define GetWorldToViewMatrix is absolute (because it use legacy unity matrix), but if not define it use our own variable that is camera relative.
#ifdef USE_LEGACY_UNITY_MATRIX_VARIABLES
return GetCameraRelativePositionWS(viewPositionWS);
#else
return viewPositionWS;
#endif
#endif
}

正在加载...
取消
保存