From cd74bd234f407f1517f475d05ba8211eb59b0958 Mon Sep 17 00:00:00 2001 From: Terri00 Date: Thu, 7 Mar 2019 20:18:38 +0000 Subject: [PATCH] Gamma corrected height shader (thanks Yanzl) --- MCDV/depth.fs | 5 ++--- MCDV/vbsp.hpp | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/MCDV/depth.fs b/MCDV/depth.fs index 9171f63..24fc069 100644 --- a/MCDV/depth.fs +++ b/MCDV/depth.fs @@ -14,7 +14,6 @@ in float Alpha; void main() { - float height = (Depth - HEIGHT_MIN) / HEIGHT_MAX; - - FragColor = vec4(height, height, height, 1.0); + float height = pow((Depth - HEIGHT_MIN) / HEIGHT_MAX, 2.2); + FragColor = vec4(height, height, height, Alpha); } \ No newline at end of file diff --git a/MCDV/vbsp.hpp b/MCDV/vbsp.hpp index 0f2608b..020ff40 100644 --- a/MCDV/vbsp.hpp +++ b/MCDV/vbsp.hpp @@ -543,6 +543,8 @@ public: if (face.dispInfo == -1 || true) { + std::cout << " ~ " << this->texDataString[this->texinfos[face.texInfo].texdata] << std::endl; + std::vector vertices; for (int e = face.firstEdge; e < face.firstEdge + face.numEdges; e++) { //edge_indexes.push_back); -- 2.25.1