        :__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}}]


(defn light-group
  [scene id {:keys [gain] :or {gain 1.0}}]
  (append scene :light-groups id {:__gain [:float gain]}))

(defn- light-common
  [scene {:keys [group color gain power efficacy importance tx material hidden?]

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