Skip to content

Commit

Permalink
AudioLinkControllerLogo: added audio reactivity effect to logo, added…
Browse files Browse the repository at this point in the history
… AudioLink logotype, adjusted position/scale

This includes a new audio reactive shader matched with the existing ALControllerLogo.fbx model containing the mesh named "AudioLinkLogo". The fbx file was updated with the logotype merged into the existing mesh. As well, the placement, scale, and orientation of the complete logo were updated to accommodate the additional geo.
  • Loading branch information
llealloo committed Oct 3, 2023
1 parent b972c7c commit 2b12b2c
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7703,13 +7703,13 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8714319022982819121}
m_LocalRotation: {x: -0.7071068, y: 0, z: 0, w: 0.7071068}
m_LocalPosition: {x: 0, y: -0.007, z: 0}
m_LocalScale: {x: 0.45, y: 0.45, z: 1}
m_LocalRotation: {x: 0, y: 0.7071068, z: 0.7071068, w: 0}
m_LocalPosition: {x: 0, y: -0.007, z: 0.0254}
m_LocalScale: {x: 0.56, y: 0.56, z: 1}
m_Children: []
m_Father: {fileID: 6191204864983838088}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0}
m_LocalEulerAnglesHint: {x: -90, y: 0, z: 180}
--- !u!33 &8460797207492340275
MeshFilter:
m_ObjectHideFlags: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Material:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: mat_AudioLinkLogo
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_Shader: {fileID: 4800000, guid: 38d0d632969951049b3c541d62bc6d7c, type: 3}
m_ShaderKeywords: POI_PATHING VIGNETTE_MASKED _EMISSION _LIGHTINGMODE_REALISTIC
_RIM2STYLE_POIYOMI _RIMSTYLE_POIYOMI _STOCHASTICMODE_DELIOT_HEITZ
m_LightmapFlags: 1
Expand Down Expand Up @@ -1304,6 +1304,7 @@ Material:
- _GITDEWorldOrMesh1: 0
- _GITDEWorldOrMesh2: 0
- _GITDEWorldOrMesh3: 0
- _Gain: 4.38
- _GlitterAngleRange: 90
- _GlitterBias: 0.8
- _GlitterBlendType: 0
Expand Down Expand Up @@ -1992,6 +1993,9 @@ Material:
- _PolarSpiralPower: 0
- _PolarUV: 0
- _PostProcess: 0
- _PulseOffsetQ: 0.58
- _PulseWidth: 0.4
- _QPower: 4
- _RGBBlendMultiplicative: 0
- _RGBMaskEnabled: 0
- _RGBMaskUV: 0
Expand Down Expand Up @@ -2848,6 +2852,7 @@ Material:
- _BackFaceTexturePan: {r: 0, g: 0, b: 0, a: 0}
- _BacklightColor: {r: 0.85, g: 0.8, b: 0.7, a: 1}
- _BacklightColorTexPan: {r: 0, g: 0, b: 0, a: 0}
- _BaseColor: {r: 0.019607844, g: 0.019607844, b: 0.019607844, a: 1}
- _BlackLightMasking0Range: {r: 0.1, g: 0.5, b: 0, a: 0}
- _BlackLightMasking1Range: {r: 0.1, g: 0.5, b: 0, a: 0}
- _BlackLightMasking2Range: {r: 0.1, g: 0.5, b: 0, a: 0}
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
Shader "AudioLink/Internal/AudioLinkControllerLogo"
{
Properties
{
_BaseColor ("Base Color", Color) = (0,0,0,0)
_PulseWidth ("Pulse Width", Range(0,1)) = 0.4
_PulseOffsetQ ("Pulse Offset Q", Range(0,1)) = 0.58
_QPower("Q Power", Range(0.1,5)) = 4
_Gain ("Gain", Range(0,10)) = 4.38
}

SubShader
{
Tags{"RenderType" = "Custom" "Queue" = "Transparent+0" "IgnoreProjector" = "True"}
Cull Off
ZWrite On
Blend One One

Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
#include "AudioLink.cginc"

struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};

struct v2f
{
float4 vertex : SV_POSITION;
float2 uv : TEXCOORD0;
};

float4 _BaseColor;
float _PulseWidth;
float _PulseOffsetQ;
float _Gain;
float _QPower;

v2f vert (appdata v)
{
v2f o;

UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_OUTPUT(v2f, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);

o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = v.uv;
return o;
}

fixed4 frag (v2f i) : SV_Target
{
float2 uv = i.uv;

float offset = pow(abs(2. * uv.y - 1.) * _PulseOffsetQ, _QPower);
float position = abs(2. * uv.x - 1.);
float4 bassColor = AudioLinkLerp(ALPASS_AUDIOLINK + float2((position + offset) * _PulseWidth * 128., 0)).r * AudioLinkData(ALPASS_THEME_COLOR0) * smoothstep(1, 0, position);
float4 lowMidColor = AudioLinkLerp(ALPASS_AUDIOLINK + float2((position + offset) * _PulseWidth * 128., 1)).r * AudioLinkData(ALPASS_THEME_COLOR3) * smoothstep(1, 0, position);
float4 highMidColor = AudioLinkLerp(ALPASS_AUDIOLINK + float2((1 - (position - offset)) * _PulseWidth * 128., 2)).r * AudioLinkData(ALPASS_THEME_COLOR2) * smoothstep(0, 1, position);
float4 trebleColor = AudioLinkLerp(ALPASS_AUDIOLINK + float2((1 - (position - offset)) * _PulseWidth * 128., 3)).r * AudioLinkData(ALPASS_THEME_COLOR1) * smoothstep(0, 1, position);

return saturate(_BaseColor + (bassColor + lowMidColor + highMidColor + trebleColor) * _Gain);
}
ENDCG
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2b12b2c

Please sign in to comment.