(defn
->entity
"Returns a 3D entity with a vector of attribute `data` and optionally a vector of `color-data`."
([game data]
(->>
{:vertex three-d-uniform-colors-vertex-shader,
:fragment three-d-uniform-colors-fragment-shader,
:attributes
{'a_position {:data data, :type (gl game FLOAT), :size 3}}}
map->ThreeDEntity))
([game data color-data]
(->>
{:vertex three-d-attribute-colors-vertex-shader,
:fragment three-d-attribute-colors-fragment-shader,
:attributes
{'a_position {:data data, :type (gl game FLOAT), :size 3},
'a_color {:data color-data, :type (gl game FLOAT), :size 3}}}
map->ThreeDEntity)))