diff options
author | sotech117 <michael_foiani@brown.edu> | 2024-05-09 20:21:38 -0400 |
---|---|---|
committer | sotech117 <michael_foiani@brown.edu> | 2024-05-09 20:21:38 -0400 |
commit | ac3f1e423e696392ea0a50c2652b829e5c5734b6 (patch) | |
tree | b6ecb80019dae822619079ce34336d34a033f2df /resources/shaders/shader.vert | |
parent | f846ddba00aee29675f0bd4f5dbc87a94a422368 (diff) | |
parent | 14684344d553dee4b3cc252709716bff927e85b8 (diff) |
resolve merge conflicts and attempt to fix local paths
Diffstat (limited to 'resources/shaders/shader.vert')
-rwxr-xr-x | resources/shaders/shader.vert | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/resources/shaders/shader.vert b/resources/shaders/shader.vert index 2d0bfe2..3cd5c17 100755 --- a/resources/shaders/shader.vert +++ b/resources/shaders/shader.vert @@ -2,9 +2,10 @@ layout(location = 0) in vec3 position; // Position of the vertex layout(location = 1) in vec3 normal; // Normal of the vertex -layout(location = 3) in vec3 texCoords; // 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 mat4 proj; uniform mat4 view; uniform mat4 model; @@ -25,7 +26,7 @@ out vec2 uv; out float matIor; vec4 getRefrPos() { - float depth = -1000.f; // TODO: Pass as uniform +// float depth = -1500.f; // TODO: Pass as uniform vec3 w_o = normalize(pos - camera_worldSpace); float cos_theta_i = dot(-w_o, normal_worldSpace); float n_i = 1; @@ -55,11 +56,11 @@ vec4 getRefrPos() { } vec3 getReflPos() { - float depth = 500.f; // TODO: Pass as uniform +// float depth = 500.f; // TODO: Pass as uniform vec3 w_o = normalize(pos - camera_worldSpace); vec3 reflectedRay = w_o - 2 * dot(w_o, normal_worldSpace) * normal_worldSpace; - float dist = depth - position.y; + float dist = skyHeight - position.y; float depthScale = dist / reflectedRay.y; vec3 skyContactPoint = (reflectedRay * depthScale) + position; return skyContactPoint; |