mirror of
https://github.com/AcChosen/VR-Stage-Lighting.git
synced 2024-11-23 23:21:07 +01:00
Final Commit before VCC
This commit is contained in:
parent
f47c7984d9
commit
9d727d02b3
File diff suppressed because one or more lines are too long
@ -96,7 +96,7 @@ Material:
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _SamplingTexture:
|
||||
m_Texture: {fileID: 8600000, guid: b6cf0db1726c59641bb1fb9e7248ea45, type: 2}
|
||||
m_Texture: {fileID: 2800000, guid: ba9a307ceadf5564683f0e0af8af748c, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _SceneNormals:
|
||||
|
@ -96,7 +96,7 @@ Material:
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _SamplingTexture:
|
||||
m_Texture: {fileID: 8600000, guid: b6cf0db1726c59641bb1fb9e7248ea45, type: 2}
|
||||
m_Texture: {fileID: 2800000, guid: ba9a307ceadf5564683f0e0af8af748c, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _SceneNormals:
|
||||
|
@ -97,7 +97,7 @@ Material:
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _SamplingTexture:
|
||||
m_Texture: {fileID: 8600000, guid: b6cf0db1726c59641bb1fb9e7248ea45, type: 2}
|
||||
m_Texture: {fileID: 2800000, guid: ba9a307ceadf5564683f0e0af8af748c, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _SceneNormals:
|
||||
|
@ -56,7 +56,7 @@ Material:
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _SamplingTexture:
|
||||
m_Texture: {fileID: 8600000, guid: b6cf0db1726c59641bb1fb9e7248ea45, type: 2}
|
||||
m_Texture: {fileID: 2800000, guid: ba9a307ceadf5564683f0e0af8af748c, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Floats:
|
||||
@ -94,6 +94,7 @@ Material:
|
||||
- _MaskStrength: 1
|
||||
- _Metallic: 0
|
||||
- _Mode: 0
|
||||
- _Multiplier: 1
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _Scroll: 0.022
|
||||
|
@ -2025,6 +2025,27 @@ class VRSL_ManagerWindow : EditorWindow {
|
||||
|
||||
EditorGUILayout.EndHorizontal();
|
||||
EditorGUI.EndDisabledGroup();
|
||||
|
||||
|
||||
|
||||
EditorGUI.BeginDisabledGroup(!panel.isUsingAudioLink);
|
||||
Rect alr = EditorGUILayout.BeginHorizontal("box");
|
||||
EditorGUILayout.BeginVertical();
|
||||
EditorGUILayout.LabelField(Label("VRSL AudioLink Target Sample Texture", "Use this field to set the texture that all AudioLink VRSL fixtures will sample from when texture sampling is enabled on them."));
|
||||
if (GUILayout.Button(new GUIContent("Force Update Target Sample Texture", "Updates all AudioLink VRSL Fixtures to sample from the selected target texture when texture sampling is enabled on the fixture."), GUILayout.MaxWidth(230f), GUILayout.MinHeight(20f))) { panel._ForceUpdateVideoSampleTexture(); }
|
||||
EditorGUILayout.EndVertical();
|
||||
Rect texPropRect = alr;
|
||||
texPropRect.width = 40f;
|
||||
texPropRect.height = 40f;
|
||||
texPropRect.x += 250f;
|
||||
texPropRect.y += 5f;
|
||||
soptr.FindProperty("videoSampleTargetTexture").objectReferenceValue = (Texture)EditorGUI.ObjectField(texPropRect, panel.videoSampleTargetTexture, typeof(Texture), true);
|
||||
|
||||
EditorGUILayout.EndHorizontal();
|
||||
EditorGUI.EndDisabledGroup();
|
||||
|
||||
|
||||
|
||||
EditorGUILayout.EndVertical();
|
||||
//EditorGUILayout.Space();
|
||||
|
||||
@ -2442,15 +2463,11 @@ class VRSL_ManagerWindow : EditorWindow {
|
||||
// panel.useLegacyStaticLights = so.FindProperty("useLegacyStaticLights").boolValue;
|
||||
// panel.useLegacyStaticLights = EditorGUILayout.Toggle("Use Legacy Static Lights", panel.useLegacyStaticLights);
|
||||
soptr.FindProperty("useLegacyStaticLights").boolValue = EditorGUILayout.ToggleLeft("Use Old 13 Channel Static Lights (Not Recommended)", panel.useLegacyStaticLights);
|
||||
soptr.ApplyModifiedProperties();
|
||||
panel.UpdateProxy();
|
||||
panel.panRangeTarget = soptr.FindProperty("panRangeTarget").floatValue;
|
||||
panel.tiltRangeTarget = soptr.FindProperty("tiltRangeTarget").floatValue;
|
||||
panel.useLegacyStaticLights = soptr.FindProperty("useLegacyStaticLights").boolValue;
|
||||
panel.ApplyProxyModifications();
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
EditorGUILayout.EndFoldoutHeaderGroup();
|
||||
EditorGUILayout.EndVertical();
|
||||
//EditorGUILayout.Space();
|
||||
@ -2650,6 +2667,13 @@ class VRSL_ManagerWindow : EditorWindow {
|
||||
|
||||
|
||||
//EditorGUILayout
|
||||
soptr.ApplyModifiedProperties();
|
||||
panel.UpdateProxy();
|
||||
panel.panRangeTarget = soptr.FindProperty("panRangeTarget").floatValue;
|
||||
panel.tiltRangeTarget = soptr.FindProperty("tiltRangeTarget").floatValue;
|
||||
panel.useLegacyStaticLights = soptr.FindProperty("useLegacyStaticLights").boolValue;
|
||||
panel.videoSampleTargetTexture = (Texture) soptr.FindProperty("videoSampleTargetTexture").objectReferenceValue;
|
||||
panel.ApplyProxyModifications();
|
||||
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -4,6 +4,11 @@ using UnityEngine;
|
||||
using VRC.SDKBase;
|
||||
using VRC.Udon;
|
||||
|
||||
#if !COMPILER_UDONSHARP && UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
using UdonSharpEditor;
|
||||
#endif
|
||||
|
||||
namespace VRSL
|
||||
{
|
||||
|
||||
@ -11,6 +16,8 @@ namespace VRSL
|
||||
|
||||
public class VRSL_LocalUIControlPanel : UdonSharpBehaviour
|
||||
{
|
||||
public Texture videoSampleTargetTexture;
|
||||
|
||||
[Header("Materials")]
|
||||
public Material[] fixtureMaterials;
|
||||
public Material[] volumetricMaterials;
|
||||
@ -75,6 +82,7 @@ namespace VRSL
|
||||
_CheckDMX();
|
||||
_CheckAudioLink();
|
||||
_CheckkExtendedUniverses();
|
||||
_ForceUpdateVideoSampleTexture();
|
||||
}
|
||||
|
||||
void EnableCRTS(CustomRenderTexture[] rtArray)
|
||||
@ -151,6 +159,49 @@ namespace VRSL
|
||||
crt.material.SetInt("_NineUniverseMode", useExtendedUniverses ? 1 : 0);
|
||||
}
|
||||
}
|
||||
|
||||
public void _ForceUpdateVideoSampleTexture()
|
||||
{
|
||||
if(videoSampleTargetTexture == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
foreach(Material m in laserMaterials)
|
||||
{
|
||||
if(m.HasProperty("_SamplingTexture"))
|
||||
{
|
||||
m.SetTexture("_SamplingTexture",videoSampleTargetTexture);
|
||||
}
|
||||
}
|
||||
foreach(Material m in fixtureMaterials)
|
||||
{
|
||||
if(m.HasProperty("_SamplingTexture"))
|
||||
{
|
||||
m.SetTexture("_SamplingTexture",videoSampleTargetTexture);
|
||||
}
|
||||
}
|
||||
foreach(Material m in discoBallMaterials)
|
||||
{
|
||||
if(m.HasProperty("_SamplingTexture"))
|
||||
{
|
||||
m.SetTexture("_SamplingTexture",videoSampleTargetTexture);
|
||||
}
|
||||
}
|
||||
foreach(Material m in projectionMaterials)
|
||||
{
|
||||
if(m.HasProperty("_SamplingTexture"))
|
||||
{
|
||||
m.SetTexture("_SamplingTexture",videoSampleTargetTexture);
|
||||
}
|
||||
}
|
||||
foreach(Material m in volumetricMaterials)
|
||||
{
|
||||
if(m.HasProperty("_SamplingTexture"))
|
||||
{
|
||||
m.SetTexture("_SamplingTexture",videoSampleTargetTexture);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void _SetFinalIntensity()
|
||||
{
|
||||
@ -220,4 +271,66 @@ namespace VRSL
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if !COMPILER_UDONSHARP && UNITY_EDITOR
|
||||
[CustomEditor(typeof(VRSL_LocalUIControlPanel))]
|
||||
public class VRSL_LocalUIControlPanel_Editor : Editor
|
||||
{
|
||||
public static Texture logo;
|
||||
public static string ver = "VR Stage Lighting ver:" + " <b><color=#6a15ce> 2.1</color></b>";
|
||||
|
||||
public void OnEnable()
|
||||
{
|
||||
logo = Resources.Load("VRStageLighting-Logo") as Texture;
|
||||
}
|
||||
public static void DrawLogo()
|
||||
{
|
||||
///GUILayout.BeginArea(new Rect(0,0, Screen.width, Screen.height));
|
||||
// GUILayout.FlexibleSpace();
|
||||
//GUI.DrawTexture(pos,logo,ScaleMode.ScaleToFit);
|
||||
//EditorGUI.DrawPreviewTexture(new Rect(0,0,400,150), logo);
|
||||
Vector2 contentOffset = new Vector2(0f, -2f);
|
||||
GUIStyle style = new GUIStyle(EditorStyles.label);
|
||||
style.fixedHeight = 150;
|
||||
//style.fixedWidth = 300;
|
||||
style.contentOffset = contentOffset;
|
||||
style.alignment = TextAnchor.MiddleCenter;
|
||||
var rect = GUILayoutUtility.GetRect(300f, 140f, style);
|
||||
//GUILayout.Label(logo,style, GUILayout.MaxWidth(500), GUILayout.MaxHeight(200));
|
||||
GUI.Box(rect, logo,style);
|
||||
//GUILayout.Label(logo);
|
||||
// GUILayout.FlexibleSpace();
|
||||
//GUILayout.EndArea();
|
||||
}
|
||||
private static Rect DrawShurikenCenteredTitle(string title, Vector2 contentOffset, int HeaderHeight)
|
||||
{
|
||||
var style = new GUIStyle("ShurikenModuleTitle");
|
||||
style.font = new GUIStyle(EditorStyles.boldLabel).font;
|
||||
style.border = new RectOffset(15, 7, 4, 4);
|
||||
style.fontSize = 14;
|
||||
style.fixedHeight = HeaderHeight;
|
||||
style.contentOffset = contentOffset;
|
||||
style.alignment = TextAnchor.MiddleCenter;
|
||||
var rect = GUILayoutUtility.GetRect(16f, HeaderHeight, style);
|
||||
|
||||
GUI.Box(rect, title, style);
|
||||
return rect;
|
||||
}
|
||||
public static void ShurikenHeaderCentered(string title)
|
||||
{
|
||||
DrawShurikenCenteredTitle(title, new Vector2(0f, -2f), 22);
|
||||
}
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
if (UdonSharpGUI.DrawDefaultUdonSharpBehaviourHeader(target)) return;
|
||||
DrawLogo();
|
||||
ShurikenHeaderCentered(ver);
|
||||
EditorGUILayout.Space();
|
||||
VRSL_LocalUIControlPanel controlPanel = (VRSL_LocalUIControlPanel)target;
|
||||
if (GUILayout.Button(new GUIContent("Force Update Target AudioLink Sample Texture", "Updates all AudioLink VRSL Fixtures to sample from the selected target texture when texture sampling is enabled on the fixture."))) { controlPanel._ForceUpdateVideoSampleTexture(); }
|
||||
EditorGUILayout.Space();
|
||||
base.OnInspectorGUI();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
Loading…
Reference in New Issue
Block a user