+ if (simulationOn) {
+ drawSimulation(simulationColors);
+ }
+
+ // 2D Overlay UI
+ drawUI();
+
+ // Gamma correction here. Apply a cubic to the brightness
+ // for better representation of dynamic range
+ for (int i = 0; i < sendColors.length; ++i) {
+ lx.RGBtoHSB(sendColors[i], hsb);
+ float b = hsb[2];
+ sendColors[i] = lx.hsb(360.*hsb[0], 100.*hsb[1], 100.*(b*b*b));
+ }
+
+ // TODO(mcslee): move into GLucose engine
+ for (PandaDriver p : pandaBoards) {
+ p.send(sendColors);
+ }
+}
+
+void drawSimulation(color[] simulationColors) {
+ camera(