From cb8778771ee3c543df7f33605fd2081c83cc4327 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Wed, 26 Apr 2023 17:26:49 -0400 Subject: graphics: skybox: Fix default skybox. --- chickadee/graphics/skybox.scm | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/chickadee/graphics/skybox.scm b/chickadee/graphics/skybox.scm index 6de8a58..57e2f81 100644 --- a/chickadee/graphics/skybox.scm +++ b/chickadee/graphics/skybox.scm @@ -29,6 +29,7 @@ #:use-module (chickadee graphics polygon) #:use-module (chickadee graphics shader) #:use-module (chickadee graphics texture) + #:use-module (chickadee pixbuf) #:use-module (srfi srfi-9) #:export (make-skybox skybox? @@ -86,15 +87,19 @@ #:attributes `((0 . ,positions))))) (%make-skybox cube-map va))) +(define %default-skybox-face + (bytevector->pixbuf (u32vector #xff202020 #xff202020 #xff202020 #xff202020) + 2 2)) + ;; 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)))))) + (make-skybox (make-cube-map #:right %default-skybox-face + #:left %default-skybox-face + #:top %default-skybox-face + #:bottom %default-skybox-face + #:front %default-skybox-face + #:back %default-skybox-face)))) (define (default-skybox) (force %default-skybox)) -- cgit v1.2.3