|
|
|
|
@ -47,8 +47,10 @@ class LightingData
|
|
|
|
|
// Normal . View
|
|
|
|
|
float NdotV;
|
|
|
|
|
|
|
|
|
|
// Occlusion factors
|
|
|
|
|
// 0 = dark, 1 = light
|
|
|
|
|
float occlusion;
|
|
|
|
|
float diffuseAmbientOcclusion;
|
|
|
|
|
float specularOcclusion;
|
|
|
|
|
|
|
|
|
|
void Init(float3 positionWS, float3 normal, float roughnessLinear);
|
|
|
|
|
void CalculateMultiscatterCompensation(float3 specularF0, bool enabled);
|
|
|
|
|
@ -62,7 +64,8 @@ void LightingData::Init(float3 positionWS, float3 normal, float roughnessLinear)
|
|
|
|
|
translucentBackLighting = 0;
|
|
|
|
|
multiScatterCompensation = 1.0f;
|
|
|
|
|
emissiveLighting = float3(0.0f, 0.0f, 0.0f);
|
|
|
|
|
occlusion = 1.0f;
|
|
|
|
|
diffuseAmbientOcclusion = 1.0f;
|
|
|
|
|
specularOcclusion = 1.0f;
|
|
|
|
|
|
|
|
|
|
dirToCamera = normalize(ViewSrg::m_worldPosition.xyz - positionWS);
|
|
|
|
|
|
|
|
|
|
@ -79,6 +82,7 @@ void LightingData::CalculateMultiscatterCompensation(float3 specularF0, bool ena
|
|
|
|
|
|
|
|
|
|
void LightingData::FinalizeLighting(float3 transmissionTint)
|
|
|
|
|
{
|
|
|
|
|
specularLighting *= specularOcclusion;
|
|
|
|
|
specularLighting += emissiveLighting;
|
|
|
|
|
|
|
|
|
|
// Transmitted light
|
|
|
|
|
|