浏览代码

Added cascadeCount API to AdditionalLightData

/RenderPassXR_Sandbox
Julien Ignace 8 年前
当前提交
0fef8e78
共有 2 个文件被更改,包括 2 次插入3 次删除
  1. 1
      Assets/ScriptableRenderPipeline/Core/AdditionalLightData.cs
  2. 4
      Assets/ScriptableRenderPipeline/Core/Shadow/Shadow.cs

1
Assets/ScriptableRenderPipeline/Core/AdditionalLightData.cs


[HideInInspector, SerializeField] private ShadowData shadowData;
[HideInInspector, SerializeField] private ShadowData[] shadowDatas = new ShadowData[0];
public int cascadeCount { get { return shadowCascadeCount; } }
public void GetShadowCascades( out int cascadeCount, out float[] cascadeRatios ) { cascadeCount = shadowCascadeCount; cascadeRatios = shadowCascadeRatios; }
public void GetShadowAlgorithm( out int algorithm, out int variant, out int precision ) { algorithm = shadowAlgorithm; variant = shadowVariant; precision = shadowPrecision; }
public void SetShadowAlgorithm( int algorithm, int variant, int precision, int format, int[] data )

4
Assets/ScriptableRenderPipeline/Core/Shadow/Shadow.cs


float distToCam = (campos - lpos).magnitude;
bool add = (distToCam < ald.shadowFadeDistance || vl.lightType == LightType.Directional) && m_ShadowSettings.enabled;
float[] cascadeSplitsDummy = new float[3];
if( add )
{
switch( vl.lightType )

shadowType = GPUShadowType.Directional;
ald.GetShadowCascades(out facecount, out cascadeSplitsDummy);
facecount = ald.cascadeCount;
break;
case LightType.Point:
add = --m_MaxShadows[(int)GPUShadowType.Point, 0] >= 0;

正在加载...
取消
保存