I want to implement the volume light function of SpotLight. No problem with just one light. But when there are multiple lights, I need to write the index of the specified light to the material in order to sample the corresponding shadow map and calculate the distance falloff.
How to get this index value through code?
I found renderingData.lightData.visibleLights in RenderingData, is the index here corresponding to the index in the CBuffer of AdditionalLights?