Skip to content

Commit

Permalink
Fix GetMeshRenderingLightLayer on new versions
Browse files Browse the repository at this point in the history
  • Loading branch information
XLIVE99 committed Feb 15, 2024
1 parent 7852403 commit facfd24
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Assets/ChiliMilkToonShader/Include/ToonLighting.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,13 @@ half4 FragmentLitToon(InputDataToon inputData, SurfaceDataToon surfaceData, Toon
half4 shadowMask = half4(1, 1, 1, 1);
#endif

#if UNITY_VERSION < 202220
uint meshRenderingLayers = GetMeshRenderingLightLayer();
#else
//GetMeshRenderingLayer() is only available in 2022.2+
//Previous versions need to use GetMeshRenderingLightLayer()
uint meshRenderingLayers = GetMeshRenderingLayer();
#endif
Light mainLight = GetMainLight(inputData.shadowCoord,inputData.positionWS,shadowMask);
MixRealtimeAndBakedGI(mainLight, inputData.normalWS, inputData.bakedGI);
half3 color = GlobalIlluminationToon(brdfData, inputData.bakedGI, toonData.ssao, inputData.normalWS, inputData.viewDirectionWS);
Expand Down

0 comments on commit facfd24

Please sign in to comment.