working on some bugs
This commit is contained in:
1 parent
54a01e3a05
commit
9568583cdd
5 files changed
+50
-15
No files matched your search
@@ -1,11 +1,12 @@
|
||||
#version 330 core
|
||||
|
||||
// The final color output for the pixel.
|
||||
out vec4 FragColor;
|
||||
|
||||
// [NEW] This variable will be set from your C++ code
|
||||
uniform vec3 u_Color;
|
||||
|
||||
void main()
|
||||
{
|
||||
// Hard-code the color to an obnoxious bright orange.
|
||||
// The values are (Red, Green, Blue, Alpha).
|
||||
FragColor = vec4(1.0, 1.0, 1.0, 1.0);
|
||||
}
|
||||
// Use the color from C++
|
||||
FragColor = vec4(u_Color, 1.0);
|
||||
}
|
||||
@@ -3,14 +3,19 @@
|
||||
// Input vertex attribute (e.g., from your VBO)
|
||||
// 'layout (location = 0)' matches the first attribute you enable.
|
||||
layout (location = 0) in vec3 aPos;
|
||||
layout (location = 1) in vec3 aNormal;
|
||||
|
||||
// A "uniform" is a global variable you set from your C++/Java/etc. code.
|
||||
// This matrix combines your model, view, and projection matrices.
|
||||
uniform mat4 u_mvp;
|
||||
|
||||
flat out vec3 v_Normal;
|
||||
|
||||
void main()
|
||||
{
|
||||
// gl_Position is a special built-in variable.
|
||||
// It's the final clip-space position of the vertex.
|
||||
gl_Position = u_mvp * vec4(aPos, 1.0);
|
||||
|
||||
v_Normal = aNormal;
|
||||
}
|
||||
Reference in new issue
Block a user