aboutsummaryrefslogtreecommitdiff
path: root/Resources.hs
diff options
context:
space:
mode:
authorJoshua Rahm <joshua.rahm@colorado.edu>2014-04-18 01:17:46 -0600
committerJoshua Rahm <joshua.rahm@colorado.edu>2014-04-18 01:17:46 -0600
commit915cda147b565880fecefe5f82ca242bad6114fc (patch)
treed6afedd6d33bdca1601faaaebd731b89aab75431 /Resources.hs
parent73daf65aaa31b5fb59f4a91d9185387f63c7b09f (diff)
downloadterralloc-915cda147b565880fecefe5f82ca242bad6114fc.tar.gz
terralloc-915cda147b565880fecefe5f82ca242bad6114fc.tar.bz2
terralloc-915cda147b565880fecefe5f82ca242bad6114fc.zip
starting tesselation shader
Diffstat (limited to 'Resources.hs')
-rw-r--r--Resources.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/Resources.hs b/Resources.hs
index 24154e0..c32de5f 100644
--- a/Resources.hs
+++ b/Resources.hs
@@ -198,6 +198,7 @@ displayHandle resources = do
uniform (UniformLocation 4) $= pMatrix resources
uniform (UniformLocation 5) $= l_mvMatrix
uniform (UniformLocation 7) $= normalMatrix
+ uniform (UniformLocation 8) $= l_mvMatrix `glslMatMul` lightPos
return ()
SDL.glSwapBuffers
@@ -303,6 +304,8 @@ makeResources surf builder forestB jungleB water = do
let pMatrix' = perspectiveMatrix 50 1.8 0.1 100
waterProg <- loadProgramSafe'
"shaders/water.vert" "shaders/water.frag" (Nothing::Maybe String)
+ waterTexture <- load "textures/water.jpg" >>= textureFromSurface
+ location <- get (uniformLocation waterProg "texture")
Resources
<$> pure surf
<*> do CameraPosition
@@ -320,6 +323,7 @@ makeResources surf builder forestB jungleB water = do
<*> buildForestObject jungleB "jungletree.obj" "textures/jungle_tree.png"
<*> (newDefaultGlyphObjectWithClosure water () $ \_ -> do
currentProgram $= Just waterProg
+ setupTexturing waterTexture location 0
)
<*> pure 0
<*> pure 1