Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

problemwith unity 2019 SRP PerobjectLight

Discussion in 'Graphics Experimental Previews' started by CaffreyZZP, Jun 27, 2019.

  1. CaffreyZZP

    CaffreyZZP

    Joined:
    May 29, 2017
    Posts:
    1
    i'm writting SRP in Unity 2019.1.2f, and the question is :
    how to use unity_LightIndicesOffsetAndCount and unity_PerObjectLightIndices to get lights which most influence the object .

    In 2018.3 , I can use unity_LightIndicesOffsetAndCount and unity_4LightIndices0 .
    but the new variable doesn't working at 2019.

    is there any way to get the result ?
     
    SKoptev likes this.
  2. SKoptev

    SKoptev

    Joined:
    Jan 15, 2019
    Posts:
    37
    Look at CHANGELOG.md of LWRP, section [5.2.0]:

    ### Changed
    - Renamed shader variable `unity_LightIndicesOffsetAndCount` to `unity_PerObjectLightData`.
    - Shader variables `unity_4LightIndices0` and `unity_4LightIndices1` are now declared as `unity_PerObjectLightIndices` array.

    Rename unity_LightIndicesOffsetAndCount to unity_LightData
    Replace float unity_4LightIndices0, unity_4LightIndices1 to real4 unity_LightIndices[2];

    And all should works fine (faced same problem first).
     
    Last edited: Aug 19, 2019