浏览代码

Rename and add comments for clarity

/stochastic_alpha_test
Evgenii Golubev 7 年前
当前提交
dde5d9bb
共有 2 个文件被更改,包括 8 次插入8 次删除
  1. 2
      ScriptableRenderPipeline/Core/ShaderLibrary/BSDF.hlsl
  2. 14
      ScriptableRenderPipeline/HDRenderPipeline/ShaderVariablesFunctions.hlsl

2
ScriptableRenderPipeline/Core/ShaderLibrary/BSDF.hlsl


return sqrt((-NdotV * a2 + NdotV) * NdotV + a2);
}
// Note: V = G / (4 * NdotL * NdotV)
// Ref: http://jcgt.org/published/0003/02/03/paper.pdf
float V_SmithJointGGX(float NdotL, float NdotV, float roughness, float preLambdaV)
{

return sqrt(aT2 * TdotV * TdotV + aB2 * BdotV * BdotV + NdotV * NdotV);
}
// Note: V = G / (4 * NdotL * NdotV)
// Ref: https://cedec.cesa.or.jp/2015/session/ENG/14698.html The Rendering Materials of Far Cry 4
float V_SmithJointGGXAniso(float TdotV, float BdotV, float NdotV, float TdotL, float BdotL, float NdotL, float roughnessT, float roughnessB, float preLambdaV)
{

14
ScriptableRenderPipeline/HDRenderPipeline/ShaderVariablesFunctions.hlsl


return mul(GetWorldToHClipMatrix(), float4(positionWS, 1.0));
}
float3 GetAbsolutePositionWS(float3 cameraRelativePositionWS)
float3 GetAbsolutePositionWS(float3 positionWS)
float3 pos = cameraRelativePositionWS;
pos += _WorldSpaceCameraPos;
positionWS += _WorldSpaceCameraPos;
return pos;
return positionWS;
float3 GetCameraRelativePositionWS(float3 absolutePositionWS)
float3 GetCameraRelativePositionWS(float3 positionWS)
float3 pos = absolutePositionWS;
pos -= _WorldSpaceCameraPos;
positionWS -= _WorldSpaceCameraPos;
return pos;
return positionWS;
}
// Note: '_WorldSpaceCameraPos' is set by the legacy Unity code.

正在加载...
取消
保存