mirror of
https://github.com/DeMuenu/MoonlightVRC.git
synced 2025-12-13 11:33:54 +00:00
Refactor lighting code and add wave support to shaders
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.
This commit is contained in:
7
Shader/Includes/Lambert.hlsl
Normal file
7
Shader/Includes/Lambert.hlsl
Normal file
@@ -0,0 +1,7 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user