mirror of
https://github.com/DeMuenu/MoonlightVRC.git
synced 2026-05-06 18:22:22 +00:00
optimisations from gemini (not tested)
This commit is contained in:
@@ -2,16 +2,20 @@
|
||||
#define InLoopSetup(_Udon_LightPositions, LightCounter, count, i) \
|
||||
if (LightCounter >= count) break; \
|
||||
\
|
||||
float distanceFromLight = length(i.worldPos - _Udon_LightPositions[LightCounter].xyz); \
|
||||
float3 lightVec = _Udon_LightPositions[LightCounter].xyz - i.worldPos; \
|
||||
float distanceFromLight = length(lightVec); \
|
||||
if (distanceFromLight > _LightCutoffDistance) continue; \
|
||||
\
|
||||
float contrib = 0.0;
|
||||
float contrib = 0.0; \
|
||||
float3 L = lightVec / max(distanceFromLight, 1e-4);
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef OutLoopSetup
|
||||
#define OutLoopSetup(i, _Udon_PlayerCount) \
|
||||
int count = (int)_Udon_PlayerCount; \
|
||||
float invSqMul = max(1e-4, _InverseSqareMultiplier); \
|
||||
bool shadowCastingEnabled = _EnableShadowCasting > 0.5; \
|
||||
\
|
||||
float4 dmax = float4(0,0,0,1); \
|
||||
float dIntensity = 0;
|
||||
|
||||
Reference in New Issue
Block a user