diff options
author | Sebastian Park <SebPark03@gmail.com> | 2024-04-23 00:30:37 -0400 |
---|---|---|
committer | Sebastian Park <SebPark03@gmail.com> | 2024-04-23 00:30:37 -0400 |
commit | f2d61fc06387ccb22ecb5cb6c42210736ac64c9f (patch) | |
tree | 9191e1e91a79514a5231dc6e50c2ecc4feb03b16 /resources/shaders/shader.vert | |
parent | b4be9e522b51b01c7870821648e85f97c1fdb09b (diff) |
Get ground textures working, but not yet abstracted to the shape class.
Diffstat (limited to 'resources/shaders/shader.vert')
-rwxr-xr-x | resources/shaders/shader.vert | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/resources/shaders/shader.vert b/resources/shaders/shader.vert index fbb9950..3271498 100755 --- a/resources/shaders/shader.vert +++ b/resources/shaders/shader.vert @@ -22,7 +22,7 @@ out vec2 uv; out float matIor; vec4 getRefrPos() { - float depth = -1.f; // TODO: Pass as uniform + float depth = -3.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; @@ -52,8 +52,8 @@ vec4 getRefrPos() { } void main() { - float depth = -2.f; - float dist = position.y - depth; +// float depth = -4.f; +// float dist = position.y - depth; float width = 81.f * 2.f; float length = 81.f * 2.f; matIor = 1.33f; @@ -64,10 +64,10 @@ void main() { pos = vec3(model * vec4(position, 1.f)); //vec3(model * vec4(objSpacePos, 1.f)); // pos = position; - float depthScale = dist / normal.y; - vec3 groundContactPoint = -(normal * depthScale) + position; // carries down to ground - groundContactPoint = vec3(model * vec4(position, 1)); - uv = vec2((position.x + 81.f) / (162.f), groundContactPoint.z); +// float depthScale = dist / normal.y; +// vec3 groundContactPoint = -(normal * depthScale) + position; // carries down to ground +// groundContactPoint = vec3(model * vec4(position, 1)); +// uv = vec2((position.x + 81.f) / (162.f), groundContactPoint.z); // uv = vec2(normal); vec4 refrPos_and_prob = getRefrPos(); refrPos = vec3(refrPos_and_prob); |