diff --git a/src/Language/GLSL.hs b/src/Language/GLSL.hs index 509d0cd..b61dfe0 100644 --- a/src/Language/GLSL.hs +++ b/src/Language/GLSL.hs @@ -13,10 +13,16 @@ module Language.GLSL , VariableName , Variable(..) , GLSLType(..) + , generateGLSL , generateCheckedGLSL ) where +-- TODO +-- +-- -[ ] Add support for multiple shaders in sequence +-- -[ ] Add check if the previous shader output the next shader's inputs + -- IMPORTS -- import Relude @@ -29,7 +35,7 @@ class GLSLExpression a where instance GLSLExpression Program where toGLSLText expressions = - foldr ((<>)) "}" $ map (toGLSLText) expressions + foldr ((<>)) "}\n" $ map (toGLSLText) expressions instance GLSLExpression Expression where toGLSLText @@ -87,7 +93,7 @@ instance GLSLExpression ParameterQualifier where toGLSLText Out = "out" instance GLSLExpression Variable where - toGLSLText GL_POSITION = "gl_position" + toGLSLText GL_POSITION = "gl_Position" toGLSLText (Variable name _) = name instance GLSLExpression GLSLType where diff --git a/src/Language/GLSL/Examples.hs b/src/Language/GLSL/Examples.hs index f2fe70c..1aeb728 100644 --- a/src/Language/GLSL/Examples.hs +++ b/src/Language/GLSL/Examples.hs @@ -24,10 +24,10 @@ main = do fragShader :: Program fragShader = [ VersionDeclaration 450 Core - , VariableDeclaration Nothing In fragColorIn - , VariableDeclaration Nothing Out fragColorOut + , VariableDeclaration Nothing In fragColorOut + , VariableDeclaration Nothing Out fragColor , MainStart - , VariableAssignment fragColorOut fragColorIn + , VariableAssignment fragColor fragColorOut ] vertShader :: Program @@ -41,7 +41,7 @@ vertShader = , VariableAssignment fragColorOut vertexColor ] -fragColorIn = Variable "fragColorIn" $ GLSLVec4 GLSLFloat +fragColor = Variable "fragColor" $ GLSLVec4 GLSLFloat fragColorOut = Variable "fragColorOut" $ GLSLVec4 GLSLFloat vertexPosition = Variable "vertexPosition" $ GLSLVec4 GLSLFloat vertexColor = Variable "vertexColor" $ GLSLVec4 GLSLFloat