diff options
author | sotech117 <michael_foiani@brown.edu> | 2024-05-10 02:28:33 -0400 |
---|---|---|
committer | sotech117 <michael_foiani@brown.edu> | 2024-05-10 02:28:33 -0400 |
commit | 80650ec974d661652eceb08616e8659febe2140d (patch) | |
tree | 5c2f43505d3c04a35169135ecae5cc52be2f413d /resources | |
parent | 6aab43ffd2c29a66f71b0684974abd5b2685341c (diff) |
sebastian fix caustics
Diffstat (limited to 'resources')
-rwxr-xr-x | resources/shaders/shader.frag | 9 | ||||
-rwxr-xr-x | resources/shaders/shader.vert | 4 |
2 files changed, 7 insertions, 6 deletions
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; |