Commit 79827623 authored by Gargaj's avatar Gargaj
Browse files

add smoothing factor to config

parent b0ba577a
......@@ -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",
......
......@@ -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<jsonxx::Object>("rendering"))
{
if (o.get<jsonxx::Object>("rendering").has<jsonxx::Number>("fftSmoothFactor"))
fFFTSmoothingFactor = o.get<jsonxx::Object>("rendering").get<jsonxx::Number>("fftSmoothFactor");
}
if (o.has<jsonxx::Object>("textures"))
{
printf("Loading textures...\n");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment