1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-23 20:29:42 +00:00

Okay, it looks like colour 3 is approximately phase offset 0, and the palette wraps around after 14 entries, not 16. Also got a bit less dependent on floating point accuracy for the step.

This commit is contained in:
Thomas Harte 2015-09-05 17:10:41 -04:00 committed by Thomas Harte
parent 39027b675d
commit 7fb6c86d9d

View File

@ -158,8 +158,8 @@ const char *Machine::get_signal_decoder()
"{\n"
"vec2 c = texture(texID, coordinate).rg;"
"float y = 0.1 + c.x * 0.91071428571429;\n"
"float aOffset = 6.283185308 * c.y;\n"
"return y + step(0.0625, c.y) * 0.1 * sin(phase + aOffset);\n"
"float aOffset = 6.283185308 * (c.y - 3.0 / 16.0) * 1.14285714285714;\n"
"return y + step(0.03125, c.y) * 0.1 * sin(phase + aOffset);\n"
"}";
}