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:
11
Shader/Includes/DefaultSetup.hlsl
Normal file
11
Shader/Includes/DefaultSetup.hlsl
Normal file
@@ -0,0 +1,11 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user