浏览代码

Update Changelog and integrate PR feedback

/main
sebastienlagarde 6 年前
当前提交
ed6aecc7
共有 4 个文件被更改,包括 8 次插入7 次删除
  1. 1
      com.unity.render-pipelines.high-definition/CHANGELOG.md
  2. 6
      com.unity.render-pipelines.high-definition/HDRP/Lighting/LightEvaluation.hlsl
  3. 4
      com.unity.render-pipelines.high-definition/HDRP/Material/Lit/Lit.hlsl
  4. 4
      com.unity.render-pipelines.high-definition/HDRP/Material/StackLit/StackLit.hlsl

1
com.unity.render-pipelines.high-definition/CHANGELOG.md


### Changed
- Re-enable shadow mask mode in debug view
- SSS and Transmission code have been refactored to be able to share it between various material. Guidelines are in SubsurfaceScattering.hlsl
### Fixed
- Fix contact shadows applied on transmission

6
com.unity.render-pipelines.high-definition/HDRP/Lighting/LightEvaluation.hlsl


// This function return transmittance to provide to EvaluateTransmission
float3 PreEvaluatePunctualLightTransmission(LightLoopContext lightLoopContext, PositionInputs posInput, float distFrontFaceToLight,
float NdotL, float3 L, LightData lightData, BSDFData bsdfData,
inout float3 normalWS, inout int contactShadowIndex)
float NdotL, float3 L, BSDFData bsdfData,
inout float3 normalWS, inout LightData lightData)
{
float3 transmittance = bsdfData.transmittance;

if (HasFlag(bsdfData.materialFeatures, MATERIAL_FEATURE_FLAGS_TRANSMISSION_MODE_THIN_THICKNESS))
{
normalWS = -normalWS; // Flip normal for shadow bias
contactShadowIndex = -1; // Disable shadow contact
lightData.contactShadowIndex = -1; // Disable shadow contact
}
else // MATERIAL_FEATURE_FLAGS_TRANSMISSION_MODE_MIXED_THICKNESS
{

4
com.unity.render-pipelines.high-definition/HDRP/Material/Lit/Lit.hlsl


float3 transmittance = float3(0.0, 0.0, 0.0);
if (HasFlag(bsdfData.materialFeatures, MATERIALFEATUREFLAGS_LIT_TRANSMISSION))
{
// Caution: This function modify N and contactShadowIndex
transmittance = PreEvaluatePunctualLightTransmission(lightLoopContext, posInput, distances.x, NdotL, L, lightData, bsdfData, N, lightData.contactShadowIndex);
// Caution: This function modify N and lightData.contactShadowIndex
transmittance = PreEvaluatePunctualLightTransmission(lightLoopContext, posInput, distances.x, NdotL, L, bsdfData, N, lightData);
}
float3 color;

4
com.unity.render-pipelines.high-definition/HDRP/Material/StackLit/StackLit.hlsl


float3 transmittance = float3(0.0, 0.0, 0.0);
if (HasFlag(bsdfData.materialFeatures, MATERIALFEATUREFLAGS_STACK_LIT_TRANSMISSION))
{
// Caution: This function modify N and contactShadowIndex
transmittance = PreEvaluatePunctualLightTransmission(lightLoopContext, posInput, distances.x, NdotL, L, lightData, bsdfData, shadowBiasNormal, lightData.contactShadowIndex);
// Caution: This function modify N and lightData.contactShadowIndex
transmittance = PreEvaluatePunctualLightTransmission(lightLoopContext, posInput, distances.x, NdotL, L, bsdfData, shadowBiasNormal, lightData);
}
float3 color;

正在加载...
取消
保存