summaryrefslogtreecommitdiff
path: root/hello_obj2.lc
diff options
context:
space:
mode:
authorJoe Crayne <joe@jerkface.net>2019-04-29 23:11:39 -0400
committerJoe Crayne <joe@jerkface.net>2019-04-29 23:11:39 -0400
commitc9c0db44f79c5ad13c0937d8e36fa828447f9585 (patch)
treecaf5695cab2c9030f13f0b2a039f015508908124 /hello_obj2.lc
parentc9d1da96a78c78f18ba0d995d6a0376a00452b80 (diff)
Skybox-related uniforms.
Diffstat (limited to 'hello_obj2.lc')
-rw-r--r--hello_obj2.lc9
1 files changed, 7 insertions, 2 deletions
diff --git a/hello_obj2.lc b/hello_obj2.lc
index d0fc35b..52d4a52 100644
--- a/hello_obj2.lc
+++ b/hello_obj2.lc
@@ -7,7 +7,9 @@ blendplane = -- NoBlending -- BlendLogicOp Xor
7 ((OneBF,SrcAlpha),(DstAlpha,DstAlpha)) 7 ((OneBF,SrcAlpha),(DstAlpha,DstAlpha))
8 (V4 0 0 0 0) 8 (V4 0 0 0 0)
9 9
10makeFrame (cameraPosition :: Vec 3 Float) 10makeFrame (cubemap :: Texture)
11 (skybox :: PrimitiveStream Triangle ((Vec 3 Float)))
12 (cameraPosition :: Vec 3 Float)
11 (cam :: Mat 4 4 Float) 13 (cam :: Mat 4 4 Float)
12 (color :: Vec 4 Float) 14 (color :: Vec 4 Float)
13 (texture :: Texture) 15 (texture :: Texture)
@@ -30,9 +32,12 @@ makeFrame (cameraPosition :: Vec 3 Float)
30 in ((r + V4 0 0 0 (0.8)))) 32 in ((r + V4 0 0 0 (0.8))))
31 & accumulateWith (DepthOp Less True, ColorOp blendplane (V4 True True True True)) 33 & accumulateWith (DepthOp Less True, ColorOp blendplane (V4 True True True True))
32 34
35textureCubeSlot s = Texture2DSlot s
33 36
34main = renderFrame $ 37main = renderFrame $
35 makeFrame (Uniform "CameraPosition") 38 makeFrame (textureCubeSlot "CubeMap")
39 (fetch "SkyCube" ((Attribute "position")))
40 (Uniform "CameraPosition")
36 (Uniform "ViewProjection") 41 (Uniform "ViewProjection")
37 (Uniform "diffuseColor") 42 (Uniform "diffuseColor")
38 (Texture2DSlot "diffuseTexture") 43 (Texture2DSlot "diffuseTexture")