private void SetupPointLight(int index, int visibleIndex, ref VisibleLight visibleLight) { otherLightColors[index] = visibleLight.finalColor; Vector4 position = visibleLight.localToWorldMatrix.GetColumn(3); position.w = 1f / Mathf.Max(visibleLight.range * visibleLight.range, 0.00001f); otherLightPositions[index] = position; otherLightSpotAngles[index] = new Vector4(0f, 1f); otherLightShadowDatas[index] = shadows.ReserveOtherShadows(visibleLight.light, visibleIndex); }
private void SetupPointLight(int index, int visibleIndex, ref VisibleLight visibleLight, Light light) { otherLightColors[index] = visibleLight.finalColor; Vector4 position = visibleLight.localToWorldMatrix.GetColumn(3); position.w = 1f / Mathf.Max(visibleLight.range * visibleLight.range, 0.00001f); otherLightPositions[index] = position; otherLightSpotAngles[index] = new Vector4(0f, 1f); Vector4 dirAndMask = Vector4.zero; dirAndMask.w = light.renderingLayerMask.ReinterpretAsFloat(); otherLightDirectionsAndMasks[index] = dirAndMask; otherLightShadowData[index] = shadows.ReserveOtherShadows(light, visibleIndex); }
void SetupPointLight(int index, int visibleIndex, ref VisibleLight visibleLight, Light light) { otherLightColors[index] = visibleLight.finalColor; Vector4 position = visibleLight.localToWorldMatrix.GetColumn(3); position.w = 1 / Mathf.Max(visibleLight.range * visibleLight.range, 0.000001f); otherLightPositions[index] = position; //dummy a and b for spot angle attenuation to make sure point light have no angle att otherLightSpotAngles[index] = new Vector4(0.0f, 1.0f); //need to assign dummy direction for modification of rendering mask Vector4 dirAndmask = Vector4.zero; dirAndmask.w = light.renderingLayerMask.ReinterpretAsFloat(); otherLightDirectionsAndMasks[index] = dirAndmask; //Light light = visibleLight.light; otherLightShadowData[index] = shadows.ReserveOtherShadows(light, visibleIndex); }