 
 (defn light-group
   [scene id {:keys [gain] :or {gain 1.0}}]
-  (append scene :light-groups id {:__gain [:float gain]}))
+  (append scene :light-groups id {:__gain gain}))
+
+(defn light-groups
+  [scene groups]
+  (reduce #(apply light-group % %2) scene groups))
 
 (defn- light-common
   [scene {:keys [group color gain power efficacy importance tx material hidden?]

   scene :film "fleximage"
   (merge
    (get-in scene [:film "fleximage"])
    {:xresolution [:int width]
     :yresolution [:int height]
     :__aspect (double (/ height width))
     :gamma [:float gamma]
     :filename [:string suffix]
     :colorspace_white [:float-vec white]

       :__shape [(conf/mesh-types mesh-type) {:__mesh mesh :__basename (str "light-" id)}]
       :nsamples [:int samples]}))))

(def light-types
  {:area area-light})

(defn lights
  [scene lspecs]
  (reduce
   (fn [scene [id {ltype :type :as spec}]]
     (if-let [lfn (light-types ltype)]
       (lfn scene id spec)
       (prn "WARN: unknown light type: " ltype)))
   scene lspecs))

(defn shape-disk
  [scene id {:keys [z radius inner-radius phi tx material]
             :or {z 0 radius 1 inner-radius 0 phi 360}}]
