summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2021-09-21 20:03:52 -0400
committerDavid Thompson <dthompson2@worcester.edu>2021-09-21 20:17:36 -0400
commitee17d9897cfaf382d36e2cf0a1aae3da5e2ef2f7 (patch)
tree94fe72370ce4a51a338049011f387564a71d225c
parente6b9c50f6abf9028a0027f918d47b2f35ada5253 (diff)
graphics: mesh/model: Use default skybox if user doesn't provide one.
-rw-r--r--chickadee/graphics/mesh.scm6
-rw-r--r--chickadee/graphics/model.scm3
2 files changed, 4 insertions, 5 deletions
diff --git a/chickadee/graphics/mesh.scm b/chickadee/graphics/mesh.scm
index 14cd82a..55e78a5 100644
--- a/chickadee/graphics/mesh.scm
+++ b/chickadee/graphics/mesh.scm
@@ -132,9 +132,7 @@
(g:multisample? (material-multisample? material))
(g:polygon-mode (material-polygon-mode material))
(g:stencil-test (material-stencil-test material))
- (g:texture-0 (if skybox
- (skybox-cube-map skybox)
- null-texture))
+ (g:texture-0 (skybox-cube-map skybox))
(g:texture-1 (material-texture-0 material))
(g:texture-2 (material-texture-1 material))
(g:texture-3 (material-texture-2 material))
@@ -194,7 +192,7 @@
(define* (draw-mesh mesh #:key (model-matrix %identity-matrix)
(view-matrix %identity-matrix)
(camera-position %origin)
- skybox
+ (skybox (default-skybox))
(lights '()))
;; Populate light vector to pass on to shader.
(let ((light-vector (mesh-light-vector mesh)))
diff --git a/chickadee/graphics/model.scm b/chickadee/graphics/model.scm
index 5e0857e..11e90d5 100644
--- a/chickadee/graphics/model.scm
+++ b/chickadee/graphics/model.scm
@@ -40,6 +40,7 @@
#:use-module (chickadee graphics phong)
#:use-module (chickadee graphics polygon)
#:use-module (chickadee graphics shader)
+ #:use-module (chickadee graphics skybox)
#:use-module (chickadee graphics texture)
#:use-module (chickadee utils)
#:use-module (ice-9 format)
@@ -151,7 +152,7 @@
(define %depth-test (make-depth-test))
(define* (draw-model model model-matrix view-matrix camera-position #:key
- skybox
+ (skybox (default-skybox))
(lights '()))
(with-graphics-state ((g:depth-test %depth-test)
(g:multisample? #t))