Move closer to removing all geom shaders
This commit is contained in:
@@ -0,0 +1,21 @@
|
|||||||
|
#version 450 core
|
||||||
|
layout(early_fragment_tests) in;
|
||||||
|
layout (std140, binding = 1) uniform TheLight { vec4 lightPos; vec4 lumRad; };
|
||||||
|
layout (binding = 0) uniform sampler2D screenTexture;
|
||||||
|
layout (binding = 1) uniform sampler2D normals;
|
||||||
|
in vec2 vTexPos;
|
||||||
|
out vec4 fColor;
|
||||||
|
float rad = lumRad.a;
|
||||||
|
void main() {
|
||||||
|
vec3 pos = texture(screenTexture, vTexPos).xyz;
|
||||||
|
vec3 distVec = pos - lightPos.xyz;
|
||||||
|
float dist = dot(distVec, distVec);
|
||||||
|
vec3 norm = texture(normals, vTexPos).xyz;
|
||||||
|
float y1 = dot(norm, distVec);
|
||||||
|
float y2 = float(y1 > 0 ? 1 : 0.1);
|
||||||
|
//bool t = pos.z > lightPos.z && norm.z > 0;
|
||||||
|
//float y2 = float(y1 > 0 || t ? 1 : 0.1);
|
||||||
|
float x = 1 - (pow(dist / rad,4));
|
||||||
|
vec3 c = y2* x * lumRad.rgb;
|
||||||
|
fColor = vec4(c, 0);
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
#version 450 core
|
||||||
|
layout (std140, binding = 2) uniform PosTex { vec4 posTex[6]; };
|
||||||
|
out vec2 vTexPos;
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
gl_Position = vec4(posTex[gl_VertexID].xy,0,1);
|
||||||
|
vTexPos = posTex[gl_VertexID].zw;
|
||||||
|
}
|
||||||
@@ -10,6 +10,5 @@ void main()
|
|||||||
{
|
{
|
||||||
gl_Position = theMat * pos;
|
gl_Position = theMat * pos;
|
||||||
vColor = inColor;
|
vColor = inColor;
|
||||||
//vTexCoord = inTexCoord.xyz;
|
|
||||||
vTexCoord = inTexCoord;
|
vTexCoord = inTexCoord;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,7 +122,6 @@ preloadRender = do
|
|||||||
putStrLn "Setup full screen shaders"
|
putStrLn "Setup full screen shaders"
|
||||||
alphadivideshader <- makeSourcedShader "texture2D/alphaDivide" [vert, frag]
|
alphadivideshader <- makeSourcedShader "texture2D/alphaDivide" [vert, frag]
|
||||||
fsShad <- makeSourcedShader "texture/simple" [vert, frag]
|
fsShad <- makeSourcedShader "texture/simple" [vert, frag]
|
||||||
-- transcompshader <- makeSourcedShader "fullscreen/transparencyComp" [vert, frag]
|
|
||||||
bloomBlurShad <- makeSourcedShader "texture/bloomBlur" [vert, frag]
|
bloomBlurShad <- makeSourcedShader "texture/bloomBlur" [vert, frag]
|
||||||
lightingTextureShad <- makeSourcedShader "lighting/texture" [vert, frag]
|
lightingTextureShad <- makeSourcedShader "lighting/texture" [vert, frag]
|
||||||
lightingCloudShad <- makeSourcedShader "lighting/cloud" [vert, frag]
|
lightingCloudShad <- makeSourcedShader "lighting/cloud" [vert, frag]
|
||||||
@@ -185,7 +184,6 @@ preloadRender = do
|
|||||||
, _windowPullShader = winpull
|
, _windowPullShader = winpull
|
||||||
, _pullWallShader = wallpull
|
, _pullWallShader = wallpull
|
||||||
, _fullscreenShader = fsShad
|
, _fullscreenShader = fsShad
|
||||||
-- , _transparencyCompShader = transcompshader
|
|
||||||
, _alphaDivideShader = alphadivideshader
|
, _alphaDivideShader = alphadivideshader
|
||||||
, _lightingTextureShader = lightingTextureShad
|
, _lightingTextureShader = lightingTextureShad
|
||||||
, _lightingCloudShader = lightingCloudShad
|
, _lightingCloudShader = lightingCloudShad
|
||||||
|
|||||||
@@ -125,16 +125,14 @@ setupVertexAttribPointer vao loc va = do
|
|||||||
where
|
where
|
||||||
loc' = fromIntegral loc
|
loc' = fromIntegral loc
|
||||||
|
|
||||||
makeShaderProgram ::
|
makeShaderProgram :: String -> [(GLenum, BS.ByteString)] -> IO GLuint
|
||||||
String ->
|
|
||||||
[(GLenum, BS.ByteString)] -> -- list of shaders
|
|
||||||
IO GLuint
|
|
||||||
makeShaderProgram str srcs = do
|
makeShaderProgram str srcs = do
|
||||||
theprog <- glCreateProgram
|
theprog <- glCreateProgram
|
||||||
shaders <- mapM (compileAndCheckShader str) srcs
|
shaders <- mapM (compileAndCheckShader str) srcs
|
||||||
mapM_ (glAttachShader theprog) shaders
|
mapM_ (glAttachShader theprog) shaders
|
||||||
glLinkProgram theprog
|
glLinkProgram theprog
|
||||||
checkErrorGL (str ++ " linking ") glGetProgramiv glGetProgramInfoLog theprog GL_LINK_STATUS
|
checkErrorGL
|
||||||
|
(str ++ " linking ") glGetProgramiv glGetProgramInfoLog theprog GL_LINK_STATUS
|
||||||
mapM_ (glDetachShader theprog) shaders
|
mapM_ (glDetachShader theprog) shaders
|
||||||
mapM_ glDeleteShader shaders
|
mapM_ glDeleteShader shaders
|
||||||
return theprog
|
return theprog
|
||||||
|
|||||||
+4
-5
@@ -499,11 +499,10 @@ pokeLayVerx vbos counts vx = do
|
|||||||
|
|
||||||
pokeStride :: ShadNum -> Int
|
pokeStride :: ShadNum -> Int
|
||||||
{-# INLINE pokeStride #-}
|
{-# INLINE pokeStride #-}
|
||||||
pokeStride PolyShad = 7 + 1
|
pokeStride PolyShad = 8
|
||||||
--pokeStride TextShad = 11
|
pokeStride TextShad = 12
|
||||||
pokeStride TextShad = 10 + 2
|
pokeStride ArcShad = 12
|
||||||
pokeStride ArcShad = 10 + 2
|
pokeStride EllShad = 8
|
||||||
pokeStride EllShad = 7 + 1
|
|
||||||
|
|
||||||
poke34 :: Ptr Float -> Point3 -> Point4 -> IO ()
|
poke34 :: Ptr Float -> Point3 -> Point4 -> IO ()
|
||||||
{-# INLINE poke34 #-}
|
{-# INLINE poke34 #-}
|
||||||
|
|||||||
@@ -4379,8 +4379,8 @@ pointerYourSelectedItem src/Dodge/Item/Location.hs 26;" f
|
|||||||
pointsToPoly src/Geometry/ConvexPoly.hs 35;" f
|
pointsToPoly src/Geometry/ConvexPoly.hs 35;" f
|
||||||
poisonSPic src/Dodge/Creature/Update.hs 125;" f
|
poisonSPic src/Dodge/Creature/Update.hs 125;" f
|
||||||
poisonSprayer src/Dodge/Item/Held/SprayGuns.hs 17;" f
|
poisonSprayer src/Dodge/Item/Held/SprayGuns.hs 17;" f
|
||||||
poke34 src/Shader/Poke.hs 508;" f
|
poke34 src/Shader/Poke.hs 507;" f
|
||||||
pokeArrayOff src/Shader/Poke.hs 520;" f
|
pokeArrayOff src/Shader/Poke.hs 519;" f
|
||||||
pokeBox src/Shader/Poke.hs 228;" f
|
pokeBox src/Shader/Poke.hs 228;" f
|
||||||
pokeBoxSurface src/Shader/Poke.hs 261;" f
|
pokeBoxSurface src/Shader/Poke.hs 261;" f
|
||||||
pokeChasm src/Shader/Poke/Floor.hs 25;" f
|
pokeChasm src/Shader/Poke/Floor.hs 25;" f
|
||||||
|
|||||||
Reference in New Issue
Block a user