浏览代码

Merge branch 'HDRP/staging' into Improve-bakeDiffuseLighting-code

/main
sebastienlagarde 7 年前
当前提交
a9c23607
共有 6 个文件被更改,包括 16 次插入43 次删除
  1. 1
      com.unity.render-pipelines.high-definition/HDRP/Editor/Sky/HDRISky/HDRISkyEditor.cs
  2. 14
      com.unity.render-pipelines.high-definition/HDRP/Lighting/LightLoop/LightLoop.cs
  3. 31
      com.unity.render-pipelines.high-definition/HDRP/Lighting/Reflection/HDProbe.cs
  4. 4
      com.unity.render-pipelines.high-definition/HDRP/Lighting/Reflection/ProbeWrapper.cs
  5. 3
      com.unity.render-pipelines.high-definition/HDRP/Lighting/Reflection/Volumes/InfluenceVolume.cs
  6. 6
      com.unity.render-pipelines.high-definition/HDRP/Sky/GradientSky/GradientSky.shader

1
com.unity.render-pipelines.high-definition/HDRP/Editor/Sky/HDRISky/HDRISkyEditor.cs


if (hdri == null)
return;
float omegaP = (Mathf.PI * 4) / (6.0f * hdri.width * hdri.width);
m_IntegrateHDRISkyMaterial.SetTexture(HDShaderIDs._Cubemap, hdri);
Graphics.Blit(Texture2D.whiteTexture, m_IntensityTexture.rt, m_IntegrateHDRISkyMaterial);

14
com.unity.render-pipelines.high-definition/HDRP/Lighting/LightLoop/LightLoop.cs


s_LightVolumeDataBuffer.SetData(m_lightList.lightVolumes);
}
HDAdditionalReflectionData GetHDAdditionalReflectionData(VisibleReflectionProbe probe)
{
var add = probe.probe.GetComponent<HDAdditionalReflectionData>();
if (add == null)
{
add = HDUtils.s_DefaultHDAdditionalReflectionData;
Vector3 distance = Vector3.one * probe.blendDistance;
add.influenceVolume.boxBlendDistancePositive = distance;
add.influenceVolume.boxBlendDistanceNegative = distance;
add.influenceVolume.shape = Shape.Box;
}
return add;
}
HDAdditionalLightData GetHDAdditionalLightData(VisibleLight light)
{
var add = light.light.GetComponent<HDAdditionalLightData>();

31
com.unity.render-pipelines.high-definition/HDRP/Lighting/Reflection/HDProbe.cs


public ReflectionProxyVolumeComponent proxyVolume { get { return m_ProxyVolume; } }
/// <summary>InfluenceVolume of the probe.</summary>
public InfluenceVolume influenceVolume
{
get
{
// We need to init influence volume with a probe. We can call a constructor with 'this' in this case,
// we can't do it in Awake (not call in editor) or on OnEnable either.
// So do a late init when trying to access it
if (m_InfluenceVolume == null)
m_InfluenceVolume = new InfluenceVolume(this);
else if (!m_InfluenceVolume.IsInit())
{
m_InfluenceVolume.Init(this);
}
return m_InfluenceVolume;
}
private set
{
m_InfluenceVolume = value;
}
}
public InfluenceVolume influenceVolume { get { return m_InfluenceVolume; } private set { m_InfluenceVolume = value; } }
/// <summary>Multiplier factor of reflection (non PBR parameter).</summary>
public float multiplier { get { return m_Multiplier; } }

{
get { return m_RefreshMode; }
set { m_RefreshMode = value; }
}
internal void Awake()
{
if (influenceVolume == null)
influenceVolume = new InfluenceVolume(this);
else
influenceVolume.Init(this);
}
void ISerializationCallbackReceiver.OnBeforeSerialize()

4
com.unity.render-pipelines.high-definition/HDRP/Lighting/Reflection/ProbeWrapper.cs


if (add == null)
{
add = HDUtils.s_DefaultHDAdditionalReflectionData;
if (add.influenceVolume == null)
{
add.Awake();
}
Vector3 distance = Vector3.one * probe.blendDistance;
add.influenceVolume.boxBlendDistancePositive = distance;
add.influenceVolume.boxBlendDistanceNegative = distance;

3
com.unity.render-pipelines.high-definition/HDRP/Lighting/Reflection/Volumes/InfluenceVolume.cs


}
}
/// <summary>Return if an influence volume have been correctly initialize with a probe.</summary>
public bool IsInit() { return probe != null; }
/// <summary>Offset of this influence volume to the component handling him.</summary>
public Vector3 offset { get { return m_Offset; } set { m_Offset = value; } }

6
com.unity.render-pipelines.high-definition/HDRP/Sky/GradientSky/GradientSky.shader


float verticalGradient = viewDirWS.y * _GradientDiffusion;
float topLerpFactor = saturate(-verticalGradient);
float bottomLerpFactor = saturate(verticalGradient);
float3 color = lerp(_GradientMiddle,_GradientBottom,bottomLerpFactor);
color = lerp(color.xyz,_GradientTop,topLerpFactor);
return float4 (color.xyz,1);
float3 color = lerp(_GradientMiddle.xyz, _GradientBottom.xyz, bottomLerpFactor);
color = lerp(color, _GradientTop.xyz, topLerpFactor);
return float4 (color, 1.0);
}

正在加载...
取消
保存