浏览代码

Don't use thickness along the view dir for thin objects

/Branch_Batching2
Evgenii Golubev 8 年前
当前提交
7282b3a1
共有 2 个文件被更改,包括 8 次插入3 次删除
  1. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.hlsl
  2. 9
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitData.hlsl

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.hlsl


uint transmissionMode = BitFieldExtract(_TransmissionFlags, 2, 2 * subsurfaceProfile);
bsdfData.enableTransmission = (_EnableSSS != 0) && (transmissionMode != SSS_TRSM_MODE_NONE);
bsdfData.enableTransmission = transmissionMode != SSS_TRSM_MODE_NONE;
bsdfData.useThinObjectMode = transmissionMode == SSS_TRSM_MODE_THIN;
if (bsdfData.enableTransmission)

9
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitData.hlsl


// Done one time for all layered - cumulate with spec occ alpha for now
surfaceData.specularOcclusion *= GetHorizonOcclusion(V, surfaceData.normalWS, interpolatedVertexNormal, _HorizonFade);
// Convert thickness along the normal to thickness along the viewing direction.
surfaceData.thickness *= saturate(dot(interpolatedVertexNormal, V));
uint transmissionMode = BitFieldExtract(_TransmissionFlags, 2, 2 * surfaceData.subsurfaceProfile);
if (transmissionMode != SSS_TRSM_MODE_THIN)
{
// Convert thickness along the normal to thickness along the viewing direction.
surfaceData.thickness *= saturate(dot(interpolatedVertexNormal, V));
}
// Caution: surfaceData must be fully initialize before calling GetBuiltinData
GetBuiltinData(input, surfaceData, alpha, depthOffset, builtinData);

正在加载...
取消
保存