浏览代码

Cleanup Indirect lighting control

/main
Antoine Lelievre 6 年前
当前提交
2ef3d462
共有 4 个文件被更改,包括 12 次插入7 次删除
  1. 6
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/IndirectLightingControlEditor.cs
  2. 2
      com.unity.render-pipelines.high-definition/HDRP/Lighting/LightLoop/ShaderVariablesLightLoop.hlsl
  3. 3
      com.unity.render-pipelines.high-definition/HDRP/Lighting/ScreenSpaceLighting/ShaderVariablesScreenSpaceLighting.hlsl
  4. 8
      com.unity.render-pipelines.high-definition/HDRP/Material/Lit/Lit.hlsl

6
com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/IndirectLightingControlEditor.cs


[VolumeComponentEditor(typeof(IndirectLightingControl))]
public class IndirectLightingControlEditor : VolumeComponentEditor
{
SerializedDataParameter m_IndirectSpecularIntensity;
SerializedDataParameter m_IndirectSpecularIntensity;
m_IndirectDiffuseIntensity = Unpack(o.Find(x => x.indirectDiffuseIntensity));
m_IndirectDiffuseIntensity = Unpack(o.Find(x => x.indirectDiffuseIntensity));
PropertyField(m_IndirectSpecularIntensity, CoreEditorUtils.GetContent("Indirect Specular Intensity|Multiplier for the reflected specular light."));
PropertyField(m_IndirectSpecularIntensity, CoreEditorUtils.GetContent("Indirect Specular Intensity|Multiplier for the reflected specular light."));
}
}
}

2
com.unity.render-pipelines.high-definition/HDRP/Lighting/LightLoop/ShaderVariablesLightLoop.hlsl


uint _NumTileClusteredX;
uint _NumTileClusteredY;
float4 _IndirectLightingMultiplier;
float4x4 _Env2DCaptureVP[MAX_ENV2D_LIGHT];
#else

3
com.unity.render-pipelines.high-definition/HDRP/Lighting/ScreenSpaceLighting/ShaderVariablesScreenSpaceLighting.hlsl


// Ambiant occlusion
float4 _AmbientOcclusionParam; // xyz occlusion color, w directLightStrenght
float4 _IndirectLightingMultiplier;
#else
// Rough refraction texture
// Color pyramid (width, height, lodcount, Unused)

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


// Subsurface scattering mode
float3 modifiedDiffuseColor = GetModifiedDiffuseColorForSSS(bsdfData);
// Apply volume indirect multipler
builtinData.bakeDiffuseLighting *= _IndirectLightingMultiplier.x;
lighting.indirect.specularReflected *= _IndirectLightingMultiplier.y;
diffuseLighting = modifiedDiffuseColor * lighting.direct.diffuse + builtinData.bakeDiffuseLighting * _IndirectLightingMultiplier.x;
diffuseLighting = modifiedDiffuseColor * lighting.direct.diffuse + builtinData.bakeDiffuseLighting;
// If refraction is enable we use the transmittanceMask to lerp between current diffuse lighting and refraction value
// Physically speaking, transmittanceMask should be 1, but for artistic reasons, we let the value vary

specularLighting = lighting.direct.specular + lighting.indirect.specularReflected * _IndirectLightingMultiplier.y;
specularLighting = lighting.direct.specular + lighting.indirect.specularReflected;
// Rescale the GGX to account for the multiple scattering.
specularLighting *= 1.0 + bsdfData.fresnel0 * preLightData.energyCompensation;

正在加载...
取消
保存