summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2021-09-21 19:59:12 -0400
committerDavid Thompson <dthompson2@worcester.edu>2021-09-21 20:17:36 -0400
commite6b9c50f6abf9028a0027f918d47b2f35ada5253 (patch)
tree3533e0717437673b73cea54d30738fc1d4ba9e7d
parent722d8e064ae76e452f55ce03a1573909f05f087c (diff)
graphics: skybox: Add default-skybox procedure.
-rw-r--r--chickadee/graphics/skybox.scm14
1 files changed, 14 insertions, 0 deletions
diff --git a/chickadee/graphics/skybox.scm b/chickadee/graphics/skybox.scm
index d7fe5d7..093f629 100644
--- a/chickadee/graphics/skybox.scm
+++ b/chickadee/graphics/skybox.scm
@@ -36,6 +36,7 @@
skybox?
skybox-cube-map
skybox-mesh
+ default-skybox
draw-skybox))
(define-record-type <skybox>
@@ -87,6 +88,19 @@
#:attributes `((0 . ,positions)))))
(%make-skybox cube-map va)))
+;; A default, dark gray skybox.
+(define %default-skybox
+ (delay
+ (let ((face (list (u32vector #xff202020
+ #xff202020
+ #xff202020
+ #xff202020)
+ 2 2)))
+ (make-skybox (make-cube-map (make-list 6 face))))))
+
+(define (default-skybox)
+ (force %default-skybox))
+
(define %skybox-shader
(delay (load-shader (scope-datadir "shaders/skybox-vert.glsl")
(scope-datadir "shaders/skybox-frag.glsl"))))