mirror of
https://github.com/DeMuenu/MoonlightVRC.git
synced 2025-12-13 11:33:54 +00:00
Refactor Moonlight lighting system in shaders
Replaces direct variable declarations and code blocks related to 'MoonsLight' with a new 'MoonlightGlobalVariables' macro included from Variables.hlsl. Adds OutLoopSetup macro for loop setup, updates all relevant shaders to use the new macros, and renames comments and identifiers from 'MoonsLight' to 'Moonlight' for consistency. Removes the obsolete MoonsLight.cingc include and its meta file.
This commit is contained in:
@@ -8,4 +8,12 @@
|
||||
float contrib = 0.0; \
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef OutLoopSetup
|
||||
#define OutLoopSetup(i, _PlayerCount) \
|
||||
int count = (int)_PlayerCount; \
|
||||
\
|
||||
float4 dmax = float4(0,0,0,1); \
|
||||
float dIntensity = 0; \
|
||||
#endif
|
||||
13
Shader/Includes/Variables.hlsl
Normal file
13
Shader/Includes/Variables.hlsl
Normal file
@@ -0,0 +1,13 @@
|
||||
#ifndef MoonlightGlobalVariables
|
||||
#define MoonlightGlobalVariables \
|
||||
\
|
||||
float _InverseSqareMultiplier; \
|
||||
float _LightCutoffDistance; \
|
||||
\
|
||||
float4 _LightPositions[MAX_LIGHTS]; /* xyz = position */ \
|
||||
float4 _LightColors[MAX_LIGHTS]; /* xyz = position */ \
|
||||
float4 _LightDirections[MAX_LIGHTS]; /* xyz = direction, w = cos(halfAngle) */ \
|
||||
float _LightType[MAX_LIGHTS]; /* 0 = sphere, 1 = cone */ \
|
||||
float _PlayerCount; /* set via SetFloat */ \
|
||||
\
|
||||
#endif
|
||||
Reference in New Issue
Block a user