diff --git a/README.md b/README.md index d8dfb8dd..5b42b175 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,9 @@ Create a ```config.json``` with e.g. the following contents: (all fields are opt "file":"Input-Regular_(InputMono-Medium).ttf", "size":16, }, + "rendering":{ + "fftSmoothFactor": 0.9, // 0.0 means there's no smoothing at all, 1.0 means the FFT is completely smoothed flat + }, "textures":{ /* the keys below will become the shader variable names */ "texChecker":"textures/checker.png", "texNoise":"textures/noise.png", diff --git a/main.cpp b/main.cpp index 922c16c9..f16f1359 100644 --- a/main.cpp +++ b/main.cpp @@ -81,7 +81,7 @@ int main() int nDebugOutputHeight = 200; int nTexPreviewWidth = 64; - float fFFTSmoothingFactor = 0.9f; + float fFFTSmoothingFactor = 0.9f; // higher value, smoother FFT char szConfig[65535]; FILE * fConf = fopen("config.json","rb"); @@ -94,6 +94,12 @@ int main() jsonxx::Object o; o.parse( szConfig ); + if (o.has("rendering")) + { + if (o.get("rendering").has("fftSmoothFactor")) + fFFTSmoothingFactor = o.get("rendering").get("fftSmoothFactor"); + } + if (o.has("textures")) { printf("Loading textures...\n");