optimisations from gemini (not tested)

This commit is contained in:
DeMuenu
2026-03-24 15:45:31 +01:00
parent 9f986c3eb1
commit a1e808ad92
12 changed files with 231 additions and 117 deletions

View File

@@ -1,4 +1,4 @@
using UdonSharp;
using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;
@@ -10,6 +10,10 @@ public enum LightType { Sphere, Spot }
[UdonBehaviourSyncMode(BehaviourSyncMode.None)]
public class LightdataStorage : UdonSharpBehaviour
{
[Header("System")]
[Tooltip("The main LightUpdater in the scene. This is required for dynamic lights.")]
public LightUpdater lightUpdater;
[Header("Type")]
[Tooltip("Select the logical light type for this source.")]
@@ -36,6 +40,22 @@ public class LightdataStorage : UdonSharpBehaviour
[Tooltip("0 = no shadows, 1-4 = shadow map index")]
public float shadowMapIndex = 0f; // 0 = no shadows, 1-4 = shadow map index
void OnEnable()
{
if (lightUpdater != null)
{
lightUpdater.RegisterLight(this);
}
}
void OnDisable()
{
if (lightUpdater != null)
{
lightUpdater.DeregisterLight(this);
}
}
// Convert to a Vector4 for your shader upload
public Vector4 GetFinalColor()
{