 
 (defn- luxattrib
   [id body]
-  (format "AttributeBegin # %s\n%sAttributeEnd\n\n" id body))
+  (let [sep (str "# -------- " id " --------\n")]
+    (format "AttributeBegin %s%sAttributeEnd   %s\n" sep body sep)))
 
 (defn- luxtransform
   [tx]
   (format "Transform [%s]\n"
           (apply str (interpose " " (map #(format "%1.8f" %) tx)))))
 
+(defn- material-ref
+  [id]
+  (format "NamedMaterial \"%s\"\n" id))
+
 (defmulti luxvalue (fn [type & _] type))
 
 (defmethod luxvalue :float

             (:film scene)
             (:camera scene)
             "WorldBegin\n\n"
             (when (:volumes scene) (include-file (str base-name ".lxv")))
             (when (:materials scene) (include-file (str base-name ".lxm")))
             (when (:geometry scene) (include-file (str base-name ".lxo")))
             (:lights scene)
             "\nWorldEnd\n")]
    (spit lxs-path lxs)

                    :camera :camera
                    :lights :light
                    :materials :material
                    :volumes :volume
                    :geometry :shape})
           lxs (serialize-lxs scene* base-path separate?)]
       (if separate?
         (-> lxs
             (str (serialize-lxm scene* base-path))
             (str (serialize-lxo scene* base-path))
             (str (serialize-lxv scene* base-path)))
         lxs))))

(defn- append
  ([scene group id opts]
