浏览代码

Implemented GetWorldSpaceNormalizeViewDir over GetWorldSpaceViewDir

/main
Julien Ignace 7 年前
当前提交
7755d57e
共有 1 个文件被更改,包括 5 次插入15 次删除
  1. 20
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/ShaderVariablesFunctions.hlsl

20
ScriptableRenderPipeline/HDRenderPipeline/HDRP/ShaderVariablesFunctions.hlsl


}
// Computes the world space view direction (pointing towards the viewer).
float3 GetWorldSpaceNormalizeViewDir(float3 positionWS)
{
if (IsPerspectiveProjection())
{
// Perspective
float3 V = GetCurrentViewPosition() - positionWS;
return normalize(V);
}
else
{
// Orthographic
return -GetViewForwardDir();
}
}
float3 GetWorldSpaceViewDir(float3 positionWS)
{
if (IsPerspectiveProjection())

// Orthographic
return -GetViewForwardDir();
}
}
float3 GetWorldSpaceNormalizeViewDir(float3 positionWS)
{
return normalize(GetWorldSpaceViewDir(positionWS));
}
float3x3 CreateWorldToTangent(float3 normal, float3 tangent, float flipSign)

正在加载...
取消
保存