Skip to content

Commit

Permalink
Shader fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Alyx Ferrari committed Nov 29, 2020
1 parent 953ae72 commit 18b1f03
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
8 changes: 4 additions & 4 deletions shaders/render.frag
Original file line number Diff line number Diff line change
@@ -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];
Expand Down
8 changes: 7 additions & 1 deletion shaders/render.vert
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -39,4 +43,6 @@ void main() {
}
outColor = color;
fragPos = pos;
adjacent1 = adjacentOne;
adjacent2 = adjacentTwo;
}
1 change: 1 addition & 0 deletions src/com/alyxferrari/neo3d/gfx/NEOEngine.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down

0 comments on commit 18b1f03

Please sign in to comment.