Add Normal in vertex. And add light in shader.
This commit is contained in:
parent
8908ef1332
commit
0e96615b32
16 changed files with 221 additions and 85 deletions
|
|
@ -1,16 +1,18 @@
|
|||
#version 330 core
|
||||
layout (location = 0) in vec3 aPos;
|
||||
layout (location = 1) in vec4 aColor;
|
||||
layout (location = 2) in vec4 aColorFar;
|
||||
layout (location = 3) in vec2 aTexCoord;
|
||||
layout (location = 4) in vec4 aTexType;
|
||||
layout (location = 5) in float aRealTexType;
|
||||
layout (location = 1) in vec3 aNormal;
|
||||
layout (location = 2) in vec4 aColor;
|
||||
layout (location = 3) in vec4 aColorFar;
|
||||
layout (location = 4) in vec2 aTexCoord;
|
||||
layout (location = 5) in vec4 aTexType;
|
||||
layout (location = 6) in float aRealTexType;
|
||||
|
||||
uniform mat4 model;
|
||||
uniform mat4 view;
|
||||
uniform mat4 projection;
|
||||
|
||||
out vec3 FragPos;
|
||||
out vec3 Normal;
|
||||
out vec4 Color;
|
||||
out vec4 FarColor;
|
||||
out vec2 TexCoord;
|
||||
|
|
@ -21,6 +23,7 @@ void main()
|
|||
{
|
||||
gl_Position = vec4(aPos, 1.0) * model * view * projection;
|
||||
FragPos = vec3(vec4(aPos, 1.0) * model);
|
||||
Normal = aNormal;
|
||||
Color = aColor;
|
||||
FarColor = aColorFar;
|
||||
TexCoord = aTexCoord;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue