some more audiovis stuff

This commit is contained in:
Cat Flynn 2021-01-11 10:09:53 +00:00
parent c021109b5a
commit 234e94a46b
5 changed files with 13 additions and 8 deletions

View File

@ -28,7 +28,7 @@ MonoBehaviour:
multiplier: -500
channel: 1
sample: 525
- name: _SkyWeight
- name: _AudioSample1
multiplier: -500
channel: 1
sample: 400

View File

@ -120,8 +120,8 @@ Material:
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _Color1: {r: 1, g: 0, b: 0.009225845, a: 1}
- _Color2: {r: 0, g: 1, b: 0.9568691, a: 1}
- _Color1: {r: 0, g: 0.0323627, b: 1, a: 1}
- _Color2: {r: 1, g: 0, b: 0.4276967, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _FarColor: {r: 0, g: 0.06666667, b: 0.006862745, a: 0}
- _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}

View File

@ -183,7 +183,7 @@ Shader "custom/enemy"
float4 c = _Color1;
c = lerp(_Color1, _Color2, length(p));
c = lerp(c, _FarColor, normalised);
c = lerp(c, _FarColor, normalised * _Intensity);
// float distanceAhead = IN.wpos.z - 6;
// float ca = clamp(distanceAhead * 0.1,0,1);

View File

@ -267,7 +267,7 @@ Shader "custom/obstacle"
float noise = SAMPLE_TEXTURE2D(_NoiseMap, sampler_NoiseMap, IN.wpos.yz);
// c *= noise;
c = lerp(c, _FarColor, _DistanceToNextBeat + noise);
c = lerp(c, _FarColor, (_DistanceToNextBeat*_Intensity + noise));
c.a = 0.0;
return c;

View File

@ -40,6 +40,8 @@ Shader "custom/tunnel"
_OuterCircleThickness("Outer Circle Thickness", Range(0,1.0)) = 0.1
_Intensity("Intensity", Range(0,1.0)) = 1.0
_AudioSample1("Audio Sample 1", Float) = 0.0
_NebulaMap("Nebula Map", 2D) = "black"
_StarMap("Star Map", 2D) = "black"
_FractalMap("Fractal Map", 2D) = "black"
@ -120,6 +122,8 @@ Shader "custom/tunnel"
float _PlayerXPos;
float _PlayerXMove;
float _TrackWidth = 20;
float _AudioSample1;
TEXTURE2D(_NebulaMap);
SAMPLER(sampler_NebulaMap);
@ -337,9 +341,9 @@ Shader "custom/tunnel"
// sky
float4 sky = _BackgroundColor;
sky += f * _FractalColor; // fractal
sky += s * _StarsColor; // stars
float4 clouds = n * _CloudColor;
sky += f * _FractalColor * _Intensity * (_DistanceSinceLastBeat*_DistanceToNextBeat); // fractal
sky += s * _StarsColor * _Intensity; // stars
float4 clouds = n * _CloudColor * _DistanceToNextBeat * _Intensity;
clouds *= (1.0-g); // mask out ground
sky += clouds;
sky *= (1.0-g); // mask out ground
@ -359,6 +363,7 @@ Shader "custom/tunnel"
// ground_color = lerp(ground_color, ground_fast, ground_fast);
ground_color+= ground_fast;
ground_color *= _GroundColor;
ground_color *= 1.0+_DistanceToNextBeat * _Intensity * (1.0+_AudioSample1);
color = max(color, ground_color);
// bars