Skip to content

Commit

Permalink
Write data to itself instead.
Browse files Browse the repository at this point in the history
  • Loading branch information
Thorinair committed Nov 11, 2021
1 parent e389eb7 commit 489552f
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 279 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ A live demo is available in the [Luminescent Ledge](https://vrchat.com/home/worl
1. Import the Unity package.
2. Drag the `LumaDriver` prefab into the scene.
3. Make sure it is far away from the scene. It should be on Y=1000000 by default.
4. You are done! Enjoy the beautiful glow once more! Check below for customization options for the driver...
4. If you wish to use AudioLink, you will have to enable it. Check the AudioLink section below to see how to do that.
5. You are done! Enjoy the beautiful glow once more! Check below for customization options for the driver...

## Customization
If you want to play around with the parameters, open the CustomRenderTexture in the following location: `LumaDriver/CustomRenderTexture/LumaDriver_CRT`, expand the shader parameters to be able to modify them to your liking. The parameters are split up on four separate pages for easier navigation.
Expand Down
Binary file modified img/LumaDriverUI_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/LumaDriverUI_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 0 additions & 52 deletions src/LumaDriver/CustomRenderTexture/LumaDriver_ALActive.asset

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion src/LumaDriver/CustomRenderTexture/LumaDriver_CRT.asset
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ CustomRenderTexture:
m_UpdatePeriod: 0.01111111
m_ShaderPass: 0
m_CubemapFaceMask: 4294967295
m_DoubleBuffered: 0
m_DoubleBuffered: 1
m_WrapUpdateZones: 0
132 changes: 0 additions & 132 deletions src/LumaDriver/Materials/LumaDriver_ALActive.mat

This file was deleted.

8 changes: 0 additions & 8 deletions src/LumaDriver/Materials/LumaDriver_ALActive.mat.meta

This file was deleted.

11 changes: 3 additions & 8 deletions src/LumaDriver/Materials/LumaDriver_Driver.mat
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Material:
m_PrefabAsset: {fileID: 0}
m_Name: LumaDriver_Driver
m_Shader: {fileID: 4800000, guid: 26be09cd3367da94b85b01d138cb2e7a, type: 3}
m_ShaderKeywords: _ALAUTOMATIC_ON _ALCCG1_ON _ALCOLORCHORD_ON _ALOVERRIDE_ON _ALREACTIVEPIXEL_ON
m_ShaderKeywords: _ALAUTOMATIC_ON _ALCCG1_ON _ALCOLORCHORD_ON _ALREACTIVEPIXEL_ON
_COLOROVERRIDE_ON _ISENABLED_ON _LUMAPIXEL_ON _REACTIVEIDLE_ON
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
Expand All @@ -19,14 +19,10 @@ Material:
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _ALActiveTexture:
m_Texture: {fileID: 8600000, guid: 82d5bd6d04c691b4d91833a96cae8e04, type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_TexEnvs: []
m_Floats:
- _ALAutomatic: 1
- _ALOverride: 1
- _ALOverride: 0
- _ALReactivePixel: 1
- _ALccG1: 1
- _ALccG1StopA: 0.1992
Expand Down Expand Up @@ -123,7 +119,6 @@ Material:
- _TimeG3Offset: 5
- _TimeG3Scale: 5
m_Colors:
- _ALActiveTexture: {r: 0, g: 0, b: 0, a: 1}
- _ColourG1StopA: {r: 1, g: 0, b: 0, a: 1}
- _ColourG1StopB: {r: 0, g: 1, b: 0, a: 1}
- _ColourG1StopC: {r: 0, g: 0, b: 1, a: 1}
Expand Down
2 changes: 0 additions & 2 deletions src/LumaDriver/Scripts/Editor/LumaDriver_GUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ void ShowPage_MainOptions() {
ShowProperty("_LumaPixel");
ShowProperty("_ReactiveIdle");
ShowProperty("_DebugZone");

ShowProperty("_ALActiveTexture");
}

void ShowPage_IdleAnimations() {
Expand Down
50 changes: 0 additions & 50 deletions src/LumaDriver/Shaders/LumaDriver_ALActive.shader

This file was deleted.

9 changes: 0 additions & 9 deletions src/LumaDriver/Shaders/LumaDriver_ALActive.shader.meta

This file was deleted.

25 changes: 17 additions & 8 deletions src/LumaDriver/Shaders/LumaDriver_Driver.shader
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@
[MaterialToggle] _LumaPixel("Use Original Luma Glow Pixel", Float) = 1
[MaterialToggle] _ReactiveIdle("Audio Reactive Pixel On When Idle", Float) = 1
[MaterialToggle] _DebugZone("Debug Zones", Float) = 0
[Space(15)]

[Header(Internal)]
[Space(15)]
[NoScaleOffset]_ALActiveTexture ("AudioLink Active CRT", 2D) = "black" {}

[Header(Global Idle Animations)]
[Space(15)]
Expand Down Expand Up @@ -170,8 +165,6 @@
float _ReactiveIdle;
float _DebugZone;

uniform sampler2D _ALActiveTexture;

float _RGBSpeed;

float _ShiftZ1;
Expand Down Expand Up @@ -302,7 +295,7 @@
fixed isALActive() {
if (_ALOverride == 1) {
if (_ALAutomatic == 1) {
if (tex2D(_ALActiveTexture, float2(0.01563, 0.01563)).r > 0)
if (tex2D(_SelfTexture2D, float2(0.000975, 0.001735)).r > 0)
return 1;
else
return 0;
Expand Down Expand Up @@ -365,6 +358,22 @@
float4 frag(v2f_customrendertexture IN) : COLOR {
if (_IsEnabled == 1) {

// Calculation for whether AudioLink is playing audio
if (IN.localTexcoord.x <= 0.00195 && IN.localTexcoord.y <= 0.00347) {
fixed isOn = 0;
[unroll] for (int i = 4; i < 6; i++) {
[unroll] for (int j = 0; j < 128; j++) {
isOn = max(isOn, tex2D(_AudioTexture, float2(0.0039 + 0.0078125 * j, 0.0078 + 0.0152 * i)).xxx);
}
}
if (isOn > 0) {
return fixed4(1, 0, 0, 1);
}
else {
return fixed4(0, 0, 0, 1);
}
}

// Original Luma Control Pixel
if (_LumaPixel == 1 && IN.localTexcoord.x > 0.625 && IN.localTexcoord.x <= 0.633307 && IN.localTexcoord.y > 0.50423 && IN.localTexcoord.y < 0.51834) {
return fixed4(1, 0, 0, 1);
Expand Down

0 comments on commit 489552f

Please sign in to comment.