summaryrefslogtreecommitdiff
path: root/gfx/gl/shaders
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/gl/shaders')
-rw-r--r--gfx/gl/shaders/directionalLight.fs6
-rw-r--r--gfx/gl/shaders/landmass.fs2
-rw-r--r--gfx/gl/shaders/material.fs2
-rw-r--r--gfx/gl/shaders/materialOut.glsl2
-rw-r--r--gfx/gl/shaders/pointLight.fs2
-rw-r--r--gfx/gl/shaders/spotLight.fs2
-rw-r--r--gfx/gl/shaders/water.fs2
7 files changed, 9 insertions, 9 deletions
diff --git a/gfx/gl/shaders/directionalLight.fs b/gfx/gl/shaders/directionalLight.fs
index ca10ef5..3756db7 100644
--- a/gfx/gl/shaders/directionalLight.fs
+++ b/gfx/gl/shaders/directionalLight.fs
@@ -7,7 +7,7 @@ out vec3 FragColor;
in vec2 TexCoords;
-layout(binding = 0) uniform sampler2D gPosition;
+layout(binding = 0) uniform isampler2D gPosition;
layout(binding = 1) uniform sampler2D gNormal;
layout(binding = 2) uniform sampler2D shadowMap;
@@ -27,7 +27,7 @@ insideShadowCube(vec3 v)
}
float
-isShaded(vec3 Position)
+isShaded(ivec3 Position)
{
for (uint m = 0u; m < lightViewProjectionCount; m++) {
vec3 PositionInLightSpace = (lightViewProjection[m] * vec4(Position, 1.0f)).xyz;
@@ -44,7 +44,7 @@ isShaded(vec3 Position)
void
main()
{
- const vec3 Position = texture(gPosition, TexCoords).xyz;
+ const ivec3 Position = texture(gPosition, TexCoords).xyz;
const vec3 Normal = texture(gNormal, TexCoords).rgb;
const float shaded = isShaded(Position);
FragColor = (1 - shaded) * max(dot(-lightDirection, Normal) * lightColour, 0);
diff --git a/gfx/gl/shaders/landmass.fs b/gfx/gl/shaders/landmass.fs
index 9865d11..fc43bf2 100644
--- a/gfx/gl/shaders/landmass.fs
+++ b/gfx/gl/shaders/landmass.fs
@@ -60,7 +60,7 @@ main()
}
}
- gPosition = vec4(FragPos, 1);
+ gPosition = ivec4(FragPos, 1);
gNormal = vec4(Normal, 1);
gAlbedoSpec = vec4(color, 1);
}
diff --git a/gfx/gl/shaders/material.fs b/gfx/gl/shaders/material.fs
index 20fa8ab..5b93707 100644
--- a/gfx/gl/shaders/material.fs
+++ b/gfx/gl/shaders/material.fs
@@ -42,7 +42,7 @@ main()
{
vec4 textureColour = getTextureColour(Material, TexCoords);
float opaque = step(0.5, mix(textureColour.a, 1, Colour.a));
- gPosition = vec4(FragPos, opaque);
+ gPosition = ivec4(FragPos, opaque);
gNormal = vec4(Normal, opaque);
gl_FragDepth = mix(1.0, gl_FragCoord.z, opaque);
gAlbedoSpec = mix(textureColour, vec4(Colour.rgb, 1), Colour.a);
diff --git a/gfx/gl/shaders/materialOut.glsl b/gfx/gl/shaders/materialOut.glsl
index dc5f8e8..846825e 100644
--- a/gfx/gl/shaders/materialOut.glsl
+++ b/gfx/gl/shaders/materialOut.glsl
@@ -1,3 +1,3 @@
-layout(location = 0) out vec4 gPosition;
+layout(location = 0) out ivec4 gPosition;
layout(location = 1) out vec4 gNormal;
layout(location = 2) out vec4 gAlbedoSpec;
diff --git a/gfx/gl/shaders/pointLight.fs b/gfx/gl/shaders/pointLight.fs
index 1a68df8..ba327b6 100644
--- a/gfx/gl/shaders/pointLight.fs
+++ b/gfx/gl/shaders/pointLight.fs
@@ -3,7 +3,7 @@
out vec3 FragColor;
-layout(binding = 0) uniform sampler2D gPosition;
+layout(binding = 0) uniform isampler2D gPosition;
layout(binding = 1) uniform sampler2D gNormal;
uniform ivec4 viewPort;
uniform vec3 colour;
diff --git a/gfx/gl/shaders/spotLight.fs b/gfx/gl/shaders/spotLight.fs
index 78b8f72..937f922 100644
--- a/gfx/gl/shaders/spotLight.fs
+++ b/gfx/gl/shaders/spotLight.fs
@@ -3,7 +3,7 @@
out vec3 FragColor;
-layout(binding = 0) uniform sampler2D gPosition;
+layout(binding = 0) uniform isampler2D gPosition;
layout(binding = 1) uniform sampler2D gNormal;
uniform ivec4 viewPort;
uniform vec3 colour;
diff --git a/gfx/gl/shaders/water.fs b/gfx/gl/shaders/water.fs
index 2ccc924..a0daa17 100644
--- a/gfx/gl/shaders/water.fs
+++ b/gfx/gl/shaders/water.fs
@@ -10,7 +10,7 @@ uniform vec3 waves;
void
main()
{
- gPosition = vec4(FragPos, 1);
+ gPosition = ivec4(FragPos, 1);
gNormal = vec4(Normal, 1);
gAlbedoSpec = texture(texture0, TexCoords);
gAlbedoSpec.a *= clamp(-FragPos.z * .0007, .1, 1.0);