mirror of
https://github.com/DeMuenu/MoonlightVRC.git
synced 2025-12-13 19:33:56 +00:00
Rename shader light variables to Udon-prefixed versions
Updated all relevant shader files and C# script to use Udon-prefixed light and player variables (e.g., _Udon_LightPositions, _Udon_LightColors, _Udon_PlayerCount) for consistency and to avoid naming conflicts. This change affects variable declarations, macro definitions, and all usages in BlendinShader, LitParticles, Water shaders, and included HLSL files.
This commit is contained in:
@@ -1,25 +1,25 @@
|
||||
#ifndef LightTypeCalculations
|
||||
#define LightTypeCalculations(_LightColors ,LightCounter, i, NdotL, dIntensity, radius, Lightposition) \
|
||||
#define LightTypeCalculations(_Udon_LightColors ,LightCounter, i, NdotL, dIntensity, radius, Lightposition) \
|
||||
float invSqMul = max(1e-4, _InverseSqareMultiplier); \
|
||||
\
|
||||
if(_LightType[LightCounter] == 0) \
|
||||
if(_Udon_LightType[LightCounter] == 0) \
|
||||
{ \
|
||||
contrib = _LightColors[LightCounter].a / max(1e-4, max(0, max(1, distanceFromLight - radius) * invSqMul) * max(0, max(1, distanceFromLight - radius) * invSqMul)); \
|
||||
contrib = _Udon_LightColors[LightCounter].a / max(1e-4, max(0, max(1, distanceFromLight - radius) * invSqMul) * max(0, max(1, distanceFromLight - radius) * invSqMul)); \
|
||||
\
|
||||
dIntensity += contrib * NdotL; \
|
||||
} \
|
||||
else if (_LightType[LightCounter] == 1) \
|
||||
else if (_Udon_LightType[LightCounter] == 1) \
|
||||
{ \
|
||||
float invSq = _LightColors[LightCounter].a / max(1e-4, (distanceFromLight * invSqMul) * (distanceFromLight * invSqMul)); \
|
||||
float threshold = (-1 + _LightDirections[LightCounter].w / 180); \
|
||||
float invSq = _Udon_LightColors[LightCounter].a / max(1e-4, (distanceFromLight * invSqMul) * (distanceFromLight * invSqMul)); \
|
||||
float threshold = (-1 + _Udon_LightDirections[LightCounter].w / 180); \
|
||||
\
|
||||
contrib = min(dot(normalize(i.worldPos - Lightposition), -normalize(_LightDirections[LightCounter].xyz)), 0); \
|
||||
contrib = min(dot(normalize(i.worldPos - Lightposition), -normalize(_Udon_LightDirections[LightCounter].xyz)), 0); \
|
||||
contrib= 1 - step(threshold, contrib); \
|
||||
\
|
||||
contrib = contrib * invSq; \
|
||||
dIntensity += contrib * NdotL; \
|
||||
} \
|
||||
float3 LightColor = _LightColors[LightCounter].xyz; \
|
||||
float3 LightColor = _Udon_LightColors[LightCounter].xyz; \
|
||||
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user