(defn
perspective-texture-3d-example
[game {:keys [data width height]}]
(gl game enable (gl game CULL_FACE))
(gl game enable (gl game DEPTH_TEST))
(let
[entity
(->>
{:vertex data/texture-vertex-shader,
:fragment data/texture-fragment-shader,
:attributes
{'a_position
{:data (transform-f-data data/f-3d),
:type (gl game FLOAT),
:size 3},
'a_texcoord
{:data data/f-texcoords,
:type (gl game FLOAT),
:size 2,
:normalize true}},
:uniforms
{'u_texture
{:data data,
:opts
{:mip-level 0,
:internal-fmt (gl game RGBA),
:width width,
:height height,
:border 0,
:src-fmt (gl game RGBA),
:src-type (gl game UNSIGNED_BYTE)},
:mipmap true}},
:clear {:color [0 0 0 0], :depth 1}}
e/map->ThreeDEntity
(c/compile game))
state
{:rx (m/deg->rad 190), :ry (m/deg->rad 40)}]
(assoc game :entity entity :state state)))