summary refs log tree commit diff stats
path: root/shaders/final.vertex
diff options
context:
space:
mode:
Diffstat (limited to 'shaders/final.vertex')
-rw-r--r--shaders/final.vertex7
1 files changed, 4 insertions, 3 deletions
diff --git a/shaders/final.vertex b/shaders/final.vertex index dda8626..4c5b1d5 100644 --- a/shaders/final.vertex +++ b/shaders/final.vertex
@@ -2,6 +2,7 @@
2 2
3layout(location = 0) in vec3 vertexPosition_modelspace; 3layout(location = 0) in vec3 vertexPosition_modelspace;
4layout(location = 1) in vec3 vertexNormal; 4layout(location = 1) in vec3 vertexNormal;
5layout(location = 2) in vec2 vertexUV;
5 6
6out vec2 UV; 7out vec2 UV;
7out vec3 normIn; 8out vec3 normIn;
@@ -12,18 +13,18 @@ out vec3 lightDirIn;
12uniform mat4 MVP; 13uniform mat4 MVP;
13uniform mat4 worldMat; 14uniform mat4 worldMat;
14 15
15const vec3 Tuning_LightPos = vec3(1, 1, 1.0); 16const vec3 Tuning_LightPos = vec3(1, 1, -1.0);
16 17
17void main() 18void main()
18{ 19{
19 gl_Position = MVP * vec4(vertexPosition_modelspace,1); 20 gl_Position = MVP * vec4(vertexPosition_modelspace,1);
20 UV = (vertexPosition_modelspace.xy+vec2(1,1))/2.0; 21 UV = vertexUV;
21 normIn = vertexNormal; 22 normIn = vertexNormal;
22 23
23 mat3 invWorldRot = transpose(mat3(worldMat[0].xyz, worldMat[1].xyz, worldMat[2].xyz)); 24 mat3 invWorldRot = transpose(mat3(worldMat[0].xyz, worldMat[1].xyz, worldMat[2].xyz));
24 //mat3 invWorldRot = mat3(1.0f); 25 //mat3 invWorldRot = mat3(1.0f);
25 vec3 worldPos = (worldMat * vec4(vertexPosition_modelspace,1)).xyz; 26 vec3 worldPos = (worldMat * vec4(vertexPosition_modelspace,1)).xyz;
26 camDirIn = invWorldRot * (vec3(0,0,1) - worldPos); 27 camDirIn = invWorldRot * (vec3(2,0,0) - worldPos);
27 //camDir = worldPos; 28 //camDir = worldPos;
28 lightDirIn = invWorldRot * (Tuning_LightPos - worldPos); 29 lightDirIn = invWorldRot * (Tuning_LightPos - worldPos);
29 //vec4 vertPos4 = vec4(vertexPosition_modelspace,1); 30 //vec4 vertPos4 = vec4(vertexPosition_modelspace,1);