render: asset: Use default sampler index of 0 when loading textures.
authorDavid Thompson <dthompson2@worcester.edu>
Fri, 7 Sep 2018 21:34:07 +0000 (17:34 -0400)
committerDavid Thompson <dthompson2@worcester.edu>
Fri, 7 Sep 2018 21:34:07 +0000 (17:34 -0400)
chickadee/render/asset.scm

index 5e4362c..91bdee2 100644 (file)
       (33071 'clamp-to-edge)))
   (define (parse-texture obj images samplers)
     (let ((image (vector-ref images (number-ref obj "source")))
-          (sampler (vector-ref samplers (number-ref obj "sampler"))))
+          (sampler
+           (vector-ref samplers (or (number-ref/optional obj "sampler") 0))))
       (load-image (scope-file (string-ref image "uri"))
                   #:min-filter (texture-filter
                                 (number-ref/optional sampler "minFilter"))