Skip to content

Commit 73683c4

Browse files
committed
Working on bin delta, updated ShinNFDebug to show this
1 parent 5469cba commit 73683c4

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

ColorChord.NET/Outputs/Display/Shaders/ShinNFDebug.frag

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,13 @@ vec3 AngleToRGB(float angle, float sat, float val)
3232
void main()
3333
{
3434
int SectionHere = int(floor(TexCoord.x * BinCount));
35-
float HeightHere = pow(texture(TextureRawBins, vec2((SectionHere + 0.5) / BinCount, 0.5)).r, Exponent) * ScaleFactor;
35+
float HeightHere = pow(texture(TextureRawBins, vec2((SectionHere + 0.5) / BinCount, 0.25)).r, Exponent) * ScaleFactor;
36+
float ChangeHere = texture(TextureRawBins, vec2((SectionHere + 0.5) / BinCount, 0.75)).r * 10.0;
3637
uint PeakHere = (texture(TexturePeakBits, vec2(((SectionHere / 8) + 0.5) / textureSize(TexturePeakBits, 0).x, 0.5)).r >> (SectionHere % 8)) & 1u;
3738
uint WidebandHere = (texture(TextureWidebandBits, vec2(((SectionHere / 8) + 0.5) / textureSize(TextureWidebandBits, 0).x, 0.5)).r >> (SectionHere % 8)) & 1u;
3839
vec3 Colour = AngleToRGB(mod(float(SectionHere) / BINS_PER_OCATVE, 1.0), 1.0 - (0.6 * WidebandHere), 1.0 - (0.8 * WidebandHere));
3940
float IsBar = step(abs(TexCoord.y), HeightHere);
41+
//float IsBar = (step(0.0, TexCoord.y) * step(TexCoord.y, HeightHere)) + ((step(0.0, -TexCoord.y) * step(-TexCoord.y, ChangeHere)));
4042
FragColor = vec4((IsBar * Colour) + ((1.0 - IsBar) * vec3(0.2) * PeakHere * Colour), 1.0);
4143
//FragColor = vec4(vec3(0.8), 1.0);
4244
}

ColorChord.NET/Outputs/Display/ShinNFDebug.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public ShinNFDebug(DisplayOpenGL parent, IVisualizer visualizer, Dictionary<stri
4545
{
4646
this.HostWindow = parent;
4747
Configurer.Configure(this, config);
48-
this.RawDataIn = new float[ColorChord.NoteFinder.AllBinValues.Length];
48+
this.RawDataIn = new float[ColorChord.NoteFinder.AllBinValues.Length * 2];
4949
}
5050

5151
public bool SupportsFormat(IVisualizerFormat format) => true;
@@ -115,10 +115,11 @@ public void Render()
115115
if (!this.SetupDone) { return; }
116116
this.Shader!.Use();
117117

118-
if (this.RawDataIn.Length != ColorChord.NoteFinder.AllBinValues.Length) { this.RawDataIn = new float[ColorChord.NoteFinder.AllBinValues.Length]; }
118+
if (this.RawDataIn.Length != ColorChord.NoteFinder.AllBinValues.Length * 2) { this.RawDataIn = new float[ColorChord.NoteFinder.AllBinValues.Length * 2]; }
119119
ColorChord.NoteFinder.AllBinValues.CopyTo(this.RawDataIn);
120+
((ShinNoteFinder)ColorChord.NoteFinder).RecentBinChanges.CopyTo(this.RawDataIn, ColorChord.NoteFinder.AllBinValues.Length);
120121
GL.ActiveTexture(TextureUnit.Texture0);
121-
GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.R32f, ColorChord.NoteFinder!.AllBinValues.Length, 1, 0, PixelFormat.Red, PixelType.Float, this.RawDataIn);
122+
GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.R32f, ColorChord.NoteFinder!.AllBinValues.Length, 2, 0, PixelFormat.Red, PixelType.Float, this.RawDataIn);
122123
GL.ActiveTexture(TextureUnit.Texture1);
123124
GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.R8ui, ColorChord.NoteFinder!.AllBinValues.Length / 8, 1, 0, PixelFormat.RedInteger, PixelType.UnsignedByte, ((ShinNoteFinder)ColorChord.NoteFinder).PeakBits);
124125
GL.ActiveTexture(TextureUnit.Texture2);

0 commit comments

Comments
 (0)