diff options
author | Joe Crayne <joe@jerkface.net> | 2019-05-21 04:21:48 -0400 |
---|---|---|
committer | Joe Crayne <joe@jerkface.net> | 2019-05-21 04:21:48 -0400 |
commit | a2aa65ffc5a4fc6cd0f41ccab1516f85a27989b2 (patch) | |
tree | 3b02233126690fea8a96ad2d2765be858ec41ab4 /hello_obj2.lc | |
parent | bc6fd1c71e22ef54a4aed8774dcec4dd190b9dbc (diff) |
Added colors to pen points + various updates.
Diffstat (limited to 'hello_obj2.lc')
-rw-r--r-- | hello_obj2.lc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/hello_obj2.lc b/hello_obj2.lc index fdf08d6..72a87ee 100644 --- a/hello_obj2.lc +++ b/hello_obj2.lc | |||
@@ -19,7 +19,7 @@ makeFrame (cubemap :: TextureCube) | |||
19 | (texture :: Texture) | 19 | (texture :: Texture) |
20 | (prims :: PrimitiveStream Triangle (Vec 4 Float, Vec 3 Float, Vec 3 Float)) | 20 | (prims :: PrimitiveStream Triangle (Vec 4 Float, Vec 3 Float, Vec 3 Float)) |
21 | (plane :: PrimitiveStream Triangle ((Vec 4 Float))) | 21 | (plane :: PrimitiveStream Triangle ((Vec 4 Float))) |
22 | (points :: PrimitiveStream Point ((Vec 3 Float))) | 22 | (points :: PrimitiveStream Point (Vec 3 Float, Vec 3 Float)) |
23 | (plane_mat :: Mat 4 4 Float) | 23 | (plane_mat :: Mat 4 4 Float) |
24 | 24 | ||
25 | = imageFrame (emptyDepthImage 1, emptyColorImage (V4 0 0 0.4 1)) | 25 | = imageFrame (emptyDepthImage 1, emptyColorImage (V4 0 0 0.4 1)) |
@@ -47,8 +47,8 @@ makeFrame (cubemap :: TextureCube) | |||
47 | & accumulateWith (DepthOp Less True, ColorOp blendplane (V4 True True True True)) | 47 | & accumulateWith (DepthOp Less True, ColorOp blendplane (V4 True True True True)) |
48 | `overlay` | 48 | `overlay` |
49 | points | 49 | points |
50 | & mapPrimitives (\((p)) -> let p' = coordmap cam $ point p | 50 | & mapPrimitives (\(p,c) -> let p' = coordmap cam $ point p |
51 | in (p', V4 1 1 0 1 :: Vec 4 Float)) | 51 | in (p', point c)) |
52 | 52 | ||
53 | & renderPoints cam | 53 | & renderPoints cam |
54 | 54 | ||
@@ -73,5 +73,5 @@ main = renderFrame $ | |||
73 | (Texture2DSlot "diffuseTexture") | 73 | (Texture2DSlot "diffuseTexture") |
74 | (fetch "objects" (Attribute "position", Attribute "normal", Attribute "uvw")) | 74 | (fetch "objects" (Attribute "position", Attribute "normal", Attribute "uvw")) |
75 | (fetch "plane" ((Attribute "position"))) | 75 | (fetch "plane" ((Attribute "position"))) |
76 | (fetch "Points" ((Attribute "position"))) | 76 | (fetch "Points" (Attribute "position", Attribute "color")) |
77 | (Uniform "PlaneModel") | 77 | (Uniform "PlaneModel") |