From 80650ec974d661652eceb08616e8659febe2140d Mon Sep 17 00:00:00 2001 From: sotech117 Date: Fri, 10 May 2024 02:28:33 -0400 Subject: sebastian fix caustics --- resources/shaders/shader.frag | 9 +++++---- resources/shaders/shader.vert | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'resources') diff --git a/resources/shaders/shader.frag b/resources/shaders/shader.frag index 7fc82ed..ef4e9c7 100755 --- a/resources/shaders/shader.frag +++ b/resources/shaders/shader.frag @@ -44,8 +44,9 @@ float rand(vec4 n) { } vec2 uvFromWorldPoint(vec3 point) { - float u = (point.x - widthBounds[0] * 50) / (widthBounds[1] * 50 - widthBounds[0] * 50); - float v = (point.z - lengthBounds[0] * 50) / (lengthBounds[1] * 50 - lengthBounds[0] * 50); + float scale = 5.f; + float u = (point.x - widthBounds[0] * scale) / (widthBounds[1] * scale - widthBounds[0] * scale); + float v = (point.z - lengthBounds[0] * scale) / (lengthBounds[1] * scale - lengthBounds[0] * scale); return vec2(u, v); } @@ -70,9 +71,9 @@ void main() { vec2 refrUV = uvFromWorldPoint(refrPos); vec2 reflUV = uvFromWorldPoint(reflPos); -// float waterMurkiness = 0.002f; // TODO: Make uniform + float waterMurkiness = 0.003f; // TODO: Make uniform // float waterMurkiness = 0.0005f; // TODO: Make uniform - float waterMurkiness = 0.0005f; // TODO: Make uniform +// float waterMurkiness = 0.000f; // TODO: Make uniform vec3 waterVolumeColor = vec3(red * 0.1f, green * 0.2f, blue * 0.2f); float murkDiffuse = 0.3f; float murkAmbient = 0.8f; diff --git a/resources/shaders/shader.vert b/resources/shaders/shader.vert index 3cd5c17..0994b90 100755 --- a/resources/shaders/shader.vert +++ b/resources/shaders/shader.vert @@ -4,8 +4,8 @@ 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 skyHeight = 500.f; +uniform float depth = -500.f; +uniform float skyHeight = 100.f; uniform mat4 proj; uniform mat4 view; uniform mat4 model; -- cgit v1.2.3-70-g09d2