summaryrefslogtreecommitdiffhomepage
path: root/shaders
diff options
context:
space:
mode:
Diffstat (limited to 'shaders')
-rw-r--r--shaders/lightmap.cpp2
-rw-r--r--shaders/lightmap.hpp3
-rw-r--r--shaders/shader.frag2
3 files changed, 5 insertions, 2 deletions
diff --git a/shaders/lightmap.cpp b/shaders/lightmap.cpp
index d857f3ba..ddfa2f46 100644
--- a/shaders/lightmap.cpp
+++ b/shaders/lightmap.cpp
@@ -204,7 +204,7 @@ lightmap_shader::lightmap_shader()
setUniform(LightColorUniform, Color3{1, 1, 1});
setUniform(SizeUniform, Vector2(1 / (chunk_size * max_neighbors)));
setUniform(CenterFragcoordUniform, Vector2(0, 0));
- setUniform(CenterClipUniform, Vector2(-1, 1));
+ setUniform(CenterClipUniform, Vector2(-1, -1));
setUniform(IntensityUniform, 1.f);
setUniform(ModeUniform, DrawLightmapMode);
setUniform(FalloffUniform, (uint32_t)light_falloff::constant);
diff --git a/shaders/lightmap.hpp b/shaders/lightmap.hpp
index e48d4b5d..a5564a9b 100644
--- a/shaders/lightmap.hpp
+++ b/shaders/lightmap.hpp
@@ -134,7 +134,8 @@ private:
//void clear_accum();
static std::array<UnsignedShort, 6> quad_indexes(size_t N);
- GL::Buffer vertex_buf{NoCreate}, index_buf{NoCreate}; // set to {NoCreate} on capacity change
+ // todo use setData() and a boolean flag on capacity change
+ GL::Buffer vertex_buf{NoCreate}, index_buf{NoCreate};
Array<std::array<Vector3, 4>> vertexes; // todo make a contiguous allocation
Array<std::array<UnsignedShort, 6>> indexes;
size_t count = 0, capacity = 0;
diff --git a/shaders/shader.frag b/shaders/shader.frag
index faea53fb..98c18e10 100644
--- a/shaders/shader.frag
+++ b/shaders/shader.frag
@@ -12,6 +12,8 @@ layout (location = 1) noperspective in vec2 frag_light_coord;
out vec4 color;
//layout (depth_greater) out float gl_FragDepth;
+layout(pixel_center_integer) in vec4 gl_FragCoord;
+
void main() {
vec4 light = tint;
if (enable_lightmap)