From 138d16016b743071f0e56607e453f319a3535849 Mon Sep 17 00:00:00 2001 From: Stefan Dresselhaus Date: Tue, 8 Jul 2014 15:32:14 +0200 Subject: [PATCH] tried lot of stuff.. nothing worked. --- shaders/mapobjects/fragment.shader | 2 +- shaders/mapobjects/vertex.shader | 5 +++-- src/Render/Render.hs | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/shaders/mapobjects/fragment.shader b/shaders/mapobjects/fragment.shader index 5947f13..6c05c3a 100644 --- a/shaders/mapobjects/fragment.shader +++ b/shaders/mapobjects/fragment.shader @@ -6,5 +6,5 @@ in vec3 vNormal; out vec4 fgColor; void main () { - fgColor = vec4(1.0,0.0,1.0,1.0); + fgColor = vec4(1.0,0.0,1.0,0.5); } diff --git a/shaders/mapobjects/vertex.shader b/shaders/mapobjects/vertex.shader index 0ae7edd..77e88b6 100644 --- a/shaders/mapobjects/vertex.shader +++ b/shaders/mapobjects/vertex.shader @@ -2,10 +2,11 @@ layout(location=0) in vec3 Position; layout(location=1) in vec3 Normal; +layout(location=2) in vec2 TexCoord; uniform mat4 ProjectionMatrix; uniform mat4 ViewMatrix; uniform mat3 NormalMatrix; -uniform vec3 PositionOffset = vec3(25,5,25); +uniform vec3 PositionOffset = vec3(5,5,5); uniform float TessLevelInner = 1.0; // controlled by keyboard buttons uniform float TessLevelOuter = 1.0; // controlled by keyboard buttons @@ -14,6 +15,6 @@ out vec3 vNormal; void main () { vPosition = Position; - gl_Position = ProjectionMatrix * ViewMatrix * vec4(PositionOffset + 10*Position, 1); + gl_Position = vec4(10*Position,1);//ProjectionMatrix * ViewMatrix * vec4(PositionOffset + Position, 1); vNormal = Normal; } diff --git a/src/Render/Render.hs b/src/Render/Render.hs index 1e7de0c..62134ed 100644 --- a/src/Render/Render.hs +++ b/src/Render/Render.hs @@ -288,7 +288,7 @@ renderIQM m p@(L.V3 x y z) s@(L.V3 sx sy sz) = do bindVertexArrayObject $= Just (vertexArrayObject m) let n = num_vertexes.header $ m --print $ concat ["drawing ", show n," triangles from object ",show m] - glDrawArrays gl_TRIANGLES 0 (fromIntegral n) + drawArrays Triangles 0 (fromIntegral n) checkError "drawing model" return () @@ -472,6 +472,7 @@ render = do drawMap liftIO $ do ---- RENDER MAPOBJECTS -------------------------------------------- + checkError "clear buffer" currentProgram $= Just (state ^. gl.glMap.objectProgram) checkError "setting up shadowmap-program" --set up projection (= copy from state)