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.
7 lines
237 B
HLSL
7 lines
237 B
HLSL
#ifndef Lambert
|
|
#define Lambert(q ,i, N) \
|
|
float3 L = normalize(q - i.worldPos); /* q = light position */ \
|
|
float NdotL = saturate(dot(N, L) * 0.5 + 0.5); /* one-sided Lambert */ \
|
|
if (NdotL <= 0) continue; \
|
|
|
|
#endif |