浏览代码

cleanup

/main
vlad-andreev 7 年前
当前提交
738479fe
共有 2 个文件被更改,包括 12 次插入6 次删除
  1. 11
      TestbedPipelines/Fptl/FptlLighting.cs
  2. 7
      TestbedPipelines/Fptl/RegularForwardLightingUtils.hlsl

11
TestbedPipelines/Fptl/FptlLighting.cs


s_ConvexBoundsBuffer = new ComputeBuffer(MaxNumLights, System.Runtime.InteropServices.Marshal.SizeOf(typeof(SFiniteLightBound)));
s_LightDataBuffer = new ComputeBuffer(MaxNumLights, System.Runtime.InteropServices.Marshal.SizeOf(typeof(SFiniteLightData)));
s_DirLightList = new ComputeBuffer(MaxNumDirLights, System.Runtime.InteropServices.Marshal.SizeOf(typeof(DirectionalLight)));
s_LightIndices = new ComputeBuffer(MaxNumLights + MaxNumDirLights, System.Runtime.InteropServices.Marshal.SizeOf(typeof(int)));
s_LightIndices = null; // only used in traditional forward, will be created on demand
buildScreenAABBShader.SetBuffer(s_GenAABBKernel, "g_data", s_ConvexBoundsBuffer);
//m_BuildScreenAABBShader.SetBuffer(kGenAABBKernel, "g_vBoundsBuffer", m_aabbBoundsBuffer);

for (int i = 0; i < lightIndexMap.Length; i++)
{
lightIndexMap[i] = -1;
}
int lightIndexCount = inputs.GetLightIndicesCount();
if (s_LightIndices == null || lightIndexCount > s_LightIndices.count)
{
// The light indices buffer is too small, resize
if (s_LightIndices != null)
s_LightIndices.Release();
s_LightIndices = new ComputeBuffer(lightIndexCount, System.Runtime.InteropServices.Marshal.SizeOf(typeof(int)));
}
uint shadowLightIndex = 0;

7
TestbedPipelines/Fptl/RegularForwardLightingUtils.hlsl


StructuredBuffer<SFiniteLightData> g_vLightData;
StructuredBuffer<uint> g_vLightListMeshInst; // build on CPU if in use. direct lights first, then reflection probes. (don't support Buffer yet in unity, so using structured)
uniform int g_numLights;
uniform int g_numReflectionProbes;
uniform float4 unity_LightIndicesOffsetAndCount;
uniform float4 unity_ReflectionProbeIndicesOffsetAndCount;
uniform uint4 unity_LightIndicesOffsetAndCount;
uniform uint4 unity_ReflectionProbeIndicesOffsetAndCount;
void GetCountAndStart(out uint start, out uint nrLights, uint model)
{

正在加载...
取消
保存