Files
MoonlightVRC/Shader/Includes/DefaultSetup.hlsl
DeMuenu b94c52da3c 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.
2025-09-26 23:13:06 +02:00

20 lines
516 B
HLSL

#ifndef InLoopSetup
#define InLoopSetup(_Udon_LightPositions, LightCounter, count, i) \
if (LightCounter >= count) break; \
\
float distanceFromLight = length(i.worldPos - _Udon_LightPositions[LightCounter].xyz); \
if (distanceFromLight > _LightCutoffDistance) continue; \
\
float contrib = 0.0;
#endif
#ifndef OutLoopSetup
#define OutLoopSetup(i, _Udon_PlayerCount) \
int count = (int)_Udon_PlayerCount; \
\
float4 dmax = float4(0,0,0,1); \
float dIntensity = 0;
#endif