Skip to content

Commit

Permalink
Merge pull request ChiliMilk#5 from XLIVE99/master
Browse files Browse the repository at this point in the history
Fix GetMeshRenderingLightLayer on new versions
  • Loading branch information
ChiliMilk committed Feb 16, 2024
2 parents 7852403 + facfd24 commit 1a44450
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 1a44450

Please sign in to comment.