summaryrefslogtreecommitdiff
path: root/resources
diff options
context:
space:
mode:
authorSebastian Park <SebPark03@gmail.com>2024-05-09 17:32:19 -0400
committerSebastian Park <SebPark03@gmail.com>2024-05-09 17:32:19 -0400
commitf1230ea24dc87a3bb5c9c709d4571e3298d7d07f (patch)
tree99773c557a199bf8f79a84e9cb711d7dae55dfa1 /resources
parent3d9a55316dbcfb2ca1f32f5554d1948fcabb5d74 (diff)
Render normals to the ocean floor.
Diffstat (limited to 'resources')
-rw-r--r--resources/shaders/color.frag15
-rw-r--r--resources/shaders/color.vert3
2 files changed, 10 insertions, 8 deletions
diff --git a/resources/shaders/color.frag b/resources/shaders/color.frag
index fe70983..7c41c89 100644
--- a/resources/shaders/color.frag
+++ b/resources/shaders/color.frag
@@ -13,16 +13,16 @@ in float intensity;
//uniform float intExp = 0.5f;
//uniform float scale = 1.f;
-uniform float multiplier = .9f;
-uniform float contrast = 20.f;
-uniform float intExp = 0.f;
-uniform float scale = 1.f;
-
-//uniform float multiplier = .5f;
-//uniform float contrast = 1.5f;
+//uniform float multiplier = .9f;
+//uniform float contrast = 20.f;
//uniform float intExp = 0.f;
//uniform float scale = 1.f;
+uniform float multiplier = .5f;
+uniform float contrast = 1.5f;
+uniform float intExp = 0.f;
+uniform float scale = 1.f;
+
//uniform vec4 baseColor =vec4();
void main() {
@@ -39,4 +39,5 @@ void main() {
finalInt = clamp(finalInt, 0, 1);
fragColor = vec4(1, 1, 1, finalInt * scale);
// fragColor = vec4(vec3(1), pow(oldArea / newArea * .2f, 1.5f));
+ fragColor = vec4((normal_worldSpace + 1) / 2, 1.f);
}
diff --git a/resources/shaders/color.vert b/resources/shaders/color.vert
index 677abf6..d607ff9 100644
--- a/resources/shaders/color.vert
+++ b/resources/shaders/color.vert
@@ -4,7 +4,7 @@ layout(location = 0) in vec3 position; // Position of the vertex
layout(location = 1) in vec3 normal; // Normal of the vertex
layout(location = 2) in vec3 texCoords; // Normal of the vertex
-uniform float depth = -3000.f;
+uniform float depth = -1000.f;
uniform float skyHeight = 500.f;
uniform mat4 proj;
uniform mat4 view;
@@ -89,4 +89,5 @@ void main() {
oldPosFlat = moveToTopDown(position);
pos = moveToTopDown(vec3(refractedPositionAndProb));
gl_Position = vec4(pos, 1.f);
+ gl_Position = vec4(oldPosFlat, 1.f);
}