From 05038becbe8907a1364db05c42fc1bc48f66ce56 Mon Sep 17 00:00:00 2001 From: sotech117 Date: Fri, 10 May 2024 16:18:23 -0400 Subject: final commit --- resources/shaders/foam.vert | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'resources/shaders/foam.vert') diff --git a/resources/shaders/foam.vert b/resources/shaders/foam.vert index f27c589..4d7f075 100644 --- a/resources/shaders/foam.vert +++ b/resources/shaders/foam.vert @@ -2,7 +2,7 @@ layout(location = 0) in vec3 position; // Position of the vertex layout(location = 1) in vec3 wavelength; // wavelenth adjusted for ocean depth -layout(location = 2) in vec3 wavedirs; // wavelenth adjusted for ocean depth +layout(location = 2) in vec3 normals; // normals //layout(location = 2) in vec2 direction; // wave slope //layout(location = 3) in vec2 texCoords; // texture coords @@ -13,6 +13,8 @@ out vec2 constants; out vec2 dir; out vec2 tex; out vec3 pos; +out vec3 norm; +out vec3 camera_worldSpace; @@ -45,11 +47,13 @@ vec2 calculateTexCoord(vec3 pos){ } void main() { - dir = vec2(wavedirs[0],wavedirs[1]); +// dir = vec2(wavedirs[0],wavedirs[1]); constants = vec2(wavelength[0], phaseC); gl_Position = proj * view * model * vec4(position, 1); pos = vec3(gl_Position); + norm = normalize(normals); + camera_worldSpace = vec3(inverseView * vec4(0.f, 0.f, 0.f, 1.f)); tex = calculateTexCoord(position); -- cgit v1.2.3-70-g09d2