浏览代码

Mpore update with feedback

/main
sebastienlagarde 7 年前
当前提交
1fa4d8c6
共有 2 个文件被更改,包括 5 次插入5 次删除
  1. 6
      com.unity.render-pipelines.high-definition/HDRP/Lighting/Volumetrics/VolumetricLighting.compute
  2. 4
      com.unity.render-pipelines.high-definition/HDRP/Material/StackLit/StackLit.hlsl

6
com.unity.render-pipelines.high-definition/HDRP/Lighting/Volumetrics/VolumetricLighting.compute


float3 L = -light.forward; // Lights point backwards in Unity
float3 color; float attenuation; float attenuationNoContactShadows;
EvaluateLight_Directional(context, posInput, light, unused, 0, L, false,
EvaluateLight_Directional(context, posInput, light, unused, 0, L,
color, attenuation);
// Important:

float3 color; float attenuation; float attenuationNoContactShadows;
EvaluateLight_Punctual(context, posInput, light, unused,
0, L, lightToSample, distances, false,
0, L, lightToSample, distances,
color, attenuation);
// Important:

float3 color; float attenuation; float attenuationNoContactShadows;
EvaluateLight_Punctual( context, posInput, light, unused,
0, L, lightToSample, distances, false,
0, L, lightToSample, distances,
color, attenuation);
// Important:

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


}
// For shadow attenuation (ie receiver bias), always use the geometric normal:
EvaluateLight_Directional(lightLoopContext, posInput, lightData, bakeLightingData, bsdfData.geomNormalWS, L, HasFeatureFlag(bsdfData.materialFeatures, MATERIAL_FEATURE_FLAGS_TRANSMISSION_MODE_THIN_THICKNESS), color, attenuation);
EvaluateLight_Directional(lightLoopContext, posInput, lightData, bakeLightingData, bsdfData.geomNormalWS, L, color, attenuation);
float intensity = max(0, attenuation); // Warning: attenuation can be greater than 1 due to the inverse square attenuation (when position is close to light)

if (HasFeatureFlag(bsdfData.materialFeatures, MATERIAL_FEATURE_FLAGS_TRANSMISSION_MODE_THIN_THICKNESS))
{
// We use diffuse lighting for accumulation since it is going to be blurred during the SSS pass.
lighting.diffuse += EvaluateTransmission(bsdfData, bsdfData.transmittance, NdotL, NdotV, LdotV, attenuationNoContactShadows * lightData.diffuseScale);
lighting.diffuse += EvaluateTransmission(bsdfData, bsdfData.transmittance, NdotL, NdotV, LdotV, attenuation * lightData.diffuseScale);
}
// Save ALU by applying light and cookie colors only once.

正在加载...
取消
保存