mirror of
https://github.com/DeMuenu/MoonlightVRC.git
synced 2025-12-12 19:13:56 +00:00
Modularized lighting calculations by introducing DefaultSetup.hlsl and Lambert.hlsl includes, and updated BlendinShader, LitParticles, and Water shaders to use these macros. Added new wave-related properties and logic to Water.shader for enhanced wave effects. Improved maintainability and consistency across shaders by centralizing light and Lambertian diffuse calculations.
11 lines
326 B
HLSL
11 lines
326 B
HLSL
#ifndef InLoopSetup
|
|
#define InLoopSetup(_LightPositions, LightCounter, count, i) \
|
|
if (LightCounter >= count) break; \
|
|
\
|
|
float distanceFromLight = length(i.worldPos - _LightPositions[LightCounter].xyz); \
|
|
if (distanceFromLight > _LightCutoffDistance) continue; \
|
|
\
|
|
float contrib = 0.0; \
|
|
|
|
|
|
#endif |