浏览代码

Fixed shadow priority sort being inverted.

/Branch_Batching2
uygar 7 年前
当前提交
622d6403
共有 2 个文件被更改,包括 17 次插入1 次删除
  1. 10
      Assets/ScriptableRenderPipeline/Core/Shadow/Shadow.cs
  2. 8
      Assets/ScriptableRenderPipeline/Core/Shadow/VectorArray.cs

10
Assets/ScriptableRenderPipeline/Core/Shadow/Shadow.cs


shadowDataIndices = m_ShadowIndices.AsArray( out offset, out shadowRequestsCount );
}
public class SortReverter : System.Collections.Generic.IComparer<long>
{
public int Compare(long lhs, long rhs)
{
return rhs.CompareTo(lhs);
}
}
protected override void PrioritizeShadowCasters( Camera camera, VisibleLight[] lights, uint shadowRequestsCount, int[] shadowRequests )
{

val |= (uint)vlidx;
m_TmpSortKeys.AddUnchecked( val );
}
m_TmpSortKeys.Sort();
m_TmpSortKeys.Sort( new SortReverter() );
m_TmpSortKeys.ExtractTo( shadowRequests, 0, out shadowRequestsCount, delegate(long key) { return (int) (key & 0xffffffff); } );
}

8
Assets/ScriptableRenderPipeline/Core/Shadow/VectorArray.cs


Array.Sort(m_array, (int)m_offset, (int)m_count);
}
// Sort according to some comparer
public void Sort(System.Collections.Generic.IComparer<T> comparer)
{
Debug.Assert(m_count <= int.MaxValue && m_offset <= int.MaxValue);
Array.Sort(m_array, (int)m_offset, (int)m_count, comparer);
}
// Returns true if the element matches the designator according to the comparator. idx will hold the index to the first matched object in the array.
public delegate bool Comparator<U>(ref U designator, ref T obj);
public bool FindFirst<U>(out uint idx, ref U designator, Comparator<U> compareDelegate)

正在加载...
取消
保存