summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2014-09-06 15:03:13 -0400
committerDavid Thompson <dthompson2@worcester.edu>2014-09-06 15:03:13 -0400
commit44a43fd9dbdcac1ccef9eb7f432261047fe75032 (patch)
treecf192f308af4998f9cfa634e5ed47f4a1fca7497
parent17770f88cd46c328d9bb6517e8be4424ed0a2ab1 (diff)
scene: Use GLSL uniforms in scene nodes.
* (draw-scene-node): Add uniforms parameter and use the uniforms when rendering a mesh.
-rw-r--r--sly/scene.scm9
1 files changed, 6 insertions, 3 deletions
diff --git a/sly/scene.scm b/sly/scene.scm
index 7f6ec5e..d133d37 100644
--- a/sly/scene.scm
+++ b/sly/scene.scm
@@ -112,14 +112,17 @@
(set-scene-node-transform! node t)
t)))
-(define (draw-scene-node node alpha transform)
+(define* (draw-scene-node node alpha transform #:optional (uniforms '()))
(signal-let ((node node))
(if (mesh? node)
- (draw-mesh node `(("mvp" ,transform)))
+ (draw-mesh node `(("mvp" ,transform)
+ ,@uniforms))
(let ((transform
(transform* transform
(if (scene-node-dirty? node)
(recompute-transform! node alpha)
(scene-node-transform node)))))
(signal-let ((children (scene-node-children node)))
- (for-each (cut draw-scene-node <> alpha transform) children))))))
+ (for-each (cut draw-scene-node <> alpha transform
+ (scene-node-uniforms node))
+ children))))))