浏览代码

test2

/main
Sebastien Lagarde 7 年前
当前提交
a8ca73e1
共有 1 个文件被更改,包括 13 次插入6 次删除
  1. 19
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/Lit.hlsl

19
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/Lit.hlsl


{
float3 N = bsdfData.normalWS;
float NdotV = ClampNdotV(N, V);
float NdotV = dot(N, V);
/*
/*
*/
float invLenLV = rsqrt(max(2.0 * LdotV + 2.0, FLT_EPS)); // invLenLV = rcp(length(L + V)) - caution about the case where V and L are opposite, it can happen, use max to avoid this
float invLenLV = rsqrt(2.0 * LdotV + 2.0); // invLenLV = rcp(length(L + V)) - caution about the case where V and L are opposite, it can happen, use max to avoid this
*/
// The abs need to happen AFTER the processing above, else value above are incorrect...
N += (2.0 * saturate(-NdotV)) * V;
NdotV = abs(dot(N, V));
float3 F = F_Schlick(bsdfData.fresnel0, LdotH);
float DV;

//float3 H = (L + V) * invLenLV;
float3 H = (L + V) * invLenLV; // <= this is not correct!
// For anisotropy we must not saturate these values
float TdotH = dot(bsdfData.tangentWS, H);

DV = DV_SmithJointGGX(NdotH, NdotL, NdotV, bsdfData.roughnessT, preLightData.partLambdaV);
}
specularLighting = F * DV;
// Reset everything:
N = bsdfData.normalWS;
NdotV = saturate(dot(N, V));
#ifdef LIT_DIFFUSE_LAMBERT_BRDF
float diffuseTerm = Lambert();

正在加载...
取消
保存