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.vertex8
1 files changed, 2 insertions, 6 deletions
diff --git a/shaders/final.vertex b/shaders/final.vertex index 4c5b1d5..ed6079f 100644 --- a/shaders/final.vertex +++ b/shaders/final.vertex
@@ -8,12 +8,11 @@ out vec2 UV;
8out vec3 normIn; 8out vec3 normIn;
9out vec3 camDirIn; 9out vec3 camDirIn;
10out vec3 lightDirIn; 10out vec3 lightDirIn;
11//out vec3 vertPos;
12 11
13uniform mat4 MVP; 12uniform mat4 MVP;
14uniform mat4 worldMat; 13uniform mat4 worldMat;
15 14
16const vec3 Tuning_LightPos = vec3(1, 1, -1.0); 15const vec3 Tuning_LightPos = vec3(2, 1, -1);
17 16
18void main() 17void main()
19{ 18{
@@ -22,11 +21,8 @@ void main()
22 normIn = vertexNormal; 21 normIn = vertexNormal;
23 22
24 mat3 invWorldRot = transpose(mat3(worldMat[0].xyz, worldMat[1].xyz, worldMat[2].xyz)); 23 mat3 invWorldRot = transpose(mat3(worldMat[0].xyz, worldMat[1].xyz, worldMat[2].xyz));
25 //mat3 invWorldRot = mat3(1.0f);
26 vec3 worldPos = (worldMat * vec4(vertexPosition_modelspace,1)).xyz; 24 vec3 worldPos = (worldMat * vec4(vertexPosition_modelspace,1)).xyz;
25
27 camDirIn = invWorldRot * (vec3(2,0,0) - worldPos); 26 camDirIn = invWorldRot * (vec3(2,0,0) - worldPos);
28 //camDir = worldPos;
29 lightDirIn = invWorldRot * (Tuning_LightPos - worldPos); 27 lightDirIn = invWorldRot * (Tuning_LightPos - worldPos);
30 //vec4 vertPos4 = vec4(vertexPosition_modelspace,1);
31 //vertPos = vec3(vertPos4) / vertPos4.w;
32} 28}