|
|
|
|
|
|
//eyePlane.SetNormalAndPosition(viewDirNormalized, camera.transform.position);
|
|
|
|
|
|
|
|
int probeCount = cull.visibleReflectionProbes.Length; |
|
|
|
int finalProbeCount = probeCount; |
|
|
|
int idx = 0; |
|
|
|
|
|
|
|
for (int i = 0; i < probeCount; ++i) { |
|
|
|
var rl = cull.visibleReflectionProbes [i]; |
|
|
|
|
|
|
if (cubemap == null) |
|
|
|
if (cubemap == null) { |
|
|
|
Debug.Log ("empty cubemap texture"); |
|
|
|
finalProbeCount--; |
|
|
|
|
|
|
|
} |
|
|
|
var lgtData = new SFiniteLightData(); |
|
|
|
lgtData.flags = 0; |
|
|
|
|
|
|
|
|
|
|
lgtData.lightType = (uint)LightDefinitions.BOX_LIGHT; |
|
|
|
lgtData.lightModel = (uint)LightDefinitions.REFLECTION_LIGHT; |
|
|
|
|
|
|
|
lightData [i] = lgtData; |
|
|
|
lightData [idx++] = lgtData; |
|
|
|
} |
|
|
|
|
|
|
|
s_LightDataBuffer.SetData(lightData); |
|
|
|
|
|
|
cmd.SetGlobalVectorArray("gLightPos", m_LightPositions); |
|
|
|
cmd.SetGlobalMatrixArray("gLightMatrix", m_LightMatrix); |
|
|
|
cmd.SetGlobalMatrixArray("gWorldToLightMatrix", m_WorldToLightMatrix); |
|
|
|
cmd.SetGlobalVector("gLightData", new Vector4(totalLightCount, probeCount, 0, 0)); |
|
|
|
cmd.SetGlobalVector("gLightData", new Vector4(totalLightCount, finalProbeCount, 0, 0)); |
|
|
|
|
|
|
|
cmd.SetGlobalTexture("_spotCookieTextures", m_CookieTexArray.GetTexCache()); |
|
|
|
//cmd.SetGlobalTexture("_pointCookieTextures", m_CubeCookieTexArray.GetTexCache());
|
|
|
|