diff --git a/shaders/render.frag b/shaders/render.frag index 3e814d4..c426690 100644 --- a/shaders/render.frag +++ b/shaders/render.frag @@ -1,9 +1,9 @@ -#version 330 core -layout (location = 2) in vec3 adjacent1; -layout (location = 3) in vec3 adjacent2; -out vec4 Color; +#version 410 core +in vec3 adjacent1; +in vec3 adjacent2; in vec3 fragPos; in vec4 outColor; +out vec4 Color; uniform float lightXs[8]; uniform float lightYs[8]; uniform float lightZs[8]; diff --git a/shaders/render.vert b/shaders/render.vert index d98bd86..9c320e6 100644 --- a/shaders/render.vert +++ b/shaders/render.vert @@ -1,9 +1,13 @@ -#version 330 core +#version 410 core #define SCALE 100 layout (location = 0) in vec3 pos; layout (location = 1) in vec4 color; +layout (location = 2) in vec3 adjacentOne; +layout (location = 3) in vec3 adjacentTwo; out vec3 fragPos; out vec4 outColor; +out vec3 adjacent1; +out vec3 adjacent2; uniform vec3 camPos; uniform vec2 viewAngles; uniform vec2 sinViewAngles; @@ -39,4 +43,6 @@ void main() { } outColor = color; fragPos = pos; + adjacent1 = adjacentOne; + adjacent2 = adjacentTwo; } \ No newline at end of file diff --git a/src/com/alyxferrari/neo3d/gfx/NEOEngine.java b/src/com/alyxferrari/neo3d/gfx/NEOEngine.java index 4109578..a467182 100644 --- a/src/com/alyxferrari/neo3d/gfx/NEOEngine.java +++ b/src/com/alyxferrari/neo3d/gfx/NEOEngine.java @@ -170,6 +170,7 @@ protected static void setVertexAttributePointers() { glVertexAttribPointer(2, 3, GL_FLOAT, false, 13 * SizeOf.FLOAT, 7 * SizeOf.FLOAT); glEnableVertexAttribArray(2); glVertexAttribPointer(3, 3, GL_FLOAT, false, 13 * SizeOf.FLOAT, 10 * SizeOf.FLOAT); + glEnableVertexAttribArray(3); } /** Used internally. Converts a float ArrayList to a primitive float array. */